Commit 3a288d2c authored by kmandhre's avatar kmandhre

add Pin Code From and Pin Code To in detail screen


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91739 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7ce08b71
......@@ -65,6 +65,8 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
String descr = "";
String distRoute = "";
String custCode = "";
String pinCodeTo = "";
String pinCodeFrom = "";
String childNodeName = null;
String errString = "";
String errCode = "";
......@@ -75,6 +77,8 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
int ctr=0;
int currentFormNo = 0;
int childNodeListLength;
boolean fromBlank = false;
boolean toBlank = false;
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
......@@ -411,6 +415,7 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
pstmt.close();
pstmt = null;
/*
sql = "Select count(*) from station where stan_code = ? and state_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,StanCodeTo);
......@@ -430,6 +435,7 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
rs = null;
pstmt.close();
pstmt = null;
*/
......@@ -458,6 +464,7 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
rs = null;
pstmt.close();
pstmt = null;
/*
sql = "Select count(*) from station where stan_code = ? and state_code = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -478,6 +485,37 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
rs = null;
pstmt.close();
pstmt = null;
*/
}
else
{
stateCodeFrom = checkNull(genericUtility.getColumnValue("state_code__fr", dom));
StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
stateCodeTo = checkNull(genericUtility.getColumnValue("state_code__to", dom));
StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
pinCodeTo = checkNull(genericUtility.getColumnValue("pin__to", dom));
pinCodeFrom = checkNull(genericUtility.getColumnValue("pin__fr", dom));
if(StanCodeFrom.trim().length() == 0 && stateCodeFrom.trim().length() == 0 && pinCodeFrom.trim().length() == 0)
{
fromBlank = true;
}
if(StanCodeTo.trim().length() == 0 && stateCodeTo.trim().length() == 0 && pinCodeTo.trim().length() == 0)
{
toBlank = true;
}
if(fromBlank)
{
errCode = "VTFRVAL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(toBlank)
{
errCode = "VTTOVAL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
......@@ -597,6 +635,8 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
String stateDescr = "";
String childNodeName = null;
String sql = "";
String pinCodeTo = "";
String pinCodeFrom = "";
StringBuffer valueXmlString = new StringBuffer();
int ctr = 0;
int lineNo = 0;
......@@ -731,6 +771,37 @@ 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>");
stateCodeFr = checkNull(genericUtility.getColumnValue("state_code__fr", dom));
stanCodeFr = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
stateCodeTo = checkNull(genericUtility.getColumnValue("state_code__to", dom));
stanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
pinCodeTo = checkNull(genericUtility.getColumnValue("pin__to", dom));
pinCodeFrom = checkNull(genericUtility.getColumnValue("pin__fr", dom));
if(stateCodeFr.trim().length() == 0)
{
valueXmlString.append("<state_code__fr>").append("<![CDATA[ ]]>").append("</state_code__fr>");
}
if(stateCodeTo.trim().length() == 0)
{
valueXmlString.append("<state_code__to>").append("<![CDATA[ ]]>").append("</state_code__to>");
}
if(stanCodeFr.trim().length() == 0)
{
valueXmlString.append("<stan_code__fr>").append("<![CDATA[ ]]>").append("</stan_code__fr>");
}
if(stanCodeTo.trim().length() == 0)
{
valueXmlString.append("<stan_code__to>").append("<![CDATA[ ]]>").append("</stan_code__to>");
}
if(pinCodeTo.trim().length() == 0)
{
valueXmlString.append("<pin__to>").append("<![CDATA[ ]]>").append("</pin__to>");
}
if(pinCodeFrom.trim().length() == 0)
{
valueXmlString.append("<pin__fr>").append("<![CDATA[ ]]>").append("</pin__fr>");
}
}
else if(currentColumn.trim().equalsIgnoreCase("stan_code__fr"))
......@@ -773,6 +844,16 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
valueXmlString.append("<state_code__fr>").append("<![CDATA[" + stateCodeFr +"]]>").append("</state_code__fr>");
valueXmlString.append("<descr_1>").append("<![CDATA[" + stateDescr +"]]>").append("</descr_1>");
valueXmlString.append("<stationa_descr>").append("<![CDATA[" + descr +"]]>").append("</stationa_descr>");
if(stateCodeFr.trim().length() == 0)
{
valueXmlString.append("<state_code__fr>").append("<![CDATA[ ]]>").append("</state_code__fr>");
}
if(stanCodeFr.trim().length() == 0)
{
valueXmlString.append("<stan_code__fr>").append("<![CDATA[ ]]>").append("</stan_code__fr>");
}
}
else if(currentColumn.trim().equalsIgnoreCase("stan_code__to"))
{
......@@ -814,6 +895,15 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
valueXmlString.append("<state_code__to>").append("<![CDATA[" + stateCodeTo +"]]>").append("</state_code__to>");
valueXmlString.append("<station_descr_1>").append("<![CDATA[" + descr +"]]>").append("</station_descr_1>");
valueXmlString.append("<descr>").append("<![CDATA[" + stateDescr +"]]>").append("</descr>");
if(stanCodeTo.trim().length() == 0)
{
valueXmlString.append("<stan_code__to>").append("<![CDATA[ ]]>").append("</stan_code__to>");
}
if(stateCodeTo.trim().length() == 0)
{
valueXmlString.append("<state_code__to>").append("<![CDATA[ ]]>").append("</state_code__to>");
}
}
else if(currentColumn.trim().equalsIgnoreCase("tran_code"))
{
......@@ -871,6 +961,10 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
pstmt = null;
}
valueXmlString.append("<descr>").append("<![CDATA[" + descr +"]]>").append("</descr>");
if(stateCodeTo.trim().length() == 0)
{
valueXmlString.append("<state_code__to>").append("<![CDATA[ ]]>").append("</state_code__to>");
}
}
else if(currentColumn.trim().equalsIgnoreCase("state_code__fr"))
{
......@@ -891,8 +985,12 @@ public class DistributionRoute extends ValidatorEJB implements DistributionRoute
pstmt = null;
}
valueXmlString.append("<descr_1>").append("<![CDATA[" + descr +"]]>").append("</descr_1>");
if(stateCodeFr.trim().length() == 0)
{
valueXmlString.append("<state_code__fr>").append("<![CDATA[ ]]>").append("</state_code__fr>");
}
}
valueXmlString.append("</Detail2>");
break;
}
......
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