Ejemplo n.º 1
0
 public void onClick$OK() {
   if (sList.size() != 0) {
     WKTHtmlSign sign;
     for (int j = 0; j < sList.size(); j++) {
       sign = sList.get(j);
       sign.setKsOrderid(Long.parseLong(j + ""));
       if (sign.getKsId() != null) {
         signService.update(sign);
       } else {
         signService.save(sign);
       }
     }
   }
   signWin.detach();
 }
Ejemplo n.º 2
0
  public void onClick$delete() {

    if (signList.getSelectedItem() == null) {
      MessageBox.showWarning("请选择删除项!");
    } else {
      WKTHtmlSign sign = (WKTHtmlSign) signList.getSelectedItem().getValue();
      WKTHtmlSign wHtmlSign = signService.findBySignValue(sign.getKsValue().trim());
      if (wHtmlSign.equals("")) {
        WKTHtmlSign sign2;
        for (int i = 0; i < sList.size(); i++) {
          sign2 = sList.get(i);
          if (sign.getKsName().equals(sign2.getKsName())) {
            try {
              if (Messagebox.show(
                      "确定删除标记信息?", "提示信息", Messagebox.YES | Messagebox.NO, Messagebox.QUESTION)
                  == Messagebox.YES) {
                sList.remove(i);
                signValue.setValue("");
                signName.setValue("");
                loadSignList();
              }
            } catch (InterruptedException e) {
              e.printStackTrace();
            }
          }
        }
      } else {
        try {
          if (Messagebox.show(
                  "确定删除标记信息?", "提示信息", Messagebox.YES | Messagebox.NO, Messagebox.QUESTION)
              == Messagebox.YES) {
            signService.delete(sign);
            signValue.setValue("");
            signName.setValue("");
            Init();
          }
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
      } // else
    }
  }
Ejemplo n.º 3
0
  /* 暂存列表 */
  public void onClick$saveSign() {

    List<String> nameList = new ArrayList<String>();
    List<String> valueList = new ArrayList<String>();
    for (int a = 0; a < sList.size(); a++) {
      nameList.add(sList.get(a).getKsName());
      valueList.add(sList.get(a).getKsValue());
    }
    String sName = signName.getValue().trim();
    String sValue = signValue.getValue().trim();
    if (!sName.equals("") && !sValue.equals("")) {
      if (signList.getSelectedItem() == null) {

        WKTHtmlSign sign = new WKTHtmlSign();
        sign.setKsName(sName);
        sign.setKsValue(sValue);
        if (!nameList.contains(sign.getKsName()) && !valueList.contains(sign.getKsValue())) {
          sList.add(sign);
        } else {
          MessageBox.showWarning("名称或值重复!");
        }

        loadSignList();

      } else {
        WKTHtmlSign sign = (WKTHtmlSign) signList.getSelectedItem().getValue();
        WKTHtmlSign sign2;
        for (int i = 0; i < sList.size(); i++) {
          sign2 = sList.get(i);
          if (sign2.getKsName().equals(sign.getKsName())) {
            sign.setKsName(signName.getValue());
            sign.setKsValue(signValue.getValue());
            sign2 = sign;
          }
        }
        loadSignList();
      }

    } else {
      MessageBox.showWarning("请将信息填充完整!");
    }
  }