示例#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();"));
 }
示例#2
0
  /**
   * 得到选中的行的行数
   *
   * @return 若返回-1,表示没有选中的行
   */
  public final int getSelectedRow() {
    if (masterRow < 0) return -1;

    dsMasterTable.goToInternalRow(masterRow);
    return dsMasterTable.getRow();
  }