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
...@@ -104,38 +104,49 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -104,38 +104,49 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
System.out.println("Child name --->> "+childNodeName); System.out.println("Child name --->> "+childNodeName);
//Validation for cust code //Validation for cust code
if (childNodeName.equalsIgnoreCase("cust_code")) if (childNodeName.equalsIgnoreCase("cust_code"))
{ {
custCode = checkNull(genericUtility.getColumnValue("cust_code",dom)); custCode = checkNull(genericUtility.getColumnValue("cust_code",dom));
System.out.println("custCode--->["+custCode+"]"); sprsCode = checkNull(genericUtility.getColumnValue("sprs_code",dom));
if(custCode == null || custCode.length()==0)
{ System.out.println("custCode--->["+custCode+"]");
errCode = "NULLCUSTCD";//customer code is left blank System.out.println("sprsCode--->["+sprsCode+"]");
errList.add( errCode ); if(custCode == null || custCode.length()==0)
errFields.add( childNodeName.toLowerCase() ); {
} errCode = "NULLCUSTCD";//customer code is left blank
else errList.add( errCode );
{ errFields.add( childNodeName.toLowerCase() );
sql= "select count(*) from customer where cust_code = ?"; }
pstmt=conn.prepareStatement(sql); else
pstmt.setString(1,custCode); {
rs=pstmt.executeQuery(); if ("A".equalsIgnoreCase(editFlag))
if(rs.next()){ {
cnt=rs.getInt(1); sql = "select count(*) from sprs_stockist where sprs_code = ? and cust_code = ?";
} pstmt = conn.prepareStatement(sql);
rs.close(); pstmt.setString(1, sprsCode);
rs = null; pstmt.setString(2, custCode);
pstmt.close(); rs = pstmt.executeQuery();
pstmt = null;
System.out.println("Count value for custCode--->"+cnt); if (rs.next())
if(cnt == 0) {
{ cnt = rs.getInt(1);
errCode = "VTIVCC";//enter a customer code }
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); rs.close();
} rs = null;
}//end of else inside cust_code pstmt.close();
} //end of if loop for cust_code pstmt = null;
if (cnt > 0)
{
errCode = "VTCUSTCD"; //Customer code with the same sprs code already exists.Please enter another cust code
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}//end of if loop for edit flag E
}//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+"]");
...@@ -190,6 +202,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -190,6 +202,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
}//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);
...@@ -211,6 +224,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -211,6 +224,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
} }
...@@ -384,9 +398,9 @@ public String itemChanged(Document dom, Document dom1,Document dom2, String objC ...@@ -384,9 +398,9 @@ public String itemChanged(Document dom, Document dom1,Document dom2, String objC
if(sprsCode.length() > 0) if(sprsCode.length() > 0)
{ {
sprsDescr =getColumnDescr(conn, "SP_NAME", "sales_pers", "SALES_PERS", sprsCode); sprsDescr =getColumnDescr(conn, "SP_NAME", "sales_pers", "SALES_PERS", sprsCode);
} }
valueXmlString.append("<sp_name>").append("<![CDATA[" + sprsDescr + "]]>").append("</sp_name>"); valueXmlString.append("<sp_name>").append("<![CDATA[" + sprsDescr + "]]>").append("</sp_name>");
} //end of if condition for sales person code } //end of if condition for sales person code
if (currentColumn.trim().equalsIgnoreCase("cust_code"))//FOR CUSTOMER MASTER if (currentColumn.trim().equalsIgnoreCase("cust_code"))//FOR CUSTOMER MASTER
...@@ -394,12 +408,14 @@ public String itemChanged(Document dom, Document dom1,Document dom2, String objC ...@@ -394,12 +408,14 @@ public String itemChanged(Document dom, Document dom1,Document dom2, String objC
custCode = checkNull(genericUtility.getColumnValue("cust_code",dom)); custCode = checkNull(genericUtility.getColumnValue("cust_code",dom));
System.out.println("cust_code ----->>["+custCode+"]"); System.out.println("cust_code ----->>["+custCode+"]");
if(custCode.length() > 0) if(custCode.length() > 0)
{ {
custDescr =getColumnDescr(conn, "CUST_NAME", "customer", "CUST_CODE", custCode); custDescr =getColumnDescr(conn, "CUST_NAME", "customer", "CUST_CODE", custCode);
} }
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