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
if (childNodeName.equalsIgnoreCase("cust_code"))
{
custCode = checkNull(genericUtility.getColumnValue("cust_code",dom));
sprsCode = checkNull(genericUtility.getColumnValue("sprs_code",dom));
System.out.println("custCode--->["+custCode+"]");
System.out.println("sprsCode--->["+sprsCode+"]");
if(custCode == null || custCode.length()==0)
{
errCode = "NULLCUSTCD";//customer code is left blank
......@@ -116,26 +119,34 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
}
else
{
sql= "select count(*) from customer where cust_code = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,custCode);
rs=pstmt.executeQuery();
if(rs.next()){
cnt=rs.getInt(1);
if ("A".equalsIgnoreCase(editFlag))
{
sql = "select count(*) from sprs_stockist where sprs_code = ? and cust_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sprsCode);
pstmt.setString(2, custCode);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Count value for custCode--->"+cnt);
if(cnt == 0)
if (cnt > 0)
{
errCode = "VTIVCC";//enter a customer code
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
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 else inside cust_code
} //end of if loop for cust_code
}//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"))
{
......@@ -179,6 +190,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
routeId = checkNull(genericUtility.getColumnValue("route_id",dom));
sprsCode = checkNull(genericUtility.getColumnValue("sprs_code",dom));
System.out.println("routeId--->["+routeId+"]");
System.out.println("sprsCode--->["+sprsCode+"]");
......@@ -191,6 +203,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
}//end of if inside route id
else {
sql= "select count(*) from sprs_route where route_id = ? and sprs_code=?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,routeId);
......@@ -212,6 +225,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
errFields.add( childNodeName.toLowerCase() );
}
}
}//end of if loop for route_id
......@@ -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>");
} //end of if condition for customer code
valueXmlString.append("</Detail1>");
}//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