Commit 0ddf2fc7 authored by ngadkari's avatar ngadkari

Request Id - D17IBAS001

  for group scheme master

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@176448 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 35b6d1be
...@@ -97,7 +97,7 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr ...@@ -97,7 +97,7 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr
int currentFormNo =0,recCnt=0,ct=0,n1=0,pcp1=0,pco1=0; int currentFormNo =0,recCnt=0,ct=0,n1=0,pcp1=0,pco1=0;
String schemeCode="",purchaseBaser="",keyFlag="",schemeAllowence="" ,itemCode="",pcp="",pco=""; String schemeCode="",purchaseBaser="",keyFlag="",schemeAllowence="" ,itemCode="",pcp="",pco="",descr="",shdescr="";
double exchRate=0; double exchRate=0;
...@@ -212,6 +212,21 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr ...@@ -212,6 +212,21 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr
} }
if(childNodeName.equalsIgnoreCase("descr"))
{
descr = genericUtility.getColumnValue("descr", dom);
if( descr == null)
{
errCode = "VEADN3";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errString = getErrorString("Empty description", errCode, userId);
System.out.println("Description should not be blank!!!");
}
}
if(childNodeName.equalsIgnoreCase("purc_base")) if(childNodeName.equalsIgnoreCase("purc_base"))
{ {
purchaseBaser = genericUtility.getColumnValue("purc_base", dom); purchaseBaser = genericUtility.getColumnValue("purc_base", dom);
...@@ -375,53 +390,49 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr ...@@ -375,53 +390,49 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr
} }
}
if(childNodeName.equalsIgnoreCase("item_code"))
{
itemCode = genericUtility.getColumnValue("item_code", dom);
if( itemCode == null)
{
errCode = "VMITEMCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errString = getErrorString("Empty item code ", errCode, userId);
System.out.println("item code should not be blank!!!");
}
if(childNodeName.equalsIgnoreCase("item_code")) else
{ { pcp = genericUtility.getColumnValue("prod_code__pur", dom1);
itemCode = genericUtility.getColumnValue("item_code", dom); sql = " select count (*) from item where item_code = ? and product_code = ? ";
if( itemCode == null) pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, pcp);
rs = pstmt.executeQuery();
if(rs.next())
{ {
errCode = "VMITEMCD1"; ct = rs.getInt(1);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
System.out.println("ct !!!"+ct);
if(ct == 0)
{
errCode = "VTIMPCPU";//Invalid item code!!!
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
errString = getErrorString("Empty item code ", errCode, userId); errString = getErrorString("Invalid item code", errCode, userId);
System.out.println("item code should not be blank!!!"); System.out.println("Error due to item code not exist in Purchase group!!");
} }
else
{
sql = " select count (*) from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
ct = rs.getInt(1);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
System.out.println("ct !!!"+ct);
if(ct == 0)
{
errCode = "VMITEM_CD";//Invalid item code!!!
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errString = getErrorString("Invalid item code", errCode, userId);
System.out.println("Error due to item code not exist in master!!");
}
} }
} }
}
...@@ -429,6 +440,18 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr ...@@ -429,6 +440,18 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr
case 3: case 3:
Node currDetailF=null;
/*int count=0;*/
NodeList detailList1 = dom2.getElementsByTagName("Detail1");
currDetailF = detailList1.item(0);
pco = genericUtility.getColumnValueFromNode("prod_code__off",currDetailF);
System.out.println("productCodeoffer:"+pco);
parentNodeList = dom.getElementsByTagName("Detail3"); parentNodeList = dom.getElementsByTagName("Detail3");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
...@@ -438,6 +461,9 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr ...@@ -438,6 +461,9 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("scheme_code")) if(childNodeName.equalsIgnoreCase("scheme_code"))
{ {
...@@ -494,54 +520,49 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr ...@@ -494,54 +520,49 @@ public class GroupSchemeIC extends ValidatorEJB implements GroupSchemeICLocal,Gr
} }
} }
}
if(childNodeName.equalsIgnoreCase("item_code"))
{
itemCode = genericUtility.getColumnValue("item_code", dom);
if( itemCode == null)
{
errCode = "VMITEMCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errString = getErrorString("Empty item code ", errCode, userId);
System.out.println("item code should not be blank!!!");
}
if(childNodeName.equalsIgnoreCase("item_code")) else
{ {
itemCode = genericUtility.getColumnValue("item_code", dom); sql = " select count (*) from item where item_code = ? and product_code = ? ";
if( itemCode == null) pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, pco);
rs = pstmt.executeQuery();
if(rs.next())
{ {
errCode = "VMITEMCD1"; ct = rs.getInt(1);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
System.out.println("ct !!!"+ct);
if(ct == 0)
{
errCode = "VTIMPCOF";//Invalid item code!!!
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
errString = getErrorString("Empty item code ", errCode, userId); errString = getErrorString("Invalid item code", errCode, userId);
System.out.println("item code should not be blank!!!"); System.out.println("Error due to item code not exist offer group !!");
} }
else
{
sql = " select count (*) from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
ct = rs.getInt(1);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
System.out.println("ct !!!"+ct);
if(ct == 0)
{
errCode = "VMITEM_CD";//Invalid Station code!!!
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errString = getErrorString("Invalid item code", errCode, userId);
System.out.println("Error due to item code not exist in master!!");
}
} }
} }
}
......
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