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
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.
System.out.println("SQL :::::"+sql);
System.out.println("SQL :::::["+sql+"]");
//ended by added by priyanka
try
{
/*ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;*/
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
System.out.println("GenVal.genVal() this.isFromButton::["+this.isFromButton+"]");
//Changed By Pankaj T. on 05-01-19 for If formNo is 'X' then validation should be fire for "edit" action only - start
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.
if(rs.next())
if( count > 0 )
{
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
while (rs.next())
{
System.out.println("In GenVal 179");
flag =false;
fldName = rs.getString(1).trim();
valType = rs.getString(2);
......@@ -537,27 +555,35 @@ public class GenVal
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;
Statement newStmt = null;
newStmt = conn.createStatement();
System.out.println("inside if condition...564");
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'";
newRs = newStmt.executeQuery(sql);
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 - start
System.out.println("inside else if condition...564");
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'";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
System.out.println("In GenVal 567");
//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;
fldName = newRs.getString(1).trim();
valType = newRs.getString(2);
fldMin = newRs.getString(3);
sqlInput = newRs.getString(4);
fldMax = newRs.getString(5);
errCD = newRs.getString(6);
blankOpt = newRs.getString(7);
fldType = newRs.getString(8);
formNo=newRs.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 - start
System.out.println("In GenVal 571");
fldName = rs.getString(1).trim();
valType = rs.getString(2);
fldMin = rs.getString(3);
sqlInput = rs.getString(4);
fldMax = rs.getString(5);
errCD = rs.getString(6);
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
if(isFromButton)
{
......@@ -924,17 +950,17 @@ public class GenVal
errMsg="";
}
}
newRs.close();
newRs = null;
newStmt.close();
newStmt = null;
rs.close();
rs = null;
stmt.close();
stmt = null;
}
//Added if and else condition by shrutika on 04-01-19 for in case of form no X.
rs.close();
/*rs.close();
rs = null;
stmt.close();
stmt = null;
stmt = null;*/
/*if (conn != null)
{
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