Ejemplo n.º 1
0
 public void execute(String action, Obationable o, RunData data, Object arg) throws Exception {
   EngineDataSet ds = getOneTable();
   rowInfo.put(data.getRequest());
   String cpid = rowInfo.get("cpid");
   String zk = rowInfo.get("zk");
   String bz = rowInfo.get("bz");
   String dwtxid = rowInfo.get("dwtxid");
   String djlx = rowInfo.get("djlx");
   if (!isAdd) ds.goToInternalRow(editrow);
   if (isAdd) {
     String count =
         dataSetProvider.getSequence(
             "SELECT count(*) FROM xs_khcpzk where fgsid="
                 + fgsid
                 + " and dwtxid="
                 + dwtxid
                 + " and cpid="
                 + cpid);
     if (count != null && !count.equals("0")) {
       data.setMessage(showJavaScript("alert('已有该产品!')"));
       return;
     }
     ds.insertRow(false);
     ds.setValue("fgsid", fgsid);
   }
   ds.setValue("djlx", djlx);
   ds.setValue("cpid", cpid);
   ds.setValue("dwtxId", dwtxid);
   ds.setValue("zk", zk);
   ds.setValue("bz", bz);
   ds.post();
   ds.saveChanges();
   data.setMessage(showJavaScript("parent.hideInterFrame();"));
 }
Ejemplo n.º 2
0
 public void execute(String action, Obationable o, RunData data, Object arg) throws Exception {
   EngineDataSet ds = getOneTable();
   ds.goToRow(Integer.parseInt(data.getParameter("rownum")));
   ds.deleteRow();
   ds.saveChanges();
 }