Commit ce4f2149 authored by sghate's avatar sghate

updated DesignationIC Component

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@206408 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8598e3a2
...@@ -82,7 +82,7 @@ public class DesignationIC extends ValidatorEJB implements DesignationLocal,Desi ...@@ -82,7 +82,7 @@ public class DesignationIC extends ValidatorEJB implements DesignationLocal,Desi
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String errCode=""; String errCode="" , sql = "";
String errFldName = ""; String errFldName = "";
String msgType = ""; String msgType = "";
StringBuffer errStringXml = null; StringBuffer errStringXml = null;
...@@ -95,7 +95,7 @@ public class DesignationIC extends ValidatorEJB implements DesignationLocal,Desi ...@@ -95,7 +95,7 @@ public class DesignationIC extends ValidatorEJB implements DesignationLocal,Desi
ArrayList<String> errlist = new ArrayList<String>(); ArrayList<String> errlist = new ArrayList<String>();
ArrayList<String> errfields = new ArrayList<String>(); ArrayList<String> errfields = new ArrayList<String>();
int cnt = 0;
try try
{ {
...@@ -138,10 +138,39 @@ public class DesignationIC extends ValidatorEJB implements DesignationLocal,Desi ...@@ -138,10 +138,39 @@ public class DesignationIC extends ValidatorEJB implements DesignationLocal,Desi
if(designCode == null || designCode.trim().length() == 0) if(designCode == null || designCode.trim().length() == 0)
{ {
errlist.add("VMDSCD"); errlist.add("VMDSCD");//Designation Code cannot be blank
errfields.add(childNodeName.toLowerCase());
}
else
{
designCode = checkNull(genericUtility.getColumnValue("design_code", dom));
cnt = 0;
sql = "Select count(*) as cnt from designation where design_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, designCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
}
System.out.println("cnt ..:: [" + cnt + "]");
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt > 0 && !"E".equalsIgnoreCase(editFlag))
{
errlist.add("VTINDSIGN1");//Data Already Existed for Entered Designation Code
errfields.add(childNodeName.toLowerCase()); errfields.add(childNodeName.toLowerCase());
} }
} }
}
else if (childNodeName.equalsIgnoreCase("designation")) else if (childNodeName.equalsIgnoreCase("designation"))
{ {
designation =checkNull(genericUtility.getColumnValue("designation", dom)); designation =checkNull(genericUtility.getColumnValue("designation", dom));
......
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