Commit 7835584d authored by pchavan's avatar pchavan

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@185531 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 06c7edc6
......@@ -69,26 +69,28 @@ public class CostallocPrs extends ValidatorEJB implements CostallocPrsLocal, Cos
}
System.out.println("connection is :"+conn);
/*parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();*/
parentNodeList = dom.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength();
for(int row = 0; row < parentNodeListLength; row++)
{
updateFlag = getAttribValue(parentNode,"attribute", "updateFlag"); //(parentNode, "attribute", "status"));
System.out.println(" update flag ["+updateFlag+"]");
if(!"D".equalsIgnoreCase(updateFlag))
for(int row = 0; row < parentNodeListLength; row++)
{
allocPerc = checkNull(genericUtility.getColumnValueFromNode("alloc_perc", dom.getElementsByTagName("Detail2").item(row)));
System.out.println("allocPerc :"+allocPerc);
if(allocPerc != null && allocPerc.trim().length() >0)
updateFlag = getAttributeVal(parentNodeList.item(row),"updateFlag");
//updateFlag = getAttribValue(parentNode,"attribute", "updateFlag"); //(parentNode, "attribute", "status"));
System.out.println(" update flagssss ["+updateFlag+"]");
if(!"D".equalsIgnoreCase(updateFlag))
{
allocPercVal = allocPercVal + Double.valueOf(allocPerc);
allocPerc = checkNull(genericUtility.getColumnValueFromNode("alloc_perc", dom.getElementsByTagName("Detail2").item(row)));
System.out.println("allocPerc :"+allocPerc);
if(allocPerc != null && allocPerc.trim().length() >0)
{
allocPercVal = allocPercVal + Double.valueOf(allocPerc);
}
}
}
}
resBasis = checkNull(genericUtility.getColumnValue("alloc_basis",dom)).trim();
System.out.println("resBasis IN PRESAVE : "+resBasis);
if("1".equalsIgnoreCase(resBasis))
......@@ -193,4 +195,35 @@ public class CostallocPrs extends ValidatorEJB implements CostallocPrsLocal, Cos
}
return attribValue;
}
public String getAttributeVal(Node dom, String attribName )throws ITMException
{
String AttribValue = null;
try
{
NodeList detailList = dom.getChildNodes();
int detListLength = detailList.getLength();
for(int ctr = 0; ctr < detListLength; ctr++)
{
Node curDetail = detailList.item(ctr);
if(curDetail.getNodeName().equals("attribute"))
{
AttribValue = curDetail.getAttributes().getNamedItem(attribName).getNodeValue();
break;
}
else
{
continue;
}
}
}
catch (Exception e)
{
System.out.println("Exception : : searchNode :"+e);
throw new ITMException(e);
}
return AttribValue;
}
}
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