Commit 616f873a authored by ptajane's avatar ptajane

//Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should...

//Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should be fire for "edit" action only - start

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@195321 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4c505165
...@@ -142,25 +142,43 @@ public class GenVal ...@@ -142,25 +142,43 @@ public class GenVal
sql = " SELECT FLD_NAME,VAL_TYPE,FLD_MIN,SQL_INPUT,FLD_MAX,ERROR_CD,BLANK_OPT ,FLD_TYPE FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"' and ACTION = '"+action.toUpperCase()+"' and trim(FORM_NO) is null "; sql = " SELECT FLD_NAME,VAL_TYPE,FLD_MIN,SQL_INPUT,FLD_MAX,ERROR_CD,BLANK_OPT ,FLD_TYPE FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"' and ACTION = '"+action.toUpperCase()+"' and trim(FORM_NO) is null ";
}*/ }*/
sql = " SELECT FLD_NAME,VAL_TYPE,FLD_MIN,SQL_INPUT,FLD_MAX,ERROR_CD,BLANK_OPT ,FLD_TYPE,FORM_NO FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"' and upper(ACTION) = '"+action.toUpperCase()+"' and FORM_NO='"+objContext+"'"; sql = "SELECT FLD_NAME,VAL_TYPE,FLD_MIN,SQL_INPUT,FLD_MAX,ERROR_CD,BLANK_OPT ,FLD_TYPE,FORM_NO FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"' and upper(ACTION) = '"+action.toUpperCase()+"' and FORM_NO='"+objContext+"'";
//Changed by shrutika on 24-12-18 [End] for execute gen validation only defined action and form_no specific validation. //Changed by shrutika on 24-12-18 [End] for execute gen validation only defined action and form_no specific validation.
System.out.println("SQL :::::"+sql); System.out.println("SQL :::::["+sql+"]");
//ended by added by priyanka //ended by added by priyanka
try try
{ {
/*ConnDriver connDriver = new ConnDriver(); /*ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null;*/ connDriver = null;*/
System.out.println("GenVal.genVal() this.isFromButton::["+this.isFromButton+"]");
stmt = conn.createStatement(); //Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should be fire for "edit" action only - start
rs = stmt.executeQuery(sql); Statement cntstmt = null;
ResultSet cntrs = null;
String countSql = "SELECT COUNT(1) AS COUNT FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"' and upper(ACTION) = '"+action.toUpperCase()+"' and FORM_NO='"+objContext+"'";
cntstmt = conn.createStatement();
cntrs = cntstmt.executeQuery(countSql);
int count = 0;
if( cntrs.next() )
{
count = cntrs.getInt(1);
System.out.println("GenVal.genVal() count against formNo and action::["+count+"]");
}
cntrs.close();
cntrs = null;
cntstmt.close();
cntstmt = null;
//Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should be fire for "edit" action only - end
//Added if and else condition by shrutika on 04-01-19 for in case of form no X. //Added if and else condition by shrutika on 04-01-19 for in case of form no X.
if(rs.next()) if( count > 0 )
{ {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
while (rs.next()) while (rs.next())
{ {
System.out.println("In GenVal 179");
flag =false; flag =false;
fldName = rs.getString(1).trim(); fldName = rs.getString(1).trim();
valType = rs.getString(2); valType = rs.getString(2);
...@@ -537,27 +555,35 @@ public class GenVal ...@@ -537,27 +555,35 @@ public class GenVal
errMsg=""; errMsg="";
} }
} }
rs.close();
rs = null;
stmt.close();
stmt = null;
} }
else else if( !(this.isFromButton) ) //Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should be fire for "edit" action only
{ {
ResultSet newRs = null; //Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should be fire for "edit" action only - start
Statement newStmt = null; System.out.println("inside else if condition...564");
newStmt = conn.createStatement(); sql = "SELECT FLD_NAME,VAL_TYPE,FLD_MIN,SQL_INPUT,FLD_MAX,ERROR_CD,BLANK_OPT ,FLD_TYPE,FORM_NO FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"' and FORM_NO='X' and ACTION='edit'";
System.out.println("inside if condition...564"); stmt = conn.createStatement();
sql = " SELECT FLD_NAME,VAL_TYPE,FLD_MIN,SQL_INPUT,FLD_MAX,ERROR_CD,BLANK_OPT ,FLD_TYPE,FORM_NO FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"' and FORM_NO='X'"; rs = stmt.executeQuery(sql);
newRs = newStmt.executeQuery(sql); System.out.println("In GenVal 567");
while (newRs.next()) //Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should be fire for "edit" action only - end
while(rs.next())
{ {
flag =false; flag =false;
fldName = newRs.getString(1).trim(); //Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should be fire for "edit" action only - start
valType = newRs.getString(2); System.out.println("In GenVal 571");
fldMin = newRs.getString(3); fldName = rs.getString(1).trim();
sqlInput = newRs.getString(4); valType = rs.getString(2);
fldMax = newRs.getString(5); fldMin = rs.getString(3);
errCD = newRs.getString(6); sqlInput = rs.getString(4);
blankOpt = newRs.getString(7); fldMax = rs.getString(5);
fldType = newRs.getString(8); errCD = rs.getString(6);
formNo=newRs.getString(9);//added by priyanka blankOpt = rs.getString(7);
fldType = rs.getString(8);
formNo=rs.getString(9);//added by priyanka
//Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should be fire for "edit" action only - end
// added by priyanka on 31/12/14 // added by priyanka on 31/12/14
if(isFromButton) if(isFromButton)
{ {
...@@ -924,17 +950,17 @@ public class GenVal ...@@ -924,17 +950,17 @@ public class GenVal
errMsg=""; errMsg="";
} }
} }
newRs.close(); rs.close();
newRs = null; rs = null;
newStmt.close(); stmt.close();
newStmt = null; stmt = null;
} }
//Added if and else condition by shrutika on 04-01-19 for in case of form no X. //Added if and else condition by shrutika on 04-01-19 for in case of form no X.
rs.close(); /*rs.close();
rs = null; rs = null;
stmt.close(); stmt.close();
stmt = null; stmt = null;*/
/*if (conn != null) /*if (conn != null)
{ {
conn.close(); conn.close();
......
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