Exemple #1
0
 public Master createTemp(int category) {
   Master master = new Master();
   master.setCategory(category);
   master.setId(-1);
   master.setCode("");
   master.setName("");
   return master;
 }
Exemple #2
0
  public Master getMaster(Integer category, String code) {

    List<Master> ms = getMasters(category);
    for (Master m : ms) {
      if (m.getCode().equals(code)) {
        return m;
      }
    }
    return null;
  }
Exemple #3
0
 public String getMasterName(String id) {
   if (id == null || id.length() == 0) {
     return "";
   }
   Master m = orignals.get(Integer.parseInt(id));
   if (m != null) {
     return m.getName();
   }
   return "";
 }
Exemple #4
0
 public String getMasterName(Integer id) {
   if (id == null) {
     return "";
   }
   Master m = orignals.get(id);
   if (m != null) {
     return m.getName();
   }
   return "";
 }
Exemple #5
0
 public String getMasterName(int category, String code) {
   List<Master> ms = masters.get(category);
   if (ms != null) {
     for (Master m : ms) {
       if (m.getCode().equals(code)) {
         return m.getName();
       }
     }
   }
   return "";
 }
Exemple #6
0
 public void init(List<Master> ms) {
   for (Master m : ms) {
     orignals.put(m.getId(), m);
     List<Master> cms = masters.get(m.getCategory());
     if (cms == null) {
       cms = new ArrayList<Master>();
       masters.put(m.getCategory(), cms);
     }
     cms.add(m);
   }
 }