Commit 612ba8ac authored by psawant's avatar psawant

In edit mode when we delete previously added row and add that row again then...

In edit mode when we delete previously added row and add that row again then system is display error as 'Transaction already exists'.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@190879 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bd9c8f12
...@@ -116,6 +116,8 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -116,6 +116,8 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
System.out.println("currentFormNo:::" + currentFormNo); System.out.println("currentFormNo:::" + currentFormNo);
// Changed by Pooja S. on 13-AUG-18 START // Changed by Pooja S. on 13-AUG-18 START
System.out.println("formName:::" + formName); System.out.println("formName:::" + formName);
String domID = "";
String currDomID = "";
// switch(currentFormName) // switch(currentFormName)
// { // {
if (currentFormNo == 1 || "accounts".equals(formName)) if (currentFormNo == 1 || "accounts".equals(formName))
...@@ -320,7 +322,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -320,7 +322,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
{ {
parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo); parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
domID1 = parentNode.getAttributes().getNamedItem("domID").getNodeValue(); currDomID = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength(); childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++) for (ctr = 0; ctr < childNodeLength; ctr++)
...@@ -395,7 +397,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -395,7 +397,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
domID = parentNode2.getAttributes().getNamedItem("domID").getNodeValue(); domID = parentNode2.getAttributes().getNamedItem("domID").getNodeValue();
NodeList childNodeList2 = parentNode2.getChildNodes(); NodeList childNodeList2 = parentNode2.getChildNodes();
childNodeListLength2 = childNodeList2.getLength(); childNodeListLength2 = childNodeList2.getLength();
if(domID.equals(domID1)) if(domID.equals(currDomID))
{ {
System.out.println("Dom ides are equals"); System.out.println("Dom ides are equals");
continue; continue;
...@@ -431,13 +433,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -431,13 +433,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
} }
else System.out.println("ArrayList contaions in of loop"+sitecodeall);
{
sitecodeall.add(siteCode);
}
}
}
}
} }
} }
} }
...@@ -446,7 +442,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -446,7 +442,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
{ {
parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo); parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
domID1 = parentNode.getAttributes().getNamedItem("domID").getNodeValue(); currDomID = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength(); childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++) for (ctr = 0; ctr < childNodeLength; ctr++)
...@@ -521,7 +517,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -521,7 +517,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
domID = parentNode3.getAttributes().getNamedItem("domID").getNodeValue(); domID = parentNode3.getAttributes().getNamedItem("domID").getNodeValue();
NodeList childNodeList2 = parentNode3.getChildNodes(); NodeList childNodeList2 = parentNode3.getChildNodes();
childNodeListLength3 = childNodeList2.getLength(); childNodeListLength3 = childNodeList2.getLength();
if(domID.equals(domID1)) if(domID.equals(currDomID))
{ {
System.out.println("Dom ides are equals"); System.out.println("Dom ides are equals");
continue; continue;
...@@ -566,7 +562,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -566,7 +562,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
{ {
parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo); parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
domID1 = parentNode.getAttributes().getNamedItem("domID").getNodeValue(); currDomID = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength(); childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++) for (ctr = 0; ctr < childNodeLength; ctr++)
...@@ -639,7 +635,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -639,7 +635,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
domID = parentNode3.getAttributes().getNamedItem("domID").getNodeValue(); domID = parentNode3.getAttributes().getNamedItem("domID").getNodeValue();
NodeList childNodeList2 = parentNode3.getChildNodes(); NodeList childNodeList2 = parentNode3.getChildNodes();
childNodeListLength3 = childNodeList2.getLength(); childNodeListLength3 = childNodeList2.getLength();
if(domID.equals(domID1)) if(domID.equals(currDomID))
{ {
System.out.println("Dom ides are equals"); System.out.println("Dom ides are equals");
continue; continue;
...@@ -683,7 +679,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -683,7 +679,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
{ {
parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo); parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
domID1 = parentNode.getAttributes().getNamedItem("domID").getNodeValue(); currDomID = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength(); childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++) for (ctr = 0; ctr < childNodeLength; ctr++)
...@@ -756,7 +752,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -756,7 +752,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
domID = parentNode3.getAttributes().getNamedItem("domID").getNodeValue(); domID = parentNode3.getAttributes().getNamedItem("domID").getNodeValue();
NodeList childNodeList2 = parentNode3.getChildNodes(); NodeList childNodeList2 = parentNode3.getChildNodes();
childNodeListLength3 = childNodeList2.getLength(); childNodeListLength3 = childNodeList2.getLength();
if(domID.equals(domID1)) if(domID.equals(currDomID))
{ {
System.out.println("Dom ides are equals"); System.out.println("Dom ides are equals");
continue; continue;
...@@ -941,9 +937,9 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -941,9 +937,9 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
// changed by sarita on 09MARCH2018 // changed by sarita on 09MARCH2018
conn = getConnection(); conn = getConnection();
/* connDriver = new ConnDriver(); /* connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false); conn.setAutoCommit(false);
connDriver = null;*/ connDriver = null;*/
// changes and commented by sarita for DBConnection on 01/06/2017 :END // changes and commented by sarita for DBConnection on 01/06/2017 :END
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
if (objContext != null && objContext.trim().length() > 0) if (objContext != null && objContext.trim().length() > 0)
...@@ -955,7 +951,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -955,7 +951,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
valueXmlString.append(editFlag).append("</editFlag></header>"); valueXmlString.append(editFlag).append("</editFlag></header>");
/* /*
* switch(currentFormNo) { case 1: * switch(currentFormNo) { case 1:
* { * {
*/ */
// Changed by Pooja S. on 13-AUG-18 // Changed by Pooja S. on 13-AUG-18
...@@ -968,7 +964,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -968,7 +964,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail" + currentFormNo + ">"); valueXmlString.append("<Detail" + currentFormNo + ">");
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
do do
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
...@@ -1181,7 +1177,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -1181,7 +1177,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
valueXmlString.append("<acct_code protect = \"1\"><![CDATA[" + acct_code + "]]></acct_code>"); valueXmlString.append("<acct_code protect = \"1\"><![CDATA[" + acct_code + "]]></acct_code>");
} }
valueXmlString.append("</Detail" + currentFormNo + ">"); valueXmlString.append("</Detail" + currentFormNo + ">");
} }
else if (currentFormNo == 3 || "acctcostcntre".equals(formName)) else if (currentFormNo == 3 || "acctcostcntre".equals(formName))
{ {
valueXmlString.append("<Detail" + currentFormNo + ">"); valueXmlString.append("<Detail" + currentFormNo + ">");
...@@ -1190,7 +1186,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -1190,7 +1186,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
acct_code = checkNull(genericUtility.getColumnValue("acct_code", dom)); acct_code = checkNull(genericUtility.getColumnValue("acct_code", dom));
valueXmlString.append("<acct_code protect = \"1\"><![CDATA[" + acct_code + "]]></acct_code>"); valueXmlString.append("<acct_code protect = \"1\"><![CDATA[" + acct_code + "]]></acct_code>");
valueXmlString.append("<cctr_code protect = \"0\"><![CDATA[]]></cctr_code>"); valueXmlString.append("<cctr_code protect = \"0\"><![CDATA[]]></cctr_code>");
} }
else if ("cctr_code".equalsIgnoreCase(currentColumn.trim())) else if ("cctr_code".equalsIgnoreCase(currentColumn.trim()))
{ {
String cctr_code = checkNull(genericUtility.getColumnValue("cctr_code", dom)); String cctr_code = checkNull(genericUtility.getColumnValue("cctr_code", dom));
...@@ -1202,7 +1198,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -1202,7 +1198,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctr_code); pstmt.setString(1, cctr_code);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
descr = checkNull(rs.getString("descr")); descr = checkNull(rs.getString("descr"));
sh_descr = checkNull(rs.getString("sh_descr")); sh_descr = checkNull(rs.getString("sh_descr"));
...@@ -1226,7 +1222,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun ...@@ -1226,7 +1222,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
acct_code = checkNull(genericUtility.getColumnValue("acct_code", dom)); acct_code = checkNull(genericUtility.getColumnValue("acct_code", dom));
valueXmlString.append("<acct_code protect = \"1\"><![CDATA[" + acct_code + "]]></acct_code>"); valueXmlString.append("<acct_code protect = \"1\"><![CDATA[" + acct_code + "]]></acct_code>");
valueXmlString.append("<anal_code protect = \"0\"><![CDATA[]]></anal_code>"); valueXmlString.append("<anal_code protect = \"0\"><![CDATA[]]></anal_code>");
} }
else if ("anal_code".equalsIgnoreCase(currentColumn.trim())) else if ("anal_code".equalsIgnoreCase(currentColumn.trim()))
{ {
String anal_code = checkNull(genericUtility.getColumnValue("anal_code", dom)); String anal_code = checkNull(genericUtility.getColumnValue("anal_code", dom));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment