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(); }
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 } }
public void Init() { sList = signService.findAll(); loadSignList(); }