Commit 8a9f761d authored by cpatil's avatar cpatil

adding validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93767 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 41f285b8
...@@ -134,15 +134,28 @@ public class SiteRegNoIC extends ValidatorEJB implements SiteRegNoICLocal,SiteRe ...@@ -134,15 +134,28 @@ public class SiteRegNoIC extends ValidatorEJB implements SiteRegNoICLocal,SiteRe
refCode = genericUtility.getColumnValue("ref_code",dom); refCode = genericUtility.getColumnValue("ref_code",dom);
siteCode = genericUtility.getColumnValue("site_code",dom); siteCode = genericUtility.getColumnValue("site_code",dom);
finEntity = genericUtility.getColumnValue("fin_entity",dom); finEntity = genericUtility.getColumnValue("fin_entity",dom);
effFromStr = genericUtility.getColumnValue("eff_from",dom);
validUptoStr = genericUtility.getColumnValue("valid_upto",dom);
System.out.println("@@@1 date validation effFromStr["+effFromStr+"]:::validUptoStr["+validUptoStr+"]");
System.out.println("@@@@@ for validation for primary "); System.out.println("@@@@@ for validation for primary ");
if( (!("E".equalsIgnoreCase(editFlag))) && refCode!= null && refCode.trim().length() > 0 && siteCode!= null && siteCode.trim().length() > 0 && finEntity!= null && finEntity.trim().length() > 0 ) if( (!("E".equalsIgnoreCase(editFlag))) && refCode!= null && refCode.trim().length() > 0 && siteCode!= null && siteCode.trim().length() > 0 && finEntity!= null && finEntity.trim().length() > 0 && effFromStr !=null && effFromStr.trim().length() > 0 && validUptoStr != null && validUptoStr.trim().length() > 0 )
{ {
sql = " select count(1) from siteregno where site_code = ? and fin_entity = ? and ref_code = ? "; effFrom = Timestamp.valueOf(genericUtility.getValidDateString(effFromStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
validUpto = Timestamp.valueOf(genericUtility.getValidDateString(validUptoStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
sql = " select count(1) from siteregno where site_code = ? and fin_entity = ? and ref_code = ? and eff_from = ? and valid_upto = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString( 1, siteCode ); pstmt.setString( 1, siteCode );
pstmt.setString( 2, finEntity ); pstmt.setString( 2, finEntity );
pstmt.setString( 3, refCode ); pstmt.setString( 3, refCode );
pstmt.setTimestamp(4, effFrom );
pstmt.setTimestamp( 5, validUpto );
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt(1); cnt = rs.getInt(1);
...@@ -403,7 +416,7 @@ public class SiteRegNoIC extends ValidatorEJB implements SiteRegNoICLocal,SiteRe ...@@ -403,7 +416,7 @@ public class SiteRegNoIC extends ValidatorEJB implements SiteRegNoICLocal,SiteRe
String columnValue=""; String columnValue="";
int ctr=0; int ctr=0;
String siteCode="",finEntity="", finEntityDescr="",refCode=""; String siteCode="",finEntity="", finEntityDescr="",refCode="",effFromStr="",validUptoStr="";
try try
{ {
...@@ -448,7 +461,6 @@ public class SiteRegNoIC extends ValidatorEJB implements SiteRegNoICLocal,SiteRe ...@@ -448,7 +461,6 @@ public class SiteRegNoIC extends ValidatorEJB implements SiteRegNoICLocal,SiteRe
{ {
System.out.println("@@@@@ itm_default item change called"); System.out.println("@@@@@ itm_default item change called");
siteCode = genericUtility.getColumnValue("site_code",dom); siteCode = genericUtility.getColumnValue("site_code",dom);
//siteCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" );
if(siteCode != null && siteCode.trim().length() > 0) if(siteCode != null && siteCode.trim().length() > 0)
{ {
sql = " Select fin_entity from site where site_code = ? "; sql = " Select fin_entity from site where site_code = ? ";
...@@ -508,6 +520,10 @@ public class SiteRegNoIC extends ValidatorEJB implements SiteRegNoICLocal,SiteRe ...@@ -508,6 +520,10 @@ public class SiteRegNoIC extends ValidatorEJB implements SiteRegNoICLocal,SiteRe
System.out.println("@@@@@ itm_defaultedit item change called"); System.out.println("@@@@@ itm_defaultedit item change called");
finEntity = genericUtility.getColumnValue("fin_entity",dom); finEntity = genericUtility.getColumnValue("fin_entity",dom);
valueXmlString.append( "<fin_entity protect=\"0\" ><![CDATA[" ).append(finEntity==null?"":finEntity).append( "]]></fin_entity>\r\n" ); valueXmlString.append( "<fin_entity protect=\"0\" ><![CDATA[" ).append(finEntity==null?"":finEntity).append( "]]></fin_entity>\r\n" );
effFromStr = genericUtility.getColumnValue("eff_from",dom);
validUptoStr = genericUtility.getColumnValue("valid_upto",dom);
valueXmlString.append( "<eff_from protect=\"0\" ><![CDATA[" ).append(effFromStr).append( "]]></eff_from>\r\n" );
valueXmlString.append( "<valid_upto protect=\"0\" ><![CDATA[" ).append(validUptoStr).append( "]]></valid_upto>\r\n" );
} }
if( currentColumn.trim().equalsIgnoreCase( "fin_entity" ) ) if( currentColumn.trim().equalsIgnoreCase( "fin_entity" ) )
......
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