Commit 0517a242 authored by mnair's avatar mnair

Updated component

1)SprsStockistIC


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@176652 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 69c99701
...@@ -107,7 +107,10 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -107,7 +107,10 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
if (childNodeName.equalsIgnoreCase("cust_code")) if (childNodeName.equalsIgnoreCase("cust_code"))
{ {
custCode = checkNull(genericUtility.getColumnValue("cust_code",dom)); custCode = checkNull(genericUtility.getColumnValue("cust_code",dom));
sprsCode = checkNull(genericUtility.getColumnValue("sprs_code",dom));
System.out.println("custCode--->["+custCode+"]"); System.out.println("custCode--->["+custCode+"]");
System.out.println("sprsCode--->["+sprsCode+"]");
if(custCode == null || custCode.length()==0) if(custCode == null || custCode.length()==0)
{ {
errCode = "NULLCUSTCD";//customer code is left blank errCode = "NULLCUSTCD";//customer code is left blank
...@@ -116,26 +119,34 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -116,26 +119,34 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
} }
else else
{ {
sql= "select count(*) from customer where cust_code = ?"; if ("A".equalsIgnoreCase(editFlag))
pstmt=conn.prepareStatement(sql); {
pstmt.setString(1,custCode); sql = "select count(*) from sprs_stockist where sprs_code = ? and cust_code = ?";
rs=pstmt.executeQuery(); pstmt = conn.prepareStatement(sql);
if(rs.next()){ pstmt.setString(1, sprsCode);
cnt=rs.getInt(1); pstmt.setString(2, custCode);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("Count value for custCode--->"+cnt); if (cnt > 0)
if(cnt == 0)
{ {
errCode = "VTIVCC";//enter a customer code errCode = "VTCUSTCD"; //Customer code with the same sprs code already exists.Please enter another cust code
errList.add( errCode ); errList.add(errCode);
errFields.add( childNodeName.toLowerCase() ); errFields.add(childNodeName.toLowerCase());
} }
}//end of else inside cust_code }//end of if loop for edit flag E
} //end of if loop for cust_code
}//end of else for cust code
}//end of if loop for cust code
if (childNodeName.equalsIgnoreCase("sprs_code")) if (childNodeName.equalsIgnoreCase("sprs_code"))
{ {
...@@ -179,6 +190,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -179,6 +190,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
routeId = checkNull(genericUtility.getColumnValue("route_id",dom)); routeId = checkNull(genericUtility.getColumnValue("route_id",dom));
sprsCode = checkNull(genericUtility.getColumnValue("sprs_code",dom)); sprsCode = checkNull(genericUtility.getColumnValue("sprs_code",dom));
System.out.println("routeId--->["+routeId+"]"); System.out.println("routeId--->["+routeId+"]");
System.out.println("sprsCode--->["+sprsCode+"]"); System.out.println("sprsCode--->["+sprsCode+"]");
...@@ -191,6 +203,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -191,6 +203,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
}//end of if inside route id }//end of if inside route id
else { else {
sql= "select count(*) from sprs_route where route_id = ? and sprs_code=?"; sql= "select count(*) from sprs_route where route_id = ? and sprs_code=?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,routeId); pstmt.setString(1,routeId);
...@@ -212,6 +225,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -212,6 +225,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
} }
}//end of if loop for route_id }//end of if loop for route_id
...@@ -400,6 +414,8 @@ public String itemChanged(Document dom, Document dom1,Document dom2, String objC ...@@ -400,6 +414,8 @@ public String itemChanged(Document dom, Document dom1,Document dom2, String objC
valueXmlString.append("<cust_name>").append("<![CDATA[" + custDescr + "]]>").append("</cust_name>"); valueXmlString.append("<cust_name>").append("<![CDATA[" + custDescr + "]]>").append("</cust_name>");
} //end of if condition for customer code } //end of if condition for customer code
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
}//end of switch case }//end of switch case
......
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