Commit 43217563 authored by pshinde's avatar pshinde

changes done in Freight rate n updated in Cvs(DI3GSUN047)


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94437 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9567040a
......@@ -172,11 +172,16 @@ public class FreightRateIC extends ValidatorEJB implements FreightRateICLocal,Fr
pstmt.setString(1,frtList);
pstmt.setString(2,loadType);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count of loadtype: ===="+cnt);
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count of loadtype: ===="+cnt);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
if(cnt==0)
{
errCode = "VTFRLNTEXT";//Freight List does not exists
......@@ -184,12 +189,7 @@ public class FreightRateIC extends ValidatorEJB implements FreightRateICLocal,Fr
errFields.add(childNodeName.toLowerCase());
System.out.println("Freight List does not exists");
}
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
}
}
......@@ -215,26 +215,24 @@ public class FreightRateIC extends ValidatorEJB implements FreightRateICLocal,Fr
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,standCodeFrom);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count: ===="+cnt);
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count: ===="+cnt);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
if(cnt==0)
{
errCode = "VMSTAN2";//Station code doesn't exist in master
errCode = "VMSTAN2";//Station code doesn't exist in master
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
System.out.println("Station code doesn't exist in master!!");
}
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
}
if(standCodeFrom!=null && standCodeTo!=null)
......@@ -286,14 +284,17 @@ public class FreightRateIC extends ValidatorEJB implements FreightRateICLocal,Fr
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,standCodeTo);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count: ===="+cnt);
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count: ===="+cnt);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
if(cnt==0)
{
errCode = "VMSTAN2";//Station code doesn't exist in master
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -301,11 +302,6 @@ public class FreightRateIC extends ValidatorEJB implements FreightRateICLocal,Fr
}
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
}
if(standCodeFrom!=null && standCodeTo!=null)
......@@ -330,7 +326,6 @@ public class FreightRateIC extends ValidatorEJB implements FreightRateICLocal,Fr
}
System.out.println("standcodeToVALDATION!!!");
}
......@@ -557,18 +552,17 @@ public class FreightRateIC extends ValidatorEJB implements FreightRateICLocal,Fr
{
seq= rs.getInt(1);
System.out.println("Sequence getting"+seq);
if(seq==0)
{
seq=sequence;
System.out.println("Sequence getting"+seq);
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(seq==0)
{
seq=sequence;
System.out.println("Sequence getting"+seq);
}
if(seq!=sequence)
{
sql="select count(1) from freight_rate_det " +
......@@ -582,10 +576,15 @@ public class FreightRateIC extends ValidatorEJB implements FreightRateICLocal,Fr
pstmt.setString(4, standCodeTo);
pstmt.setInt(5,sequence);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt=rs.getInt(1);
System.out.println("Count of sequence: "+cnt);
if(rs.next())
{
cnt=rs.getInt(1);
System.out.println("Count of sequence: "+cnt);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt>0)
{
errCode = "VMSEQ1";//Sequence number already present.....
......@@ -595,11 +594,6 @@ public class FreightRateIC extends ValidatorEJB implements FreightRateICLocal,Fr
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
}
......@@ -842,7 +836,6 @@ public String itemChanged(Document dom, Document dom1, Document dom2, String obj
rs = pstmt.executeQuery();
if (rs.next())
{
System.out.println("Inside IF");
frtChangeTable = rs.getString("FRT_CHGS_TABLE");
loadType = rs.getString("LOAD_TYPE");
genDesc = rs.getString("DESCR");
......@@ -850,7 +843,6 @@ public String itemChanged(Document dom, Document dom1, Document dom2, String obj
System.out.println("loadType---"+loadType);
System.out.println("genDesc====="+genDesc);
}
System.out.println("Inside OUT");
rs.close();
rs = null;
pstmt.close();
......@@ -869,9 +861,9 @@ public String itemChanged(Document dom, Document dom1, Document dom2, String obj
valueXmlString.append("<max_weight protect = \"0\">").append("<![CDATA[]]>").append("</max_weight>");
}
valueXmlString.append("<load_type>").append("<![CDATA["+loadType+"]]>").append("</load_type>");
valueXmlString.append("<gencodes_descr>").append("<![CDATA["+genDesc+"]]>").append("</gencodes_descr>");
valueXmlString.append("<frt_chgs_table>").append("<![CDATA["+frtChangeTable+"]]>").append("</frt_chgs_table>");
valueXmlString.append("<load_type>").append("<![CDATA["+loadType+"]]>").append("</load_type>");
valueXmlString.append("<gencodes_descr>").append("<![CDATA["+genDesc+"]]>").append("</gencodes_descr>");
valueXmlString.append("<frt_chgs_table>").append("<![CDATA["+frtChangeTable+"]]>").append("</frt_chgs_table>");
}
//load_type**
else if (currentColumn.trim().equalsIgnoreCase("load_type"))
......
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