public String edit() { info.setEditUserNo(UserHelper.getEditUserNo()); int id = 0; if (this.getOper().equalsIgnoreCase("add")) { info.setInUserNo(UserHelper.getEditUserNo()); id = PaymentMoneyWithdrawModel.add(info); if (id > 0) { this.setErrDesc(String.valueOf(id)); } else { this.setErrCode("add failed"); this.setErrDesc("add failed"); } } else { if (info.getId() == 0) { this.setErrCode("NoID"); this.setErrDesc("NoID"); } else { if (this.getOper().equalsIgnoreCase("edit")) { if (PaymentMoneyWithdrawModel.update(info) > 0) { this.setErrDesc(String.valueOf(info.getId())); } else { this.setErrCode("update failed"); this.setErrDesc("update failed"); } } } } return SUCCESS; }
@Override public String execute() throws Exception { PagedList<PaymentMoneyWithdraw> paymentMoneyWithdrawPagedList = PaymentMoneyWithdrawModel.getPagingList(this.getCondition()); this.setResultList(paymentMoneyWithdrawPagedList.getResultList()); this.setPageCount(paymentMoneyWithdrawPagedList.getPagingInfo().getPageCount()); this.setPageIndex(paymentMoneyWithdrawPagedList.getPagingInfo().getPageIndex()); this.setRecordCount(paymentMoneyWithdrawPagedList.getPagingInfo().getTotalCount()); int i = 0; for (PaymentMoneyWithdraw item : paymentMoneyWithdrawPagedList.getResultList()) { item.setId(++i); } return SUCCESS; }