Commit 44b74cf8 authored by psawant's avatar psawant

Master Realignment

UI related changes in Supplier Master 
and Added reas_code bklist and bklist_reason column in supplier Master.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@190464 ce508802-f39f-4f6c-b175-0d175dae99d5
parent df78bf22
......@@ -26,9 +26,9 @@ import java.sql.Timestamp;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.ejb.Stateless;
import javax.ejb.Stateless;
@Stateless
@Stateless
public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemote {
//GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility= new E12GenericUtility();
......@@ -61,7 +61,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
NodeList parentNodeList = null;
NodeList childNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String suppName = "";
......@@ -100,7 +100,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
ResultSet rs = null;
ConnDriver connDriver = new ConnDriver();
int currentFormNo = 0;
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
String commTable = "";
String labOurInvolved = "", pfRegNo = "", lwfNo = "", pTaxNo = "", eciNo = "",esicRegNo = "", ssi = "", msmeRegDate = "", msmeRegNo = "", msmeType = "";//Changed By Nasruddin 21-SEp-16
try
......@@ -109,7 +109,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
//Changes and Commented By Bhushan on 09-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END
//Changes and Commented By Bhushan on 09-06-2016 :END
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if (objContext != null && objContext.trim().length() > 0)
{
......@@ -127,12 +127,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("supp_code"))
{
{
suppCode = genericUtility.getColumnValue("supp_code", dom);
keyFlag = findValue(conn, "key_flag", "transetup", "tran_window", "w_supplier");
if(!("A".equalsIgnoreCase(keyFlag)) && (suppCode == null || suppCode.trim().length() == 0))
if(!("A".equalsIgnoreCase(keyFlag)) && (suppCode == null || suppCode.trim().length() == 0))
{
errCode = "VTSUPCDNLL";
errList.add(errCode);
......@@ -153,7 +153,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}
else if(childNodeName.equalsIgnoreCase("supp_name"))
{
{
suppName = genericUtility.getColumnValue("supp_name", dom);
suppCode = genericUtility.getColumnValue("supp_code", dom);
if(suppName == null || suppName.trim().length() == 0)
......@@ -179,7 +179,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
pstmt.close();
pstmt = null;
//---- End ----
if(count > 0)
{
errCode = "VTSUPNMVLD";
......@@ -189,11 +189,11 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}
else if(childNodeName.equalsIgnoreCase("supp_type"))
{
{
suppType = genericUtility.getColumnValue("supp_type", dom);
if(suppType == null || suppType.trim().length() == 0)
{
errCode = "VMSUPPTP";
errCode = "VMSUPPTP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
......@@ -202,12 +202,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
groupCode = genericUtility.getColumnValue("group_code", dom);
keyFlag = findValue(conn, "key_flag", "transetup", "tran_window", "w_supplier");
if(!("A".equalsIgnoreCase(keyFlag)) && (groupCode == null || groupCode.trim().length() == 0))
if(!("A".equalsIgnoreCase(keyFlag)) && (groupCode == null || groupCode.trim().length() == 0))
{
errCode = "VMGRPCD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}/*
Changed By Nasruddin 21-SEP-16 STARt
else if(childNodeName.equalsIgnoreCase("supp_code__pay"))
......@@ -216,12 +216,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
payTo = genericUtility.getColumnValue("supp_code__pay", dom);
suppCode = genericUtility.getColumnValue("supp_code", dom);
keyFlag = findValue(conn, "key_flag", "transetup", "tran_window", "w_supplier");
if(!("A".equalsIgnoreCase(keyFlag)) && (payTo == null || payTo.trim().length() == 0))
if(!("A".equalsIgnoreCase(keyFlag)) && (payTo == null || payTo.trim().length() == 0))
{
errCode = "VEPAYTO";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(!(payTo.equals(suppCode)))
{
existFlag = isExist("supplier", "supp_code", payTo, conn);
......@@ -241,7 +241,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
//Modified by Anjali R. on[26/04/2018][To check length without trim function][Start]
//if(payTo != null && payTo.trim().length() > 0)
if(payTo != null && payTo.length() > 0)
//Modified by Anjali R. on[26/04/2018][To check length without trim function][End]
//Modified by Anjali R. on[26/04/2018][To check length without trim function][End]
{
//Modified by Anjali R. on[26/04/2018][To compare two strings with trim function][Start]
//if(!suppCode.equalsIgnoreCase(payTo))
......@@ -255,7 +255,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
rs = pstmt.executeQuery();
if( rs.next() )
{
count = rs.getInt(1);
count = rs.getInt(1);
}
//Added by Jaffar on 06-04-18 ---> Start
rs.close();
......@@ -281,12 +281,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
payTo = genericUtility.getColumnValue("pay_to", dom);
suppCode = genericUtility.getColumnValue("supp_code", dom);
keyFlag = findValue(conn, "key_flag", "transetup", "tran_window", "w_supplier");
if(!("A".equalsIgnoreCase(keyFlag)) && (payTo == null || payTo.trim().length() == 0))
if(!("A".equalsIgnoreCase(keyFlag)) && (payTo == null || payTo.trim().length() == 0))
{
errCode = "VEPAYTO";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(!(payTo.equals(suppCode)))
{
existFlag = isExist("supplier", "supp_code", payTo, conn);
......@@ -299,7 +299,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}*/
//Modified by Anjali R. on[26/04/2018][No such a column as "pay_to" in supplier master ][End]
//Changed By Nasruddin 21-SEP-16 END
else if(childNodeName.equalsIgnoreCase("curr_code"))
{
......@@ -342,10 +342,10 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
rs = null;
pstmt.close();
pstmt = null;
if(count != 0)
{
// Error : Currency cannot be changed, amt exists in sundrybal.
// Error : Currency cannot be changed, amt exists in sundrybal.
errCode = "VXCURRCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -375,11 +375,11 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
errFields.add(childNodeName.toLowerCase());
}
Comment BY Nasruddin 21_sep-16 END*/
}
else if(childNodeName.equalsIgnoreCase("cr_term"))
{
crTerm = genericUtility.getColumnValue("cr_term", dom);
existFlag = isExist("crterm", "cr_term", crTerm, conn);
if ("FALSE".equals(existFlag))
......@@ -402,7 +402,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("tax_class"))
{
taxClass = genericUtility.getColumnValue("tax_class", dom);
......@@ -513,7 +513,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
errCode = "VMSITECD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errFields.add(childNodeName.toLowerCase());
}
if(siteCode != null && siteCode.trim().length() > 0)
{
......@@ -571,7 +571,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}
/* Comment By Nasruddin 21-SEp-16 START
*
*
else if(childNodeName.equalsIgnoreCase("tran_code"))
{
tranCode = genericUtility.getColumnValue("tran_code", dom);
......@@ -586,7 +586,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}
}
else if(childNodeName.equalsIgnoreCase("tax_env"))
{
taxEnv = genericUtility.getColumnValue("tax_env", dom);
......@@ -618,9 +618,9 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
//Changed By Nasruddin khan [19/JUL/16] START
else if( childNodeName.equalsIgnoreCase("comm_table"))
{
commTable = checkNull(this.genericUtility.getColumnValue("comm_table", dom));
if( commTable != null && commTable.trim().length() > 0){
count = 0;
sql = "select count(1) as count from comm_hdr where comm_table = ?";
......@@ -644,10 +644,10 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}//Changed By Nasruddin khan [19/JUL/16] END
// Changed By Nasruddin Start 21-SEP-16 START
else if(childNodeName.equalsIgnoreCase("pf_reg_no"))
{
......@@ -764,7 +764,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
// Changed By Nasruddin Start 21-SEP-16 end
}
break; //end case 1 validation.
case 2:
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
......@@ -838,10 +838,10 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}
}
}
}
break; // end case 2 validation.
}
}
int errListSize = errList.size();
int cnt = 0;
String errFldName = null;
......@@ -889,12 +889,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
try
{
if(rs != null)
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
if(pstmt != null)
{
pstmt.close();
pstmt = null;
......@@ -905,7 +905,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
conn = null;
}
connDriver = null;
}
}
catch(Exception d)
{
d.printStackTrace();
......@@ -924,7 +924,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
Document dom2 = null;
String valueXmlString = "";
try
{
{
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
if(xmlString2.trim().length() > 0 )
......@@ -975,7 +975,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
String fullName = "";
String sql = "";
String sql1 = "";
String cityHdr="",pinHdr="",regCode="",regDescr="";
String cityHdr="",pinHdr="",regCode="",regDescr="",resBKList="",lsDescr="";
StringBuffer valueXmlString = new StringBuffer();
Connection conn = null;
PreparedStatement pstmt = null;
......@@ -989,14 +989,14 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
Node childNode = null;
String suppType = "" , suppTypeDescr = ""; // Added by sarita on 15MAY2018
try
{
{
//Changes and Commented By Bhushan on 09-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END
//Changes and Commented By Bhushan on 09-06-2016 :END
conn.setAutoCommit(false);
connDriver = null;
if (objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext.trim());
......@@ -1007,20 +1007,20 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
switch (currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
ctr = 0;
valueXmlString.append("<Detail1>");
if(currentColumn.trim().equalsIgnoreCase("supp_code"))
{
System.out.println(">>>supp_code itemchange:");
suppCode = genericUtility.getColumnValue("supp_code", dom);
descr = genericUtility.getColumnValue("supp_code__pay", dom);
if(descr == null || descr.trim().length() == 0)
if(descr == null || descr.trim().length() == 0)
{
valueXmlString.append("<supp_code__pay>").append("<![CDATA[" + suppCode +"]]>").append("</supp_code__pay>");
}
......@@ -1035,11 +1035,11 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
suppCode = genericUtility.getColumnValue("supp_code", dom);
contactCode = genericUtility.getColumnValue("contact_code", dom);
suppName = checkNull(genericUtility.getColumnValue("supp_name", dom));
if(suppName.trim().length() == 0)
{
sql = " select name, sh_name, cont_pers, cont_pfx, addr1, addr2,addr3, city, pin, state_code, count_code, tele1, tele2, tele3, "+
" tele_ext, fax, email_addr, edi_addr from contact where contact_code = ?";
sql = " select name, sh_name, cont_pers, cont_pfx, addr1, addr2,addr3, city, pin, state_code, count_code, tele1, tele2, tele3, "+
" tele_ext, fax, email_addr, edi_addr from contact where contact_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contactCode);
rs = pstmt.executeQuery();
......@@ -1066,10 +1066,10 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
rs = null;
pstmt.close();
pstmt = null;
altAdd = findValue(conn, "alt_addr1", "supplier", "supp_code", suppCode);
if(altAdd == null || altAdd.trim().length() == 0)
if(altAdd == null || altAdd.trim().length() == 0)
{
valueXmlString.append("<alt_addr1>").append("<![CDATA[" + checkNull(addr1) +"]]>").append("</alt_addr1>");
valueXmlString.append("<alt_addr2>").append("<![CDATA[" + checkNull(addr2) +"]]>").append("</alt_addr2>");
......@@ -1105,9 +1105,32 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
name = mid(fullName,1,40);
}
valueXmlString.append("<supp_name>").append("<![CDATA[" + name +"]]>").append("</supp_name>");
valueXmlString.append("<supp_name>").append("<![CDATA[" + name +"]]>").append("</supp_name>");
}
else if(currentColumn.trim().equalsIgnoreCase("supp_name"))
//Added by Pooja S. on 6 sept 18[Itemchange of reas_code__bklist] Start
else if(currentColumn.trim().equalsIgnoreCase("reas_code__bklist"))
{
System.out.println(">>>>>>>>>>reas_code__bklist itemchange:");
resBKList =genericUtility.getColumnValue("reas_code__bklist", dom);
System.out.println("reasoncodebalcklist"+resBKList);
sql ="select descr from gencodes where mod_name='W_SUPPLIER' and fld_name ='REAS_CODE__BKLIST' and fld_value =?";
pstmt =conn.prepareStatement(sql);
pstmt.setString(1,(resBKList).toUpperCase());
rs = pstmt.executeQuery();
if(rs.next())
{
lsDescr = rs.getString("descr");
System.out.println("Descrription of reascode"+lsDescr);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<bklist_reason>").append("<![CDATA[" + checkNull(lsDescr) + "]]>").append("</bklist_reason>");
}
//Added by Pooja S. on 6 sept 18[Itemchange of reas_code__bklist] End
else if(currentColumn.trim().equalsIgnoreCase("supp_name"))
{
suppName =genericUtility.getColumnValue("supp_name", dom);
chqName =genericUtility.getColumnValue("chq_name", dom);
......@@ -1123,10 +1146,10 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
//Added by sarita on 15MAY2018 [start] to show description of selected type
else if(currentColumn.trim().equalsIgnoreCase("supp_type"))
{
{
suppType = genericUtility.getColumnValue("supp_type", dom);
System.out.println("suppType == ["+suppType+"]");
sql = "select descr from gencodes where mod_name='W_SUPPLIER' and fld_name='SUPP_TYPE' and fld_value = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppType);
......@@ -1140,11 +1163,11 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<supp_type_descr>").append("<![CDATA[" + suppTypeDescr + "]]>").append("</supp_type_descr>");
}
//Added by sarita on 15MAY2018 [end] to show description of selected type
else if(currentColumn.trim().equalsIgnoreCase("cr_term"))
else if(currentColumn.trim().equalsIgnoreCase("cr_term"))
{
System.out.println(">>>>>>>>>>Itemchange cr_term:");
crTerm = genericUtility.getColumnValue("cr_term", dom);
......@@ -1160,7 +1183,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
valueXmlString.append("<credit_prd>").append("<![CDATA[" + crDays + "]]>").append("</credit_prd>");
}
}
else if(currentColumn.trim().equalsIgnoreCase("stan_code"))
else if(currentColumn.trim().equalsIgnoreCase("stan_code"))
{
System.out.println(">>>>>>>>>>stan_code itemchange:");
stanCode =genericUtility.getColumnValue("stan_code", dom);
......@@ -1178,7 +1201,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
rs.close();
rs = null;
pstmt.close();
pstmt = null;
pstmt = null;
sql = " select descr,count_code from state where state_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stateCode);
......@@ -1191,12 +1214,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
rs.close();
rs = null;
pstmt.close();
pstmt = null;
pstmt = null;
valueXmlString.append("<station_descr>").append("<![CDATA[" + checkNull(descr) + "]]>").append("</station_descr>");
valueXmlString.append("<state_code>").append("<![CDATA[" + checkNull(stateCode) + "]]>").append("</state_code>");
valueXmlString.append("<state_descr>").append("<![CDATA[" + checkNull(descr1) + "]]>").append("</state_descr>");
valueXmlString.append("<count_code>").append("<![CDATA[" + checkNull(countCode) + "]]>").append("</count_code>");
cityHdr =genericUtility.getColumnValue("city", dom); //change cityHdr and pinHdr variable by sagar on 23/09/14
cityHdr =genericUtility.getColumnValue("city", dom); //change cityHdr and pinHdr variable by sagar on 23/09/14
pinHdr =genericUtility.getColumnValue("pin", dom);
//Commented by sarita on 15MAY2018[start] to perform itemchnage for city and pin code even if value exists
/*if(cityHdr == null || cityHdr.trim().length() == 0)
......@@ -1207,9 +1230,9 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{*/
valueXmlString.append("<pin>").append("<![CDATA[" + checkNull(pin) + "]]>").append("</pin>");
//}
//Commented by sarita on 15MAY2018[end] to perform itemchnage for city and pin code even if value exists
//Commented by sarita on 15MAY2018[end] to perform itemchnage for city and pin code even if value exists
}
else if(currentColumn.trim().equalsIgnoreCase("tran_code"))
else if(currentColumn.trim().equalsIgnoreCase("tran_code"))
{
tranCode =genericUtility.getColumnValue("tran_code", dom);
tranName = findValue(conn, "tran_name", "transporter", "tran_code", tranCode);
......@@ -1217,15 +1240,15 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
valueXmlString.append("</Detail1>");
break; //end case 1 for itemchange.
case 2:
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
ctr = 0;
valueXmlString.append("<Detail2>");
System.out.println(">>>currentColumn In case 2:"+currentColumn);
if (currentColumn.trim().equalsIgnoreCase("reg_code"))
......@@ -1250,12 +1273,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
try
{
if(rs != null)
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
if(pstmt != null)
{
pstmt.close();
pstmt = null;
......@@ -1270,12 +1293,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
catch(Exception d)
{
d.printStackTrace();
}
}
}
//------- End -------
return valueXmlString.toString();
}
}
public String getfinparm(String pCode , String varName ,Connection conn)
{
......@@ -1324,12 +1347,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}
// ---- End ----
if(addValue == null || addValue.trim().length() == 0)
{
return varValue;
}
else
else
{
return varValue.trim()+";"+addValue.trim();
}
......@@ -1365,7 +1388,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
pstmt.close();
pstmt = null;
//------- End -------
if(count == 0)
{
errCode = "VMCCTR1";
......@@ -1386,7 +1409,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
pstmt.close();
pstmt = null;
// ---- End ----
if(count == 0)
{
sql = "select count(*) from accounts_cctr where acct_code = ? ";
......@@ -1403,7 +1426,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
pstmt.close();
pstmt = null;
//---- End ----
if(count > 0)
{
......@@ -1444,7 +1467,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}
//---- End ----
return errCode;
}
......@@ -1506,7 +1529,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
//Changed By PriyankaC on 23April2018..[START]
//else if(siteSpec != null && !siteSpec.equals("Y"))
else if(siteSpec != null && siteSpec.equals("Y"))
//Changed By PriyankaC on 23April2018..[END]
//Changed By PriyankaC on 23April2018..[END]
{
sql = "select count(*) from site_account where site_code = ? and acct_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -1522,14 +1545,14 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
rs = null;
pstmt.close();
pstmt = null;
if(count == 0)
{
errCode = "VMACCT3";
}
}
}
}
else
{
errCode = "VMACCT1";
......@@ -1562,13 +1585,13 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}
//---- End ----
return errCode;
}
public String mid(String fname ,int i , int j)
{
String name = fname.substring(1, 40);
return name;
return name;
}
private String checkNull(String input)
{
......@@ -1578,7 +1601,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
return input;
}
private String isExist(String table, String field, String value, Connection conn) throws SQLException
{
String sql = "", retStr = "";
......@@ -1661,7 +1684,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
}
//---- End ----
System.out.println("returning String from findValue " + findValue);
return findValue;
}
......@@ -1670,23 +1693,23 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
private String errorType(Connection conn , String errorCode)
{
String msgType = "";
PreparedStatement pstmt = null ;
PreparedStatement pstmt = null ;
ResultSet rs = null;
try
{
{
String sql = "SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,errorCode);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,errorCode);
rs = pstmt.executeQuery();
while(rs.next())
{
msgType = rs.getString("MSG_TYPE");
}
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
finally
{
try
......@@ -1706,10 +1729,10 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
e.printStackTrace();
}
}
}
return msgType;
}
}
}
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