Commit 1ec00647 authored by nkhan's avatar nkhan

[S15IBAS003] Updated Sources For Adding Validation From MSI And removing extra validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103418 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a742bd72
......@@ -5,15 +5,12 @@ import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......
......@@ -104,6 +104,8 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
/* Comment By Nasruddin [16-sep-19] START
if(childNodeName.equalsIgnoreCase("dist_route"))
{
distRoute = checkNull(genericUtility.getColumnValue("dist_route", dom));
......@@ -149,17 +151,19 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
errFields.add(childNodeName.toLowerCase());
}
}
else if(childNodeName.equalsIgnoreCase("stan_code__fr"))
} Comment By Nasruddin [16-sep-19] END */
if(childNodeName.equalsIgnoreCase("stan_code__fr"))
{
StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeFrom == null || StanCodeFrom.trim().length() == 0)
{
errCode = "VMSTANCOD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(StanCodeFrom != null && StanCodeFrom.trim().length() > 0)
Comment By Nasruddin [16-sep-19] End */
if(StanCodeFrom != null && StanCodeFrom.trim().length() > 0)
{
sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -184,13 +188,15 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
else if(childNodeName.equalsIgnoreCase("stan_code__to"))
{
StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeTo == null || StanCodeTo.trim().length() == 0)
{
errCode = "VMSTANCOD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(StanCodeTo != null && StanCodeTo.trim().length() > 0)
Comment By Nasruddin [16-sep-19] End */
if(StanCodeTo != null && StanCodeTo.trim().length() > 0)
{
sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -257,13 +263,15 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
if(childNodeName.equalsIgnoreCase("stan_code__fr"))
{
StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeFrom == null || StanCodeFrom.trim().length() == 0)
{
errCode = "VMSTANCOD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(StanCodeFrom != null && StanCodeFrom.trim().length() > 0)
}Comment By Nasruddin [16-sep-19] End */
if(StanCodeFrom != null && StanCodeFrom.trim().length() > 0)
{
sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -288,13 +296,14 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
else if(childNodeName.equalsIgnoreCase("stan_code__to"))
{
StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeTo == null || StanCodeTo.trim().length() == 0)
{
errCode = "VMSTANCOD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(StanCodeTo != null && StanCodeTo.trim().length() > 0)
}Comment By Nasruddin [16-sep-19] End */
if(StanCodeTo != null && StanCodeTo.trim().length() > 0)
{
sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
......
......@@ -113,6 +113,7 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
/* Comment By Nasruddin khan Start [16/SEP/16] Start
if(childNodeName.trim().equalsIgnoreCase("item_ser"))
{
itemSer = genericUtility.getColumnValue("item_ser", dom);
......@@ -125,7 +126,8 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr
}
}
else if(childNodeName.trim().equalsIgnoreCase("sc_code"))
Comment By Nasruddin khan Start [16/SEP/16] END*/
if(childNodeName.trim().equalsIgnoreCase("sc_code"))
{
scCode = genericUtility.getColumnValue("sc_code", dom);
if(scCode != null && scCode.trim().length() > 0)
......@@ -167,7 +169,10 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr
scCode = genericUtility.getColumnValue("sc_code", dom);
itemSer = genericUtility.getColumnValue("ls_item_ser", dom);
}
if(scCode == null){scCode = "";}
if(scCode == null)
{
scCode = "";
}
sql = "select count(1) from disc_apr_strg where item_ser = ? and sc_code = ? and eff_from = ? ";
pstmt = conn.prepareStatement(sql);
......
......@@ -75,39 +75,53 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe
//Changes and Commented By Bhushan on 13-06-2016 :END
conn.setAutoCommit(false);
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, userId);
if (objContext != null && objContext.trim().length() > 0) {
if (objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext);
}
switch (currentFormNo) {
switch (currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++) {
for (ctr = 0; ctr < childNodeLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase("agent_code")) {
if (childNodeName.equalsIgnoreCase("agent_code"))
{
System.out.println(":::childNodeName" + childNodeName);
String agentCode = genericUtility.getColumnValue("agent_code", dom);
agentCode = agentCode == null ? "" : agentCode.trim();
System.out.println("::: agentCode" + agentCode);
if(agentCode.length() <= 0){
if(agentCode.length() <= 0)
{
errString = itmdbAccessEJB.getErrorString("agent_code", "VTAGENTB", userId);
break;
}
else{
if(editFlag.equalsIgnoreCase("A")){
else
{
if(editFlag.equalsIgnoreCase("A"))
{
int count = 0;
sql = "select count(*) as count from ins_agent where agent_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, agentCode);
rs = pstmt.executeQuery();
if(rs.next()){
if(rs.next())
{
count = rs.getInt("count");
}
// Changed By Nasruddin khan [16-SEP-16] START
pstmt.close();
pstmt = null;
rs.close();
rs = null;
// Changed By Nasruddin khan [16-SEP-16] END
if(count > 0){
errString = itmdbAccessEJB.getErrorString("agent_code", "VDIAC", userId);
break;
......@@ -116,17 +130,21 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe
}
}
if (childNodeName.equalsIgnoreCase("count_code")) {
if (childNodeName.equalsIgnoreCase("count_code"))
{
System.out.println(":::childNodeName" + childNodeName);
String countCode = genericUtility.getColumnValue("count_code", dom);
/* Changed By Nasruddin [16-SEP-16] START
countCode = countCode == null ? "" : countCode.trim();
System.out.println("::: countCode" + countCode);
if(countCode.length() <= 0){
if(countCode.length() <= 0)
{
errString = itmdbAccessEJB.getErrorString("count_code", "VTCOUNTB", userId);
break;
}
else{
else Changed By Nasruddin [16-SEP-16] END*/
if( countCode != null && countCode.trim().length() > 0)
{
int count = 0;
sql = "select count(*) as count from country where count_code = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -136,23 +154,27 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe
if(rs.next()){
count = rs.getInt("count");
}
if(count <= 0){
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("count_code", "VTCONTCD1", userId);
break;
}
}
}
if (childNodeName.equalsIgnoreCase("stan_code")) {
if (childNodeName.equalsIgnoreCase("stan_code"))
{
System.out.println(":::childNodeName" + childNodeName);
String stanCode = genericUtility.getColumnValue("stan_code", dom);
/* Changed By Nasruddin [16/SEP/16] START
stanCode = stanCode == null ? "" : stanCode.trim();
System.out.println("::: stanCode" + stanCode);
if(stanCode.length() <= 0){
if(stanCode.length() <= 0)
{
errString = itmdbAccessEJB.getErrorString("stan_code", "VTSTATB", userId);
break;
}
else{
else
{
int count = 0;
sql = "select count(*) as count from station where stan_code = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -167,27 +189,51 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe
break;
}
}
//Changed By Nasruddin [16/SEP/16] END */
int count = 0;
sql = "select count(*) as count from station where stan_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, stanCode);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt("count");
}
if (childNodeName.equalsIgnoreCase("supp_code__ins")) {
if( stanCode != null && stanCode.trim().length() > 0)
{
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("stan_code", "VTSTAN1", userId);
//errString = itmdbAccessEJB.getErrorString("stan_code", "VMSTANINVD", userId);
break;
}
}
}
if (childNodeName.equalsIgnoreCase("supp_code__ins"))
{
System.out.println(":::childNodeName" + childNodeName);
String suppCode = genericUtility.getColumnValue("supp_code__ins", dom);
suppCode = suppCode == null ? "" : suppCode.trim();
System.out.println("::: stanCode" + suppCode);
//Changed By Nasruddin [16-SEP-16]
if(suppCode != null && suppCode.trim().length() > 0)
{
int count = 0;
sql = "select count(*) as count from insurance where supp_code__ins = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCode);
rs = pstmt.executeQuery();
if(rs.next()){
if(rs.next())
{
count = rs.getInt("count");
}
if(count <= 0){
if(count <= 0)
{
errString = itmdbAccessEJB.getErrorString("supp_code__ins", "VTNINSSUPP", userId);
break;
}
}
/*else{
GenValidate gV = new GenValidate();
String result = gV.generalValidate(dom, "supp_code__ins", "w_insurance_agent");
......
This diff is collapsed.
......@@ -136,7 +136,6 @@ public class ItemLot extends ValidatorEJB implements ItemLotLocal,ItemLotRemote
pstmt = null;
}
}//end of for
int errListSize = errList.size();
int cnt = 0;
String errFldName = null;
......
......@@ -130,8 +130,10 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
if (childNodeName.equalsIgnoreCase("item_code"))
{
itemCode=this.genericUtility.getColumnValue("item_code", dom);
if (itemCode != null && itemCode.trim().length() > 0 )
{
//Changed By Nasruddin 19-SEP-16 START
//if (itemCode != null && itemCode.trim().length() > 0 )
//{
sql = "select count(*) from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
......@@ -153,15 +155,16 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
errFields.add(childNodeName.toLowerCase());
}
}else
{
/*}else
//{
errCode = "VMITEMCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}//Changed By Nasruddin 19-SEP-16 END*/
}
}
else if (childNodeName.equalsIgnoreCase("lot_no__from"))
/*
* else if (childNodeName.equalsIgnoreCase("lot_no__from"))
{
lotNofrom=this.genericUtility.getColumnValue("lot_no__from", dom);
if (lotNofrom == null || lotNofrom.trim().length() == 0 )
......@@ -183,7 +186,7 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
errFields.add(childNodeName.toLowerCase());
}
}
} //Changed By Nasruddin 19-SEP-16 END*/
else if (childNodeName.equalsIgnoreCase("unit__pack"))
{
unitPack=checkNull(this.genericUtility.getColumnValue("unit__pack", dom));
......@@ -209,6 +212,7 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
}
}
/* Comment By Nasruddin 19-SEP-16 STARt
else if (childNodeName.equalsIgnoreCase("site_code__mfg"))
{
siteCodeMfg=this.genericUtility.getColumnValue("site_code__mfg", dom);
......@@ -272,6 +276,7 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
}
}
Comment By Nasruddin 19-SEP-16 END*/
else if (childNodeName.equalsIgnoreCase("net_weight"))
{
netWeight=checkDoubleNull(this.genericUtility.getColumnValue("net_weight", dom));
......
......@@ -80,6 +80,9 @@ implements ItemMnfrICLocal, ItemMnfrICRemote
String siteCode = "";
String suppCodeMnfr = "";
String refSer = "";
String sql = "";
String itemCode = "";
String LockGroup = "";
int ctr = 0;
int currentFormNo = 0;
int cnt = 0;
......@@ -128,8 +131,10 @@ implements ItemMnfrICLocal, ItemMnfrICRemote
if (childNodeName.equalsIgnoreCase("supp_code__mnfr"))
{
suppCodeMnfr=checkNull(this.genericUtility.getColumnValue("supp_code__mnfr", dom));
siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "site_code"));
if (suppCodeMnfr != null && suppCodeMnfr.trim().length() > 0 )
/* Changed By Nasruddin [19-SEP-16] START
* siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "site_code"));
* if (suppCodeMnfr != null && suppCodeMnfr.trim().length() > 0 )
{
errCode = finCommon.isSupplier(siteCode, suppCodeMnfr, refSer, conn);
......@@ -138,9 +143,83 @@ implements ItemMnfrICLocal, ItemMnfrICRemote
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} */
sql = "SELECT COUNT(1) FROM SUPPLIER WHERE SUPP_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCodeMnfr);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt == 0)
{
errCode = "VMSUPP1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
if("A".equalsIgnoreCase(editFlag))
{
itemCode =checkNull(this.genericUtility.getColumnValue("item_code", dom));
sql = "select COUNT(1) from ITEMMNFR where ITEM_CODE = ? and SUPP_CODE__MNFR = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, suppCodeMnfr);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt > 0)
{
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
if (childNodeName.equalsIgnoreCase("lock_group"))
{
LockGroup = checkNull(this.genericUtility.getColumnValue("lock_group", dom));
if( LockGroup != null && (!(LockGroup).equalsIgnoreCase("0")))
{
sql = "SELECT COUNT(1) FROM LOCK_GROUP WHERE LOCK_GROUP = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, LockGroup);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt == 0)
{
errCode = "VTLOCKGRP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
// Changed By Nasruddin [19-SEP-16] end
}
valueXmlString.append("</Detail1>");
break;
......
......@@ -18,6 +18,7 @@ import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
//import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
......@@ -119,8 +120,10 @@ public class ItemRegNoIC extends ValidatorEJB implements ItemRegNoICLocal, ItemR
pstmt.close();
pstmt = null;
}
}
if(childNodeName.equalsIgnoreCase("item_code"))
/* Comment By Nasruddin 19-SEP-16 [START]
* if(childNodeName.equalsIgnoreCase("item_code"))
{
itemCode = genericUtility.getColumnValue("item_code", dom);
if(itemCode == null || itemCode.trim().length() == 0)
......@@ -139,7 +142,8 @@ public class ItemRegNoIC extends ValidatorEJB implements ItemRegNoICLocal, ItemR
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}Comment By Nasruddin 19-SEP-16 [END]*/
}
int errListSize = errList.size();
cnt = 0;
......
......@@ -100,8 +100,9 @@ public class ItemSerChange extends ValidatorEJB implements ItemSerChangeLocal,It
if(childNodeName.equalsIgnoreCase("item_ser"))
{
itemSer = genericUtility.getColumnValue("item_ser", dom);
if(itemSer != null && itemSer.trim().length() > 0)
{
//if(itemSer != null && itemSer.trim().length() > 0)
//{
itemSerOld = genericUtility.getColumnValue("item_ser__old", dom);
sql = "select count(*) from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
......@@ -128,7 +129,7 @@ public class ItemSerChange extends ValidatorEJB implements ItemSerChangeLocal,It
rs = null;
pstmt.close();
pstmt = null;
}
//}
}
else if(childNodeName.equalsIgnoreCase("eff_date"))
{
......
......@@ -103,8 +103,9 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(editFlag.equalsIgnoreCase("A"))
{
/* Comment By Nasruddin 19-SEP-16
* if(editFlag.equalsIgnoreCase("A"))
{*/
if(childNodeName.equalsIgnoreCase("item_type"))
{
itemType = checkNull(genericUtility.getColumnValue("item_type", dom));
......@@ -137,7 +138,8 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp
pstmt = null;
}
}
}
//}
/* Comment By Nasruddin 19-SEP-16 START
else if(childNodeName.equalsIgnoreCase("unit"))
{
unit = checkNull(genericUtility.getColumnValue("unit", dom));
......@@ -294,7 +296,7 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp
pstmt.close();
pstmt = null;
}
}
} Comment By Nasruddin 19-SEP-16 END*/
else if(childNodeName.equalsIgnoreCase("route_code"))
{
routeCode = checkNull(genericUtility.getColumnValue("route_code", dom));
......
......@@ -134,14 +134,17 @@ public class PackingDetIC extends ValidatorEJB implements PackingDetICLocal, Pac
if(childNodeName.equalsIgnoreCase("count_code"))
{
countCode = genericUtility.getColumnValue("count_code", dom);
/* Comment By Nasruddin 20-sep-16 START
if(countCode == null || countCode.trim().length() == 0)
{
errCode = "VMCOUNTCD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(countCode != null && countCode.trim().length() > 0 )
{
else Comment By Nasruddin 20-sep-16 END */
//if(countCode != null && countCode.trim().length() > 0 )
//{
sql = "select count(*) from country where count_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,countCode);
......@@ -161,7 +164,7 @@ public class PackingDetIC extends ValidatorEJB implements PackingDetICLocal, Pac
rs = null;
pstmt.close();
pstmt = null;
}
//}
}
}
......
......@@ -73,7 +73,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
String userId = "";
String sql = "";
String errorType = "";
String packCode = "";
String packCode = "", keyFalg = "";
int count = 0;
int ctr=0;
int childNodeListLength;
......@@ -109,6 +109,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
{
packCode = checkNull(genericUtility.getColumnValue("pack_code", dom));
System.out.println("Pack Code="+packCode);
/* Changed BY Nasruddin 22-SEP-16 START
if(packCode == null || packCode.trim().length() == 0)
{
errCode = "VMPACNU";
......@@ -136,6 +137,52 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
pstmt.close();
pstmt = null;
}
*/
sql = "SELECT KEY_FLAG FROM TRANSETUP WHERE TRAN_WINDOW = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,"w_packing");
rs = pstmt.executeQuery();
if(rs.next())
{
keyFalg = rs.getString("KEY_FLAG");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
keyFalg = keyFalg == null ?"M" : keyFalg.trim();
if(keyFalg.equals("M") && packCode == null || packCode.trim().length() == 0)
{
errCode = "VMCODNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
if(editFlag.equals("A"))
{
sql = "select count(1) from packing where pack_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,packCode);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count > 0)
{
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
// Changed By Nasruddin 22-SEP-16 END
}
else if(childNodeName.equalsIgnoreCase("descr"))
{
......@@ -143,11 +190,40 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
System.out.println("Descr="+descr);
if(descr == null || descr.trim().length() == 0)
{
errCode = "VMPADES";
errCode = "VMDESCR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
// Changed By Nasruddin 22-SEP-16 START
else
{
count = 0;
packCode = checkNull(genericUtility.getColumnValue("pack_code", dom));
sql = "SELECT COUNT(1) FROM PACKING WHERE PACK_CODE <> ? AND DESCR = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,packCode);
pstmt.setString(2,descr);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(count > 0)
{
errCode = "VMDUPDESCR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//Changed By Nasruddin END [22-SEP-16]
}
/* Comment By Nasruddin START [22-SEP-16] START
else if(childNodeName.equalsIgnoreCase("capacity"))
{
capacity = checkNull(genericUtility.getColumnValue("capacity", dom));
......@@ -163,7 +239,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
errFields.add(childNodeName.toLowerCase());
}
}
}
}Comment By Nasruddin START [22-SEP-16] END */
else if(childNodeName.equalsIgnoreCase("unit"))
{
unit = checkNull(genericUtility.getColumnValue("unit", dom));
......@@ -196,6 +272,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
pstmt = null;
}
}
/* Comment By Nasruddin START [22-SEP-16] START
else if(childNodeName.equalsIgnoreCase("unit__dimn"))
{
unitDmn = checkNull(genericUtility.getColumnValue("unit__dimn", dom));
......@@ -222,6 +299,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
pstmt = null;
}
}
Comment By Nasruddin START [22-SEP-16] END */
else if(childNodeName.equalsIgnoreCase("unit__nwt"))
{
unitNwt = checkNull(genericUtility.getColumnValue("unit__nwt", dom));
......
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