Subversion Repositories SmartDukaan

Rev

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

Rev 6322 Rev 6524
Line 5... Line 5...
5
 
5
 
6
import javax.servlet.http.HttpServletRequest;
6
import javax.servlet.http.HttpServletRequest;
7
 
7
 
8
import org.apache.struts2.interceptor.ServletRequestAware;
8
import org.apache.struts2.interceptor.ServletRequestAware;
9
import org.apache.thrift.TException;
9
import org.apache.thrift.TException;
10
import org.apache.thrift.transport.TTransportException;
-
 
11
 
-
 
12
import com.opensymphony.xwork2.ActionSupport;
10
import com.opensymphony.xwork2.ActionSupport;
13
 
11
 
14
public class PincodeController extends ActionSupport implements ServletRequestAware {
12
public class PincodeController extends ActionSupport implements ServletRequestAware {
15
	
13
	
16
	private Long provider;
14
	private Long provider;
17
	private String pincode;
15
	private String pincode;
18
	private String destCode;
16
	private String destCode;
19
	private String exp;
17
	private String exp;
20
	private String cod;
18
	private String cod;
-
 
19
	private String otg;
21
	private String stationType;
20
	private String stationType;
22
	
21
	
23
	private boolean codService = false;
22
	private boolean codService = false;
24
	private boolean expService = false;
23
	private boolean expService = false;
-
 
24
	private boolean otgService = false;
25
	private int stationType_int = 1;
25
	private int stationType_int = 1;
26
	
26
	
27
	@Override
27
	@Override
28
	public void setServletRequest(HttpServletRequest arg0) {
28
	public void setServletRequest(HttpServletRequest arg0) {
29
		// TODO Auto-generated method stub
29
		// TODO Auto-generated method stub
Line 31... Line 31...
31
	}
31
	}
32
 
32
 
33
	public String addPincode() throws TException{
33
	public String addPincode() throws TException{
34
		setBooleanServiceability();
34
		setBooleanServiceability();
35
		Client logisticsClient = new LogisticsClient().getClient();
35
		Client logisticsClient = new LogisticsClient().getClient();
36
		logisticsClient.addPincode(provider, pincode, destCode, expService, codService, stationType_int);
36
		logisticsClient.addPincode(provider, pincode, destCode, expService, codService, stationType_int, otgService);
37
		return null;
37
		return null;
38
	}
38
	}
39
 
39
 
40
	public String updatePincode() throws TException{
40
	public String updatePincode() throws TException{
41
		setBooleanServiceability();
41
		setBooleanServiceability();
42
		Client logisticsClient = new LogisticsClient().getClient();
42
		Client logisticsClient = new LogisticsClient().getClient();
43
		logisticsClient.updatePincode(provider, pincode, expService, codService);
43
		logisticsClient.updatePincode(provider, pincode, expService, codService, otgService);
44
		return null;
44
		return null;
45
	}
45
	}
46
	
46
	
47
	public void setBooleanServiceability(){
47
	public void setBooleanServiceability(){
48
		
48
		
Line 50... Line 50...
50
			codService = true;
50
			codService = true;
51
		}
51
		}
52
		if(exp!= null && exp.equals("on")) {
52
		if(exp!= null && exp.equals("on")) {
53
			expService = true;
53
			expService = true;
54
		}
54
		}
-
 
55
		if(otg!= null && otg.equals("on")) {
-
 
56
			otgService = true;
-
 
57
		}
55
		if(stationType==null || !stationType.equals("on")) {
58
		if(stationType==null || !stationType.equals("on")) {
56
			stationType_int = 0;
59
			stationType_int = 0;
57
		}
60
		}
58
	}
61
	}
59
	
62
	
Line 102... Line 105...
102
	}
105
	}
103
 
106
 
104
	public void setStationType(String stationType) {
107
	public void setStationType(String stationType) {
105
		this.stationType = stationType;
108
		this.stationType = stationType;
106
	}
109
	}
-
 
110
 
-
 
111
	public void setOtg(String otg) {
-
 
112
		this.otg = otg;
-
 
113
	}
-
 
114
 
-
 
115
	public String getOtg() {
-
 
116
		return otg;
-
 
117
	}
107
	
118
	
108
	
119
	
109
}
120
}