예제 #1
0
  /**
   * 更新餐桌
   *
   * @return
   */
  @Action(
      value = "updateTableT",
      results = {@Result(name = "json", type = "json")})
  public String updateTableT() {
    if (Validate.StrisNull(this.getTableid())
        && Validate.StrisNull(this.getTableNumber())
        && Validate.StrisNull(this.getRoomName())) {
      this.setSucflag(false);
      return "json";
    }
    if (this.getTableTService().findTableBytableid(this.getTableid()) != null) {
      TableT tt = new TableT();
      tt.setTableid(this.getTableid());
      tt.setTableNumber(this.getTableNumber());
      tt.setRoomName(this.getRoomName());
      tt.setFloor(this.getFloor());
      tt.setNop(this.getNop());
      tt.setNote(this.getNote());
      tt.setCreatetime(BaseTools.systemtime());
      tt.setCreatorid(BaseTools.adminCreateId());
      tt.setTablestate(this.getTablestate());

      this.getTableTService().updateTableT(tt);
      this.setSucflag(true);
      return "json";
    } else {
      this.setSucflag(false);
      return "json";
    }
  }
예제 #2
0
  /** 增加餐桌 */
  @Action(
      value = "addTableT",
      results = {@Result(name = "json", type = "json")})
  public String addTableT() {

    if (Validate.StrisNull(this.getTableNumber()) && Validate.StrisNull(this.getRoomName())) {
      this.setSucflag(false);
      return "json";
    }
    TableT tt = new TableT();
    tt.setTableid(this.getSerial().Serialid(Serial.ELECTABLE));
    tt.setTableNumber(this.getTableNumber().trim());
    tt.setRoomName(this.getRoomName().trim());
    tt.setFloor(this.getFloor());
    tt.setNop(this.getNop());
    tt.setCreatetime(BaseTools.systemtime());
    tt.setCreatorid(BaseTools.adminCreateId());
    tt.setTablestate("0");

    if (this.getTableTService().addTableT(tt) > 0) {
      this.setSucflag(true);
      return "json";
    } else {
      this.setSucflag(false);
      return "json";
    }
  }