Commit 7262cdc7 authored by smane's avatar smane

update IncidentChargeIC.java file for changes in validation of Charges field.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94602 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a4be97a9
...@@ -85,7 +85,7 @@ public class IncidentChargeIC extends ValidatorEJB implements IncidentChargeICLo ...@@ -85,7 +85,7 @@ public class IncidentChargeIC extends ValidatorEJB implements IncidentChargeICLo
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
int currentFormNo =0; int currentFormNo =0;
String fromDay="",toDay="",incCharge="",penaltyType="",transistType=""; String fromDay="",toDay="",incCharge="",penaltyType="",transistType="";
double fromdayVal=0.0,todayVal=0.0; double fromdayVal=0.0,todayVal=0.0,chargesAmt=0.0;
try try
{ {
System.out.println("@@@@@@@@ wfvaldata called"); System.out.println("@@@@@@@@ wfvaldata called");
...@@ -234,6 +234,18 @@ public class IncidentChargeIC extends ValidatorEJB implements IncidentChargeICLo ...@@ -234,6 +234,18 @@ public class IncidentChargeIC extends ValidatorEJB implements IncidentChargeICLo
errCode = "VMNULTRTYP"; errCode = "VMNULTRTYP";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
}
}
if(childNodeName.equalsIgnoreCase("charges"))
{
chargesAmt=checkDoubleNull(genericUtility.getColumnValue("charges", dom));
System.out.println(">>>>>chargesAmt:"+chargesAmt);
//chargesAmt can not be negative.
if(chargesAmt < 0)
{
errCode = "VMNGTVCHGS";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} }
} }
}// end for }// end for
...@@ -567,4 +579,16 @@ public class IncidentChargeIC extends ValidatorEJB implements IncidentChargeICLo ...@@ -567,4 +579,16 @@ public class IncidentChargeIC extends ValidatorEJB implements IncidentChargeICLo
} }
return descr; return descr;
} }
private double checkDoubleNull(String str)
{
if(str == null || str.trim().length() == 0)
{
return 0.0;
}
else
{
return Double.parseDouble(str) ;
}
}
} }
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