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
childNodeName = childNode.getNodeName();
System.out.println("Child name --->> "+childNodeName);
//Validation for cust code
if (childNodeName.equalsIgnoreCase("cust_code"))
{
custCode = checkNull(genericUtility.getColumnValue("cust_code",dom));
System.out.println("custCode--->["+custCode+"]");
if(custCode == null || custCode.length()==0)
{
errCode = "NULLCUSTCD";//customer code is left blank
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
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 custCode--->"+cnt);
if(cnt == 0)
{
errCode = "VTIVCC";//enter a customer code
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}//end of else inside cust_code
} //end of if loop for cust_code
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
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
else
{
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;
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"))
{
......@@ -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+"]");
......@@ -190,6 +202,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
errFields.add( childNodeName.toLowerCase() );
}//end of if inside route id
else {
sql= "select count(*) from sprs_route where route_id = ? and sprs_code=?";
pstmt=conn.prepareStatement(sql);
......@@ -211,6 +224,7 @@ public class SprsStockistIC extends ValidatorEJB implements SprsStockistICLocal
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
......@@ -384,9 +398,9 @@ public String itemChanged(Document dom, Document dom1,Document dom2, String objC
if(sprsCode.length() > 0)
{
sprsDescr =getColumnDescr(conn, "SP_NAME", "sales_pers", "SALES_PERS", sprsCode);
}
}
valueXmlString.append("<sp_name>").append("<![CDATA[" + sprsDescr + "]]>").append("</sp_name>");
} //end of if condition for sales person code
if (currentColumn.trim().equalsIgnoreCase("cust_code"))//FOR CUSTOMER MASTER
......@@ -394,12 +408,14 @@ public String itemChanged(Document dom, Document dom1,Document dom2, String objC
custCode = checkNull(genericUtility.getColumnValue("cust_code",dom));
System.out.println("cust_code ----->>["+custCode+"]");
if(custCode.length() > 0)
{
{
custDescr =getColumnDescr(conn, "CUST_NAME", "customer", "CUST_CODE", custCode);
}
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>");
}//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