Commit 0793a35c authored by sghate's avatar sghate

Shital: updated component on 15-10-2019 SiteHolTblIC.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@209578 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cecc3195
......@@ -73,8 +73,8 @@ public class SiteHolTblIC extends ValidatorEJB implements SiteHolTblLocal,SiteHo
int currentFormNo = 0;
Connection conn = null;
int cnt = 0;
String siteCode = null;
String holTblNo = null;
String siteCode = "";
String holTblNo = "";
ITMDBAccessEJB itmDbAcess = null;
E12GenericUtility genericUtility = null;
......@@ -117,7 +117,7 @@ public class SiteHolTblIC extends ValidatorEJB implements SiteHolTblLocal,SiteHo
if("site_code".equalsIgnoreCase(childNodeName))
{
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
sql = "Select count(*) as cnt from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
......@@ -147,7 +147,7 @@ public class SiteHolTblIC extends ValidatorEJB implements SiteHolTblLocal,SiteHo
else if (childNodeName.equalsIgnoreCase("hol_tblno"))
{
holTblNo = checkNull(genericUtility.getColumnValue("hol_tblno", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
if(holTblNo == null || holTblNo.trim().length() == 0)
{
errList.add("VMHOLTBL");// Holiday Table cannot be Empty
......@@ -174,11 +174,40 @@ public class SiteHolTblIC extends ValidatorEJB implements SiteHolTblLocal,SiteHo
pstmt.close();
pstmt = null;
}
if(cnt > 0 && !"E".equalsIgnoreCase(editFlag))
if(cnt == 0)
{
errList.add("VMHOLTBL");//Data Already Existed for Entered SITE_HOLTBL_MAP Table
errList.add("VMINVHLTBL");//Not Present in GENCODES Table
errFields.add(childNodeName.toLowerCase());
}
else
{
cnt = 0;
sql = "select count(*) as cnt from SITE_HOLTBL_MAP where SITE_CODE = ? and HOL_TBLNO = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setString(2, holTblNo);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
}
System.out.println("cnt for SITE_HOLTBL_MAP:::::"+cnt);
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt > 0 && !"E".equalsIgnoreCase(editFlag))
{
errList.add("VMHOLTBL");//Data Already Existed in SITE_HOLTBL_MAP Table
errFields.add(childNodeName.toLowerCase());
}
}
}
}
......
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