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 ...@@ -112,36 +112,36 @@ public class SOrderType extends ValidatorEJB implements SOrderTypeLocal,SOrderTy
{ {
orderType = checkNull(genericUtility.getColumnValue("order_type", dom)); orderType = checkNull(genericUtility.getColumnValue("order_type", dom));
System.out.println("order_type ="+orderType); 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"); System.out.println("order_type BLANK");
errCode = "VMORTYBK"; errCode = "VMCODNULL";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); 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 = ?"; sql = "SELECT count(*) FROM sordertype where order_type = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,orderType); pstmt.setString(1,orderType);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
cnt = rs.getInt(1); cnt = rs.getInt(1);
System.out.println("COUNT = "+cnt); System.out.println("COUNT = "+cnt);
if(cnt > 0) }
{ rs.close();
errCode = "VMORTYDB"; rs = null;
errList.add(errCode); pstmt.close();
errFields.add(childNodeName.toLowerCase()); pstmt = null;
} if(cnt > 0)
} {
rs.close(); errCode = "VMDUPL1";
rs = null; errList.add(errCode);
pstmt.close(); errFields.add(childNodeName.toLowerCase());
pstmt = null; }
}*/ }
} }
else if(childNodeName.equalsIgnoreCase("descr")) else if(childNodeName.equalsIgnoreCase("descr"))
...@@ -149,7 +149,7 @@ public class SOrderType extends ValidatorEJB implements SOrderTypeLocal,SOrderTy ...@@ -149,7 +149,7 @@ public class SOrderType extends ValidatorEJB implements SOrderTypeLocal,SOrderTy
desc = checkNull(genericUtility.getColumnValue("descr", dom)); desc = checkNull(genericUtility.getColumnValue("descr", dom));
if(desc == null || desc.trim().length() == 0) if(desc == null || desc.trim().length() == 0)
{ {
errCode = "VMDESNA "; errCode = "VMDESCR";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
...@@ -159,7 +159,7 @@ public class SOrderType extends ValidatorEJB implements SOrderTypeLocal,SOrderTy ...@@ -159,7 +159,7 @@ public class SOrderType extends ValidatorEJB implements SOrderTypeLocal,SOrderTy
shortDesc = checkNull(genericUtility.getColumnValue("sh_descr", dom)); shortDesc = checkNull(genericUtility.getColumnValue("sh_descr", dom));
if(shortDesc == null || shortDesc.trim().length() == 0) if(shortDesc == null || shortDesc.trim().length() == 0)
{ {
errCode = "VTSH_DESC "; errCode = "VTSH_DESC";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); 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