Commit 26e37107 authored by smestry's avatar smestry

Updated the Product wizard for minor bugs.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102059 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 71e1b51a
......@@ -630,11 +630,8 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
valueXmlString.append("<site_codes>").append("<![CDATA[]]>").append("</site_codes>\r\n");
valueXmlString.append("<site_desc>").append("<![CDATA[]]>").append("</site_desc>\r\n");
// Sneha
//valueXmlString.append("<dimension_desc>").append("<![CDATA[]]>").append("</dimension_desc>\r\n");
valueXmlString.append("<dimension_desc>").append("<![CDATA[NA]]>").append("</dimension_desc>\r\n");
valueXmlString.append("<dim_code_desc>").append("<![CDATA[Not Applicable]]>").append("</dim_code_desc>\r\n");
// End
valueXmlString.append("<dimension_desc>").append("<![CDATA[]]>").append("</dimension_desc>\r\n");
valueXmlString.append("<dim_code_desc>").append("<![CDATA[]]>").append("</dim_code_desc>\r\n");
valueXmlString.append("<color_codes>").append("<![CDATA[]]>").append("</color_codes>\r\n");
valueXmlString.append("<color_code_descr>").append("<![CDATA[]]>").append("</color_code_descr>\r\n");
......
......@@ -14,6 +14,7 @@ import java.util.Set;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
......@@ -141,6 +142,11 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
PreparedStatement pstmt = null ;
ResultSet rs = null;
ConnDriver connDriver = new ConnDriver();
// Changed by Sneha on 23-06-2016 [Start]
boolean flag = false;
String item_barcode = "";
// Changed by Sneha on 23-06-2016 [End]
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
try
{
......@@ -210,12 +216,12 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
if (childNodeName.equalsIgnoreCase("item_barcode"))
{
int paramName = 0;
String item_parnt = genericUtility.getColumnValue("item_barcode", dom);
item_barcode = genericUtility.getColumnValue("item_barcode", dom);
String ITEM_CODE = genericUtility.getColumnValue("item_code", dom);
String countSerSql = "SELECT COUNT(1) AS COUNT FROM ITEM WHERE TRIM(udf__str2) = ? AND item_code != ? ";
PreparedStatement pstmtParamName = conn.prepareStatement(countSerSql);
pstmtParamName.setString(1, item_parnt);
pstmtParamName.setString(1, item_barcode);
pstmtParamName.setString(2, ITEM_CODE);
ResultSet rsCnt = pstmtParamName.executeQuery();
......@@ -225,11 +231,14 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
paramName = rsCnt.getInt("COUNT");
}
if (paramName != 0) {
errCode = "DUPITMBARC";
if (paramName != 0)
{
// Changed by Sneha on 23-06-2016 for validation of item_barcode [Start]
flag = true;
/*errCode = "DUPITMBARC";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errFields.add(childNodeName.toLowerCase());*/
// Changed by Sneha on 23-06-2016 for validation of item_barcode [End]
}
......@@ -267,10 +276,26 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
errFields = null;
errStringXml.append("</Errors> </Root> \r\n");
}
// Changed by Sneha on 23-06-2016 for validation of item_barcode [Start]
else
{
//errStringXml = new StringBuffer("");
if(flag)
{
//System.out.println("Inside flag=======>>"+flag);
return getError(item_barcode, "DUPITMBARC", conn);
}
else
{
errStringXml = new StringBuffer("");
}
}
/*else
{
errStringXml = new StringBuffer("");
}*/
// Changed by Sneha on 23-06-2016 for validation of item_barcode [End]
}// End of try
catch(Exception e)
{
......@@ -310,6 +335,31 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
return errString;
}
// Changed by Sneha on 23-06-2016 for validation of item_barcode [Start]
public String getError(String item_barcode, String Code, Connection conn) throws ITMException, Exception
{
String mainStr ="";
try
{
String errString = "";
errString = new ITMDBAccessEJB().getErrorString("",Code,"","",conn);
String begPart = errString.substring(0,errString.indexOf("<message>")+9);
String endDesc = errString.substring(errString.indexOf("</description>"));
mainStr= begPart+"Invalid Barcode for."+"</message><description>";
mainStr= mainStr+"Barcode already exists in master for the barcode : ["+item_barcode+"]."+endDesc;
System.out.println("mainStr:::::::::::::::::: "+mainStr);
begPart = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return mainStr;
}
// Changed by Sneha on 23-06-2016 for validation of item_barcode [End]
@Override
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
......
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