Subversion Repositories SmartDukaan

Rev

Rev 6322 | Rev 6612 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6322 amar.kumar 1
package in.shop2020.support.controllers;
2
 
3
import in.shop2020.logistics.LogisticsService.Client;
4
import in.shop2020.thrift.clients.LogisticsClient;
5
 
6
import javax.servlet.http.HttpServletRequest;
7
 
8
import org.apache.struts2.interceptor.ServletRequestAware;
9
import org.apache.thrift.TException;
10
import com.opensymphony.xwork2.ActionSupport;
11
 
12
public class PincodeController extends ActionSupport implements ServletRequestAware {
13
 
14
	private Long provider;
15
	private String pincode;
16
	private String destCode;
17
	private String exp;
18
	private String cod;
6524 rajveer 19
	private String otg;
6322 amar.kumar 20
	private String stationType;
21
 
22
	private boolean codService = false;
23
	private boolean expService = false;
6524 rajveer 24
	private boolean otgService = false;
6322 amar.kumar 25
	private int stationType_int = 1;
26
 
27
	@Override
28
	public void setServletRequest(HttpServletRequest arg0) {
29
		// TODO Auto-generated method stub
30
 
31
	}
32
 
33
	public String addPincode() throws TException{
34
		setBooleanServiceability();
35
		Client logisticsClient = new LogisticsClient().getClient();
6524 rajveer 36
		logisticsClient.addPincode(provider, pincode, destCode, expService, codService, stationType_int, otgService);
6322 amar.kumar 37
		return null;
38
	}
39
 
40
	public String updatePincode() throws TException{
41
		setBooleanServiceability();
42
		Client logisticsClient = new LogisticsClient().getClient();
6524 rajveer 43
		logisticsClient.updatePincode(provider, pincode, expService, codService, otgService);
6322 amar.kumar 44
		return null;
45
	}
46
 
47
	public void setBooleanServiceability(){
48
 
49
		if(cod!=null && cod.equals("on")) {
50
			codService = true;
51
		}
52
		if(exp!= null && exp.equals("on")) {
53
			expService = true;
54
		}
6524 rajveer 55
		if(otg!= null && otg.equals("on")) {
56
			otgService = true;
57
		}
6322 amar.kumar 58
		if(stationType==null || !stationType.equals("on")) {
59
			stationType_int = 0;
60
		}
61
	}
62
 
63
	public Long getProvider() {
64
		return provider;
65
	}
66
 
67
	public void setProvider(Long provider) {
68
		this.provider = provider;
69
	}
70
 
71
	public String getPincode() {
72
		return pincode;
73
	}
74
 
75
	public void setPincode(String pincode) {
76
		this.pincode = pincode;
77
	}
78
 
79
	public String getDestCode() {
80
		return destCode;
81
	}
82
 
83
	public void setDestCode(String destCode) {
84
		this.destCode = destCode;
85
	}
86
 
87
	public String isExp() {
88
		return exp;
89
	}
90
 
91
	public void setExp(String exp) {
92
		this.exp = exp;
93
	}
94
 
95
	public String isCod() {
96
		return cod;
97
	}
98
 
99
	public void setCod(String cod) {
100
		this.cod = cod;
101
	}
102
 
103
	public String isStationType() {
104
		return stationType;
105
	}
106
 
107
	public void setStationType(String stationType) {
108
		this.stationType = stationType;
109
	}
6524 rajveer 110
 
111
	public void setOtg(String otg) {
112
		this.otg = otg;
113
	}
114
 
115
	public String getOtg() {
116
		return otg;
117
	}
6322 amar.kumar 118
 
119
 
120
}