Commit 3786e186 authored by pshinde's avatar pshinde

Changes in code of StateIC.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96568 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9767d354
......@@ -71,6 +71,7 @@ public class StateIC extends ValidatorEJB implements StateICLocal, StateICRemote
String sql = "";
String errFldName = "";
String userId = "";
String keyFlag="";
long cnt = 0;
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
......@@ -113,18 +114,31 @@ public class StateIC extends ValidatorEJB implements StateICLocal, StateICRemote
if(childNodeName.equalsIgnoreCase("state_code"))
{
stateCode = genericUtility.getColumnValue("state_code", dom);
if(editFlag.equals("A"))
sql = "select key_flag from transetup where tran_window = 'w_state'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
if(stateCode==null ||stateCode.trim().length()==0)
{
errCode = "VESTATCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
else
keyFlag = rs.getString(1)==null ? "M" : rs.getString(1).trim();
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
stateCode = genericUtility.getColumnValue("state_code", dom);
if(stateCode==null ||stateCode.trim().length()==0)
{
errCode = "VESTATCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
else
{
if(editFlag.equals("A"))
{
sql="select count(*) from state where state_code = ?";
pstmt=conn.prepareStatement(sql);
......@@ -133,18 +147,24 @@ public class StateIC extends ValidatorEJB implements StateICLocal, StateICRemote
if(rs.next())
{
stateCnt=rs.getInt(1);
if(stateCnt>0)
{
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(stateCnt>0)
{
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
}
}
}
}
}
else if(childNodeName.equalsIgnoreCase("count_code"))
{
......@@ -285,7 +305,7 @@ public class StateIC extends ValidatorEJB implements StateICLocal, StateICRemote
rs.close();
rs = null;
pstmt.close();
pstmt = null;
pstmt = null;
if(cnt==0)
{
......@@ -294,6 +314,8 @@ public class StateIC extends ValidatorEJB implements StateICLocal, StateICRemote
errFields.add(childNodeName.toLowerCase());
break;
}
}
}
......@@ -510,10 +532,21 @@ public class StateIC extends ValidatorEJB implements StateICLocal, StateICRemote
{
countDescr=checkNull(rs.getString("descr"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Country Description====>"+ countDescr);
valueXmlString.append("<country_descr>").append("<![CDATA[" + countDescr + "]]>").append("</country_descr>");
if(countDescr == null)
{
valueXmlString.append("<country_descr>").append("<![CDATA["+""+"]]>").append("</country_descr>");
}
else
{
valueXmlString.append("<country_descr>").append("<![CDATA[" + countDescr + "]]>").append("</country_descr>");
}
}
valueXmlString.append("</Detail1>");
......
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