Subversion Repositories SmartDukaan

Rev

Rev 7410 | Rev 10295 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7410 Rev 10121
Line 74... Line 74...
74
        return super.edit();
74
        return super.edit();
75
    }
75
    }
76
 
76
 
77
    public String create() {
77
    public String create() {
78
        try {
78
        try {
-
 
79
        	if(name==null || ("").equalsIgnoreCase(name)){
-
 
80
        		throw new Exception("Supplier Name is Mandatory.");
-
 
81
        	}
-
 
82
        	if((phone==null || ("").equalsIgnoreCase(phone)) && !StringUtils.isNumeric(phone)){
-
 
83
        		throw new Exception("Supplier Phone is Mandatory and Should be in digits only");
-
 
84
        	}
-
 
85
        	if(fax==null || ("").equalsIgnoreCase(fax)){
-
 
86
        		throw new Exception("Supplier Fax is Mandatory.");
-
 
87
        	}
-
 
88
        	if(tin==null || ("").equalsIgnoreCase(tin)){
-
 
89
        		throw new Exception("Supplier Name is Mandatory.");
-
 
90
        	}
-
 
91
        	if(pan==null || ("").equalsIgnoreCase(pan)){
-
 
92
        		throw new Exception("Supplier PAN is Mandatory.");
-
 
93
        	}
-
 
94
        	if(headName==null || ("").equalsIgnoreCase(headName)){
-
 
95
        		throw new Exception("Supplier Head Name is Mandatory.");
-
 
96
        	}
-
 
97
        	if(headEmail==null || ("").equalsIgnoreCase(headEmail)){
-
 
98
        		throw new Exception("Supplier Head Email is Mandatory.");
-
 
99
        	}
-
 
100
        	if(contactName==null || ("").equalsIgnoreCase(contactName)){
-
 
101
        		throw new Exception("Supplier Contact Name is Mandatory.");
-
 
102
        	}
-
 
103
        	if(contactFax==null || ("").equalsIgnoreCase(contactFax)){
-
 
104
        		throw new Exception("Supplier Name is Mandatory.");
-
 
105
        	}
-
 
106
        	if(contactPhone==null || ("").equalsIgnoreCase(contactPhone)){
-
 
107
        		throw new Exception("Supplier Contact Phone is Mandatory.");
-
 
108
        	}
-
 
109
        	if(registeredAddress==null || ("").equalsIgnoreCase(registeredAddress)){
-
 
110
        		throw new Exception("Supplier Registered Address is Mandatory.");
-
 
111
        	}
-
 
112
        	if(communicationAddress==null || ("").equalsIgnoreCase(communicationAddress)){
-
 
113
        		throw new Exception("Supplier Communication Address is Mandatory.");
-
 
114
        	}
-
 
115
        	if(billingWarehouseIds==null || billingWarehouseIds.size()==0){
-
 
116
        		throw new Exception("Atleast One Billing Warehouse is Mandatory.");
-
 
117
        	}
79
            Supplier supplier = new Supplier();
118
            Supplier supplier = new Supplier();
80
            supplier.setName(name);
119
            supplier.setName(name);
81
            supplier.setCommunicationAddress(communicationAddress);
120
            supplier.setCommunicationAddress(communicationAddress);
82
            supplier.setContactEmail(contactEmail);
121
            supplier.setContactEmail(contactEmail);
83
            supplier.setContactFax(contactFax);
122
            supplier.setContactFax(contactFax);