Commit f2356253 authored by kmandhre's avatar kmandhre

Done By Kunal Mandhre change in itemchange of station code to and station code from


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91723 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f1c7cf59
......@@ -390,55 +390,96 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
else if(childNodeName.equalsIgnoreCase("state_code__to"))
{
stateCodeTo = checkNull(genericUtility.getColumnValue("state_code__to", dom));
if(stateCodeTo != null || stateCodeTo.trim().length() > 0)
StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
sql = "Select count(*) from state where state_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stateCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
sql = "Select count(*) from state where state_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stateCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "VTSTATE1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "VTSTATE1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "Select count(*) from station where stan_code = ? and state_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,StanCodeTo);
pstmt.setString(2,stateCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "VTSTATETO";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else if(childNodeName.equalsIgnoreCase("state_code__fr"))
{
stateCodeFrom = checkNull(genericUtility.getColumnValue("state_code__fr", dom));
if(stateCodeFrom != null || stateCodeFrom.trim().length() > 0)
StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
sql = "Select count(*) from state where state_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stateCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
sql = "Select count(*) from state where state_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stateCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "VTSTATE1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "VTSTATE1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "Select count(*) from station where stan_code = ? and state_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,StanCodeFrom);
pstmt.setString(2,stateCodeFrom);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "VTSTATEFR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
break;
}
......@@ -537,7 +578,7 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
}
catch(Exception e)
{
System.out.println("Exception : [DistributionRouteIC][itemChanged( String, String )] :==>\n" + e.getMessage());
System.out.println("Exception : [DistributionRoute][itemChanged( String, String )] :==>\n" + e.getMessage());
}
return valueXmlString;
}
......@@ -553,6 +594,7 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
String descr = "";
String distRoute = "";
String tranCode = "";
String stateDescr = "";
String childNodeName = null;
String sql = "";
StringBuffer valueXmlString = new StringBuffer();
......@@ -689,23 +731,43 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
distRoute = checkNull(genericUtility.getColumnValue("dist_route", dom1));
System.out.println("693 distRoute = "+distRoute);
valueXmlString.append("<dist_route protect = \"1\">").append("<![CDATA[" + distRoute +"]]>").append("</dist_route>");
}
else if(currentColumn.trim().equalsIgnoreCase("stan_code__fr"))
{
stanCodeFr = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
sql = "Select descr from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stanCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
if(stanCodeFr != null && stanCodeFr.trim().length() > 0)
{
descr = rs.getString(1);
sql = "Select descr,state_code from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stanCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
descr = checkNull(rs.getString("descr"));
stateCodeFr = checkNull(rs.getString("state_code"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(stateCodeFr != null && stateCodeFr.trim().length() > 0)
{
sql = "select descr from state where state_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stateCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
stateDescr = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<descr_1>").append("<![CDATA[" + stateDescr +"]]>").append("</descr_1>");
valueXmlString.append("<stationa_descr>").append("<![CDATA[" + descr +"]]>").append("</stationa_descr>");
}
else if(currentColumn.trim().equalsIgnoreCase("stan_code__to"))
......@@ -713,24 +775,37 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
stanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
if(stanCodeTo != null && stanCodeTo.trim().length() > 0)
{
valueXmlString.append("<state_code__to>").append("<![CDATA[ ]]>").append("</state_code__to>");
valueXmlString.append("<descr>").append("<![CDATA[]]>").append("</descr>");
valueXmlString.append("<state_code__fr>").append("<![CDATA[ ]]>").append("</state_code__fr>");
valueXmlString.append("<descr_1>").append("<![CDATA[]]>").append("</descr_1>");
sql = "Select descr from station where stan_code = ?";
sql = "Select descr,state_code from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stanCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
descr = rs.getString(1);
descr = checkNull(rs.getString("descr"));
stateCodeTo = checkNull(rs.getString("state_code"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(stateCodeFr != null && stateCodeFr.trim().length() > 0)
{
sql = "select descr from state where state_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stateCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
stateDescr = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
valueXmlString.append("<station_descr_1>").append("<![CDATA[" + descr +"]]>").append("</station_descr_1>");
valueXmlString.append("<descr>").append("<![CDATA[" + stateDescr +"]]>").append("</descr>");
}
else if(currentColumn.trim().equalsIgnoreCase("tran_code"))
{
......@@ -774,10 +849,6 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
if(stateCodeTo != null && stateCodeTo.trim().length() > 0)
{
valueXmlString.append("<stan_code__to>").append("<![CDATA[ ]]>").append("</stan_code__to>");
valueXmlString.append("<station_descr_1>").append("<![CDATA[]]>").append("</station_descr_1>");
valueXmlString.append("<stan_code__fr>").append("<![CDATA[ ]]>").append("</stan_code__fr>");
valueXmlString.append("<stationa_descr>").append("<![CDATA[]]>").append("</stationa_descr>");
sql = "select descr from state where state_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stateCodeTo);
......
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