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
System.out.println("currentFormNo:::" + currentFormNo);
// Changed by Pooja S. on 13-AUG-18 START
System.out.println("formName:::" + formName);
String domID = "";
String currDomID = "";
// switch(currentFormName)
// {
if (currentFormNo == 1 || "accounts".equals(formName))
......@@ -320,7 +322,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
{
parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentNodeList.item(0);
domID1 = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
currDomID = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++)
......@@ -395,7 +397,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
domID = parentNode2.getAttributes().getNamedItem("domID").getNodeValue();
NodeList childNodeList2 = parentNode2.getChildNodes();
childNodeListLength2 = childNodeList2.getLength();
if(domID.equals(domID1))
if(domID.equals(currDomID))
{
System.out.println("Dom ides are equals");
continue;
......@@ -431,13 +433,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
errFields.add(childNodeName.toLowerCase());
break;
}
else
{
sitecodeall.add(siteCode);
}
}
}
}
System.out.println("ArrayList contaions in of loop"+sitecodeall);
}
}
}
......@@ -446,7 +442,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
{
parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentNodeList.item(0);
domID1 = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
currDomID = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++)
......@@ -521,7 +517,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
domID = parentNode3.getAttributes().getNamedItem("domID").getNodeValue();
NodeList childNodeList2 = parentNode3.getChildNodes();
childNodeListLength3 = childNodeList2.getLength();
if(domID.equals(domID1))
if(domID.equals(currDomID))
{
System.out.println("Dom ides are equals");
continue;
......@@ -566,7 +562,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
{
parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentNodeList.item(0);
domID1 = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
currDomID = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++)
......@@ -639,7 +635,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
domID = parentNode3.getAttributes().getNamedItem("domID").getNodeValue();
NodeList childNodeList2 = parentNode3.getChildNodes();
childNodeListLength3 = childNodeList2.getLength();
if(domID.equals(domID1))
if(domID.equals(currDomID))
{
System.out.println("Dom ides are equals");
continue;
......@@ -683,7 +679,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
{
parentNodeList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentNodeList.item(0);
domID1 = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
currDomID = parentNode.getAttributes().getNamedItem("domID").getNodeValue();
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++)
......@@ -756,7 +752,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
domID = parentNode3.getAttributes().getNamedItem("domID").getNodeValue();
NodeList childNodeList2 = parentNode3.getChildNodes();
childNodeListLength3 = childNodeList2.getLength();
if(domID.equals(domID1))
if(domID.equals(currDomID))
{
System.out.println("Dom ides are equals");
continue;
......@@ -941,9 +937,9 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
// changed by sarita on 09MARCH2018
conn = getConnection();
/* connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;*/
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;*/
// changes and commented by sarita for DBConnection on 01/06/2017 :END
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
if (objContext != null && objContext.trim().length() > 0)
......@@ -955,7 +951,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
valueXmlString.append(editFlag).append("</editFlag></header>");
/*
* switch(currentFormNo) { case 1:
* switch(currentFormNo) { case 1:
* {
*/
// Changed by Pooja S. on 13-AUG-18
......@@ -968,7 +964,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail" + currentFormNo + ">");
childNodeListLength = childNodeList.getLength();
do
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
......@@ -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("</Detail" + currentFormNo + ">");
}
}
else if (currentFormNo == 3 || "acctcostcntre".equals(formName))
{
valueXmlString.append("<Detail" + currentFormNo + ">");
......@@ -1190,7 +1186,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
acct_code = checkNull(genericUtility.getColumnValue("acct_code", dom));
valueXmlString.append("<acct_code protect = \"1\"><![CDATA[" + acct_code + "]]></acct_code>");
valueXmlString.append("<cctr_code protect = \"0\"><![CDATA[]]></cctr_code>");
}
}
else if ("cctr_code".equalsIgnoreCase(currentColumn.trim()))
{
String cctr_code = checkNull(genericUtility.getColumnValue("cctr_code", dom));
......@@ -1202,7 +1198,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctr_code);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
descr = checkNull(rs.getString("descr"));
sh_descr = checkNull(rs.getString("sh_descr"));
......@@ -1226,7 +1222,7 @@ public class AccountsIC extends ValidatorEJB implements AccountsICRemote, Accoun
acct_code = checkNull(genericUtility.getColumnValue("acct_code", dom));
valueXmlString.append("<acct_code protect = \"1\"><![CDATA[" + acct_code + "]]></acct_code>");
valueXmlString.append("<anal_code protect = \"0\"><![CDATA[]]></anal_code>");
}
}
else if ("anal_code".equalsIgnoreCase(currentColumn.trim()))
{
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