Commit 7b65b9de authored by pshinde's avatar pshinde

added validation for currency code


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97170 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f57b8b97
......@@ -103,8 +103,10 @@ public class LoanPartyBank extends ValidatorEJB implements LoanPartyBankLocal,
String sql = "";
String userId = "";
String partyCode = "";
String currCode="";//added by priyanka on 28/01/15
try {
System.out.println("wfValData>>>>>>>>>>");
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
......@@ -228,6 +230,43 @@ public class LoanPartyBank extends ValidatorEJB implements LoanPartyBankLocal,
break;
}
}
//added by priyanka on 28/01/15 as per manoj sharma instruction
else if (childNodeName.equalsIgnoreCase("curr_code"))
{
currCode=genericUtility.getColumnValue("curr_code", dom);
System.out.println("currCode from loan party bank===="+currCode);
currCode = currCode == null ? "" : currCode.trim();
if(currCode==null||currCode.trim().length()==0)
{
errCode = "VMCUR2";
errString = getErrorString("curr_code", errCode,userId);
break;
}
else
{
sql="select count(*) from currency where curr_code= ?";
pStmt=conn.prepareStatement(sql);
pStmt.setString(1,currCode);
rs = pStmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count from Curr_code===="+cnt);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if (cnt == 0)
{
errCode = "VMCURR1";
errString = getErrorString("curr_code", errCode, userId);
break;
}
}
}
}// end of for
}// end of switch
......
......@@ -91,6 +91,7 @@ public class SalesPersonBank extends ValidatorEJB implements SalesPersonBankLoca
String sql = "";
String userId = "";
String SalesPers="";
String currCode="";// added by priyanka on 28/01/15
//SimpleDateFormat simpleDateFormat;
......@@ -425,7 +426,8 @@ public class SalesPersonBank extends ValidatorEJB implements SalesPersonBankLoca
}
}
else if (childNodeName.equalsIgnoreCase("sales_pers") && childNodeName.equalsIgnoreCase("bank_code__ben") ) {
else if (childNodeName.equalsIgnoreCase("sales_pers") && childNodeName.equalsIgnoreCase("bank_code__ben") )
{
String bankCodeBen = genericUtility.getColumnValue("bank_code__ben", dom);
String SaleCode = genericUtility.getColumnValue("sales_pers", dom);
......@@ -451,6 +453,45 @@ public class SalesPersonBank extends ValidatorEJB implements SalesPersonBankLoca
}
//added by priyanka on 28/01/15 as per manoj sharma instruction
else if (childNodeName.equalsIgnoreCase("curr_code"))
{
currCode=genericUtility.getColumnValue("curr_code", dom);
System.out.println("currCode from loan party bank===="+currCode);
currCode = currCode == null ? "" : currCode.trim();
if(currCode==null||currCode.trim().length()==0)
{
errCode = "VMCUR2";
errString = getErrorString("curr_code", errCode,userId);
break;
}
else
{
sql="select count(*) from currency where curr_code= ?";
pStmt=conn.prepareStatement(sql);
pStmt.setString(1,currCode);
rs = pStmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count from Curr_code===="+cnt);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if (cnt == 0)
{
errCode = "VMCURR1";
errString = getErrorString("curr_code", errCode, userId);
break;
}
}
}
}//end of for
}//end of switch
} catch (Exception e) {
......
......@@ -95,8 +95,8 @@ public class StrgCustBank extends ValidatorEJB implements StrgCustBankLocal,
ResultSet rs = null;
String sql = "";
String userId = "";
String ScCode = "";
String ScCode = "";
String currCode="";//added by priyanka on 28/01/15
// SimpleDateFormat simpleDateFormat;
try {
......@@ -444,7 +444,8 @@ public class StrgCustBank extends ValidatorEJB implements StrgCustBankLocal,
// break;
// }
// }
else if (childNodeName.equalsIgnoreCase("active_yn")) {
else if (childNodeName.equalsIgnoreCase("active_yn"))
{
String active = genericUtility.getColumnValue(
"active_yn", dom);
active = active == null ? "" : active.trim();
......@@ -455,6 +456,44 @@ public class StrgCustBank extends ValidatorEJB implements StrgCustBankLocal,
break;
}
}
//added by priyanka on 28/01/15 as per manoj sharma instruction
else if (childNodeName.equalsIgnoreCase("curr_code"))
{
currCode=genericUtility.getColumnValue("curr_code", dom);
System.out.println("currCode from loan party bank===="+currCode);
currCode = currCode == null ? "" : currCode.trim();
if(currCode==null||currCode.trim().length()==0)
{
errCode = "VMCUR2";
errString = getErrorString("curr_code", errCode,userId);
break;
}
else
{
sql="select count(*) from currency where curr_code= ?";
pStmt=conn.prepareStatement(sql);
pStmt.setString(1,currCode);
rs = pStmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count from Curr_code===="+cnt);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if (cnt == 0)
{
errCode = "VMCURR1";
errString = getErrorString("curr_code", errCode, userId);
break;
}
}
}
}// end of for
}// end of switch
......
......@@ -88,6 +88,8 @@ public class TransporterBank extends ValidatorEJB implements TransporterBankLoca
String sql = "";
String userId = "";
String tranCode="";
String currCode=""; //added by priyanka on 28/01/05
try {
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
......@@ -321,7 +323,8 @@ public class TransporterBank extends ValidatorEJB implements TransporterBankLoca
break;
}
}
}else if (childNodeName.equalsIgnoreCase("count_code__inter")) {
}else if (childNodeName.equalsIgnoreCase("count_code__inter"))
{
String contCodeInt = genericUtility.getColumnValue("count_code__inter", dom);
contCodeInt = contCodeInt == null ? "" : contCodeInt.trim();
if (contCodeInt.length() > 0) {
......@@ -343,6 +346,44 @@ public class TransporterBank extends ValidatorEJB implements TransporterBankLoca
}
}
}//end on 20.05.13
//added by priyanka on 28/01/15 as per manoj sharma instruction
else if (childNodeName.equalsIgnoreCase("curr_code"))
{
currCode=genericUtility.getColumnValue("curr_code", dom);
System.out.println("currCode from loan party bank===="+currCode);
currCode = currCode == null ? "" : currCode.trim();
if(currCode==null||currCode.trim().length()==0)
{
errCode = "VMCUR2";
errString = getErrorString("curr_code", errCode,userId);
break;
}
else
{
sql="select count(*) from currency where curr_code= ?";
pStmt=conn.prepareStatement(sql);
pStmt.setString(1,currCode);
rs = pStmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count from Curr_code===="+cnt);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if (cnt == 0)
{
errCode = "VMCURR1";
errString = getErrorString("curr_code", errCode, userId);
break;
}
}
}
}//end of for
}//end of switch
......
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