Commit 61bbbb0b authored by vkadam's avatar vkadam

Mandatory field validation.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96645 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7d201ed6
...@@ -84,7 +84,7 @@ implements CustomerLocal, CustomerRemote { ...@@ -84,7 +84,7 @@ implements CustomerLocal, CustomerRemote {
String salesPers="",tranCode="",siteCodeRcp="",siteCode="",channelPartner="",blackListing="",contactCode="",bankCode="",priceListDisc=""; String salesPers="",tranCode="",siteCodeRcp="",siteCode="",channelPartner="",blackListing="",contactCode="",bankCode="",priceListDisc="";
String salesOption="",dlvTerm="",lossPerc="",adhocReplPerc="",termTableNo="",priceListClg="",salesPers1="",salesPers2=""; String salesOption="",dlvTerm="",lossPerc="",adhocReplPerc="",termTableNo="",priceListClg="",salesPers1="",salesPers2="";
String keyFlag="",active="",lsVal3="",empCodeOrd="",empCodeOrd1="",custCodePd="",custCodeDisc="",sgroupCode="",custCodeAr="",currCodeFrt=""; String keyFlag="",active="",lsVal3="",empCodeOrd="",empCodeOrd1="",custCodePd="",custCodeDisc="",sgroupCode="",custCodeAr="",currCodeFrt="";
String blankVar=""; String blankVar="",custName="",shName="",availableYn="",creditLmt="",round="",roundTo="",currCodeIns="";
String regCode="",validUpto="",regDate=""; String regCode="",validUpto="",regDate="";
int ctr = 0; int ctr = 0;
int currentFormNo = 0; int currentFormNo = 0;
...@@ -167,7 +167,67 @@ implements CustomerLocal, CustomerRemote { ...@@ -167,7 +167,67 @@ implements CustomerLocal, CustomerRemote {
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
}else if(childNodeName.equalsIgnoreCase("ignore_credit")){ }else if(childNodeName.equalsIgnoreCase("cust_name")){
custName = this.genericUtility.getColumnValue("cust_name", dom);
if(custName==null || custName.trim().length()<=0){
errCode = "VMCNAMENLL";//Name is blank
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(childNodeName.equalsIgnoreCase("sh_name")){
shName = this.genericUtility.getColumnValue("sh_name", dom);
if(shName==null || shName.trim().length()<=0){
errCode = "VMSHNAMNLL";//Short Name is blank
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(childNodeName.equalsIgnoreCase("available_yn")){
availableYn = this.genericUtility.getColumnValue("available_yn", dom);
if(availableYn==null || availableYn.trim().length()<=0){
errCode = "VMAVLBNULL";//Available Name is blank
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(childNodeName.equalsIgnoreCase("round")){
round = this.genericUtility.getColumnValue("round", dom);
if(round==null || round.trim().length()<=0){
errCode = "VMROUNDNLL";//Round Name is blank
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}else if(childNodeName.equalsIgnoreCase("round_to")){
roundTo = this.genericUtility.getColumnValue("round_to", dom);
if(roundTo==null || roundTo.trim().length()<=0){
errCode = "VMRNDTONLL";//Round To Name is blank
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}else if(childNodeName.equalsIgnoreCase("curr_code__frt")){
currCodeFrt = this.genericUtility.getColumnValue("curr_code__frt", dom);
if(currCodeFrt==null || currCodeFrt.trim().length()<=0){
errCode = "VMCRCDFRNL";//Fright Currency is blank
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}else if(childNodeName.equalsIgnoreCase("curr_code__ins")){
currCodeIns = this.genericUtility.getColumnValue("curr_code__ins", dom);
if(currCodeIns==null || currCodeIns.trim().length()<=0){
errCode = "VMINSCRRNL";//Insurance Currency is blank
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(childNodeName.equalsIgnoreCase("ignore_credit")){
ignoreCredit = this.genericUtility.getColumnValue("ignore_credit", dom); ignoreCredit = this.genericUtility.getColumnValue("ignore_credit", dom);
cnt=0; cnt=0;
...@@ -178,8 +238,21 @@ implements CustomerLocal, CustomerRemote { ...@@ -178,8 +238,21 @@ implements CustomerLocal, CustomerRemote {
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
}else{
errCode = "VMIGCRTNLL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}else if(childNodeName.equalsIgnoreCase("credit_lmt")){
creditLmt = this.genericUtility.getColumnValue("credit_lmt", dom);
if(creditLmt==null){
errCode = "VMCRTLMNLL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} }
}else if(childNodeName.equalsIgnoreCase("ignore_days")){ }
else if(childNodeName.equalsIgnoreCase("ignore_days")){
ignoreDays = this.genericUtility.getColumnValue("ignore_days", dom); ignoreDays = this.genericUtility.getColumnValue("ignore_days", dom);
cnt=0; cnt=0;
...@@ -194,6 +267,7 @@ implements CustomerLocal, CustomerRemote { ...@@ -194,6 +267,7 @@ implements CustomerLocal, CustomerRemote {
}else if(childNodeName.equalsIgnoreCase("acct_code__adv")){ }else if(childNodeName.equalsIgnoreCase("acct_code__adv")){
acctCodeAdv = this.genericUtility.getColumnValue("acct_code__adv", dom); acctCodeAdv = this.genericUtility.getColumnValue("acct_code__adv", dom);
if(acctCodeAdv!=null){
cnt=0; cnt=0;
sql = "select count(*) as cnt from accounts where acct_code =?"; sql = "select count(*) as cnt from accounts where acct_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -230,6 +304,11 @@ implements CustomerLocal, CustomerRemote { ...@@ -230,6 +304,11 @@ implements CustomerLocal, CustomerRemote {
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
}else{
errCode = "VTACCTNLL";//Account adv null
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}else if(childNodeName.equalsIgnoreCase("cctr_code__adv")){ }else if(childNodeName.equalsIgnoreCase("cctr_code__adv")){
cctrCodeAdv = this.genericUtility.getColumnValue("cctr_code__adv", dom); cctrCodeAdv = this.genericUtility.getColumnValue("cctr_code__adv", dom);
cnt=0; cnt=0;
...@@ -255,6 +334,7 @@ implements CustomerLocal, CustomerRemote { ...@@ -255,6 +334,7 @@ implements CustomerLocal, CustomerRemote {
groupCode = this.genericUtility.getColumnValue("group_code", dom); groupCode = this.genericUtility.getColumnValue("group_code", dom);
custCode = this.genericUtility.getColumnValue("cust_code", dom); custCode = this.genericUtility.getColumnValue("cust_code", dom);
if(groupCode!=null && groupCode.trim().length()>0){
if(!groupCode.equalsIgnoreCase(custCode)){ if(!groupCode.equalsIgnoreCase(custCode)){
cnt=0; cnt=0;
sql = "select count(*) as cnt from customer where cust_code =?"; sql = "select count(*) as cnt from customer where cust_code =?";
...@@ -287,6 +367,11 @@ implements CustomerLocal, CustomerRemote { ...@@ -287,6 +367,11 @@ implements CustomerLocal, CustomerRemote {
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
}else{
errCode = "VMGRPCNULL";//Group Code is null
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}else if(childNodeName.equalsIgnoreCase("cust_code__bil")){ }else if(childNodeName.equalsIgnoreCase("cust_code__bil")){
custCodeBil = this.genericUtility.getColumnValue("cust_code__bil", dom); custCodeBil = this.genericUtility.getColumnValue("cust_code__bil", dom);
custCode = this.genericUtility.getColumnValue("cust_code", dom); custCode = this.genericUtility.getColumnValue("cust_code", dom);
...@@ -326,11 +411,16 @@ implements CustomerLocal, CustomerRemote { ...@@ -326,11 +411,16 @@ implements CustomerLocal, CustomerRemote {
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
}else if(custCodeBil==null){
errCode = "VMBLLTONLL";// Bill To is null
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} }
}else if(childNodeName.equalsIgnoreCase("stan_code")){ }else if(childNodeName.equalsIgnoreCase("stan_code")){
stanCode = this.genericUtility.getColumnValue("stan_code", dom); stanCode = this.genericUtility.getColumnValue("stan_code", dom);
cnt=0; cnt=0;
if(stanCode!=null){
sql = "select count(*) as cnt from station where stan_code =?"; sql = "select count(*) as cnt from station where stan_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, stanCode); pstmt.setString(1, stanCode);
...@@ -348,6 +438,11 @@ implements CustomerLocal, CustomerRemote { ...@@ -348,6 +438,11 @@ implements CustomerLocal, CustomerRemote {
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
}else{
errCode = "VMSTNCDNLL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}else if(childNodeName.equalsIgnoreCase("terr_code")){ }else if(childNodeName.equalsIgnoreCase("terr_code")){
terrCode = this.genericUtility.getColumnValue("terr_code", dom); terrCode = this.genericUtility.getColumnValue("terr_code", dom);
...@@ -563,6 +658,10 @@ implements CustomerLocal, CustomerRemote { ...@@ -563,6 +658,10 @@ implements CustomerLocal, CustomerRemote {
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
}else {
errCode = "VMACCTNLL";// A/C Rec is null
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} }
}else if(childNodeName.equalsIgnoreCase("cctr_code__ar")){ }else if(childNodeName.equalsIgnoreCase("cctr_code__ar")){
cctrCodeAr = this.genericUtility.getColumnValue("cctr_code__ar", dom); cctrCodeAr = this.genericUtility.getColumnValue("cctr_code__ar", dom);
...@@ -589,10 +688,11 @@ implements CustomerLocal, CustomerRemote { ...@@ -589,10 +688,11 @@ implements CustomerLocal, CustomerRemote {
}else{ }else{
acctCodeAr = this.genericUtility.getColumnValue("acct_code__ar", dom); acctCodeAr = this.genericUtility.getColumnValue("acct_code__ar", dom);
if(acctCodeAr!=null && acctCodeAr.trim().length()>0){ if(acctCodeAr!=null && acctCodeAr.trim().length()>0){
valueXmlString.append("<cctr_code__ar >") valueXmlString.append("<cctr_code__ar ><![CDATA[" + blankVar + "]]></cctr_code__ar>");
.append("<![CDATA[" + blankVar + "]]>")
.append("</cctr_code__ar>");
} }
errCode = "VTCCTRNLL";//Cost Center null
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} }
}else if(childNodeName.equalsIgnoreCase("tax_class")){ }else if(childNodeName.equalsIgnoreCase("tax_class")){
taxClass = this.genericUtility.getColumnValue("tax_class", dom); taxClass = this.genericUtility.getColumnValue("tax_class", dom);
...@@ -709,6 +809,10 @@ implements CustomerLocal, CustomerRemote { ...@@ -709,6 +809,10 @@ implements CustomerLocal, CustomerRemote {
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
}else{
errCode = "VMSLPERNLL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} }
} }
else if(childNodeName.equalsIgnoreCase("sales_pers__1")){ else if(childNodeName.equalsIgnoreCase("sales_pers__1")){
......
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