Commit 9731702b authored by dpawar's avatar dpawar

add budget amount validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93075 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 534e47d8
...@@ -158,6 +158,31 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca ...@@ -158,6 +158,31 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca
} }
} }
if (childNodeName.equals("budget_amt"))
{
double budgetAmt=0.0;
String budgetAmtStr=genericUtility.getColumnValue("budget_amt",dom);
System.out.println("budgetAmtStr ----- :->> "+budgetAmtStr);
if (budgetAmtStr == null || budgetAmtStr.trim().length() == 0 )
{
errCode = "VTBDATNUL";
errString = getErrorString("bud_group_code",errCode,userId);
break;
}
else
{
budgetAmt= Double.parseDouble(budgetAmtStr);
if (budgetAmt < 1)
{
errCode = "VTBDAMTNL";
errString = getErrorString("budget_amt",errCode,userId);
break;
}
}
}
}// for loop end }// for loop end
break; break;
} //end switch } //end switch
...@@ -225,7 +250,7 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca ...@@ -225,7 +250,7 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca
StringBuffer valueXmlString = new StringBuffer(); StringBuffer valueXmlString = new StringBuffer();
NodeList parentNodeList = null; NodeList parentNodeList = null;
//NodeList childNodeList = null; //NodeList childNodeList = null;
Node parentNode = null; //Node parentNode = null;
//Node childNode = null; //Node childNode = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
...@@ -252,19 +277,16 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca ...@@ -252,19 +277,16 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca
{ {
case 1 : case 1 :
parentNodeList = dom.getElementsByTagName("Detail1"); parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
//childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>"); valueXmlString.append("<Detail1>");
//int childNodeListLength = childNodeList.getLength();
System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'"); System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'");
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) ) if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{ {
String confValue="N"; String confValue="N",budAmt="0.0";
valueXmlString.append("<confirmed><![CDATA[").append(confValue).append("]]></confirmed>"); valueXmlString.append("<confirmed><![CDATA[").append(confValue).append("]]></confirmed>");
valueXmlString.append("<budget_amt><![CDATA[").append(budAmt).append("]]></budget_amt>");
} }
if((currentColumn.trim().equalsIgnoreCase("budget_id"))) if((currentColumn.trim().equalsIgnoreCase("budget_id")))
...@@ -293,10 +315,7 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca ...@@ -293,10 +315,7 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca
valueXmlString.append("<Detail2>"); valueXmlString.append("<Detail2>");
//SEARCHING THE DOM FOR THE INCOMING COLUMN VALUE START //SEARCHING THE DOM FOR THE INCOMING COLUMN VALUE START
parentNodeList = dom.getElementsByTagName("Detail2"); parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
//childNodeList = parentNode.getChildNodes();
//childNodeListLength = childNodeList.getLength();
System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'"); System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'");
if (currentColumn.trim().equals("bud_group_code")) if (currentColumn.trim().equals("bud_group_code"))
{ {
...@@ -316,6 +335,8 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca ...@@ -316,6 +335,8 @@ public class BudgetGroupAcct extends ValidatorEJB implements BudgetGroupAcctLoca
} }
} }
valueXmlString.append("</Detail2>"); valueXmlString.append("</Detail2>");
}// end switch }// end switch
......
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