Commit 95466c4b authored by mnair's avatar mnair

updated changes in customer code validation

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@177081 ce508802-f39f-4f6c-b175-0d175dae99d5
parent be5ac45b
...@@ -119,6 +119,28 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -119,6 +119,28 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
} }
else 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);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Count value for cust_code--->"+cnt);
if (cnt == 0)
{
errCode = "VTINCOD"; //Customer code does not exists in the customer master.Please enter another cust code
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if ("A".equalsIgnoreCase(editFlag)) if ("A".equalsIgnoreCase(editFlag))
{ {
sql = "select count(*) from sprs_stockist where sprs_code = ? and cust_code = ?"; sql = "select count(*) from sprs_stockist where sprs_code = ? and cust_code = ?";
...@@ -203,7 +225,6 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal ...@@ -203,7 +225,6 @@ 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);
......
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