-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyBalance.java
73 lines (66 loc) · 1.78 KB
/
MyBalance.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package i2i.benimle;
import i2i_benimle.Balance;
/**
*
* @author Furkan KAYALI
*/
public class MyBalance {
private int data,
sms,
voice,
money;
private String date;
private Balance balance;
public String getDate() {
return date;
}
private void setDate(String date) {
this.date = date;
}
WsConnection wsPort = new WsConnection();
public MyBalance(){
}
public int getData(){
return data;
}
private void setData(int value){
this.data = value;
}
public int getSms(){
return sms;
}
private void setSms(int value){
this.sms = value;
}
public int getVoice(){
return voice;
}
private void setVoice(int value){
this.voice = value;
}
public int getMoney(){
return money;
}
private void setMoney(int value){
this.money = value;
}
public boolean addMoney(int value,String msisdn){ // bu class olmalı mı?
int check = wsPort.service.getDbi2IBenimlePort().updateCustomerWallet(value,msisdn);
switch (check) {
case -2:
return false;
case -1:
return false;
default:
return true;
}
}
public void refresh(int ID){
balance = wsPort.service.getDbi2IBenimlePort().getBalance(ID);
this.setMoney(wsPort.service.getDbi2IBenimlePort().getCustomerWallet(ID).getAmount());
this.setData(balance.getRemainingData());
this.setSms(balance.getRemainingSms());
this.setVoice(balance.getRemainingVoice());
this.setDate(balance.getExpirationDate());
}
}