private void save() {
    try {
      Record records[] = listGrid.getRecords();

      Integer mainIdList[] = new Integer[records.length];
      int i = 0;
      for (Record record : records) {
        mainIdList[i++] = record.getAttributeAsInt("main_id");
      }
      DataSource dataSource = DataSource.get("OrgDS");
      com.smartgwt.client.rpc.RPCManager.startQueue();
      Record record = new Record();
      record.setAttribute("mainIdList", mainIdList);
      record.setAttribute(
          "loggedUserName", CommonSingleton.getInstance().getSessionPerson().getUserName());
      DSRequest req = new DSRequest();
      req.setAttribute("operationId", "updateMainServiceOrders");
      dataSource.updateData(
          record,
          new DSCallback() {
            @Override
            public void execute(DSResponse response, Object rawData, DSRequest request) {
              destroy();
              tabOrganization.search();
            }
          },
          req);
      com.smartgwt.client.rpc.RPCManager.sendQueue();

    } catch (Exception e) {
      e.printStackTrace();
      SC.say(e.toString());
    }
  }
예제 #2
0
  private void changeStatus(Integer calendar_id, Integer deleted) {
    try {
      com.smartgwt.client.rpc.RPCManager.startQueue();
      Record record = new Record();
      record.setAttribute("deleted", deleted);
      record.setAttribute("calendar_id", calendar_id);
      record.setAttribute(
          "loggedUserName", CommonSingleton.getInstance().getSessionPerson().getUserName());
      DSRequest req = new DSRequest();

      req.setAttribute("operationId", "updateSecularCalendarStatus");
      listGrid.updateData(
          record,
          new DSCallback() {
            @Override
            public void execute(DSResponse response, Object rawData, DSRequest request) {}
          },
          req);
      com.smartgwt.client.rpc.RPCManager.sendQueue();
    } catch (Exception e) {
      SC.say(e.toString());
    }
  }