Exemplo n.º 1
0
 public void changeBalance(Subscriber ss, Double cost) {
   sslist = jsrw.readSubscr();
   for (int i = 0; i < sslist.size(); i++) {
     sslist = jsrw.readSubscr();
     if (sslist.get(i).equalsSubscr(ss)) sslist.get(i).replenish(cost);
   }
   jsrw.rewriteSubscr(sslist);
 }
Exemplo n.º 2
0
 public void changeBalance(String phNumber, Double cost) {
   sslist = jsrw.readSubscr();
   for (int i = 0; i < sslist.size(); i++) {
     String subnumber = sslist.get(i).getPhnumber();
     if (subnumber.equals(phNumber)) {
       sslist.get(i).replenish(cost);
     }
   }
   jsrw.rewriteSubscr(sslist);
 }
Exemplo n.º 3
0
 public void findSubscr(String str, DefaultListModel listModel) {
   if (str.isEmpty()) listModel.addElement("Пожалуйста, введите запрос");
   else {
     sslist = jsrw.readSubscr();
     for (Subscriber subscr : sslist) {
       String subname = subscr.getFullName();
       String subnumber = subscr.getPhnumber();
       if ((subname.contains(str) || subnumber.contains(str)) && !str.isEmpty()) {
         listModel.addElement(subnumber + ' ' + subname + ' ' + subscr.getBalance());
       }
     }
     if (listModel.isEmpty()) listModel.addElement("Совпадений не найдено");
   }
 }
Exemplo n.º 4
0
 public List<Subscriber> getSslist() {
   sslist = jsrw.readSubscr();
   return sslist;
 }