Commit 18481ecf authored by manohar's avatar manohar

duplicate checking added for order type, also messages made proper


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93390 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fb1a940d
......@@ -112,36 +112,36 @@ public class SOrderType extends ValidatorEJB implements SOrderTypeLocal,SOrderTy
{
orderType = checkNull(genericUtility.getColumnValue("order_type", dom));
System.out.println("order_type ="+orderType);
/*if(orderType == null || orderType.trim().length() == 0)
if(orderType == null || orderType.trim().length() == 0)
{
System.out.println("order_type BLANK");
errCode = "VMORTYBK";
errCode = "VMCODNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(orderType != null && orderType.trim().length() > 0)
else if(orderType != null && orderType.trim().length() > 0 && "A".equals(editFlag))
{
sql = "SELECT count(*) FROM sordertype where order_type = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,orderType);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
System.out.println("COUNT = "+cnt);
if(cnt > 0)
{
errCode = "VMORTYDB";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "SELECT count(*) FROM sordertype where order_type = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,orderType);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
System.out.println("COUNT = "+cnt);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt > 0)
{
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}*/
}
}
else if(childNodeName.equalsIgnoreCase("descr"))
......@@ -149,7 +149,7 @@ public class SOrderType extends ValidatorEJB implements SOrderTypeLocal,SOrderTy
desc = checkNull(genericUtility.getColumnValue("descr", dom));
if(desc == null || desc.trim().length() == 0)
{
errCode = "VMDESNA ";
errCode = "VMDESCR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
......@@ -159,7 +159,7 @@ public class SOrderType extends ValidatorEJB implements SOrderTypeLocal,SOrderTy
shortDesc = checkNull(genericUtility.getColumnValue("sh_descr", dom));
if(shortDesc == null || shortDesc.trim().length() == 0)
{
errCode = "VTSH_DESC ";
errCode = "VTSH_DESC";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
......
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