public String edit() { info.setEditUserNo(UserHelper.getEditUserNo()); int id = 0; if (this.getOper().equalsIgnoreCase("add")) { info.setInUserNo(UserHelper.getEditUserNo()); id = TempRecruitDetailModel.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 (TempRecruitDetailModel.update(info) > 0) { this.setErrDesc(String.valueOf(info.getId())); } else { this.setErrCode("update failed"); this.setErrDesc("update failed"); } } } } return SUCCESS; }
public String getInfoById() { if (StringHelper.isNullOrEmpty(this.getId())) { this.setErrCode("NoID"); this.setErrDesc("NoID"); } else { this.info = TempRecruitDetailModel.getInfo(Integer.parseInt(this.getId())); if (this.info == null) { this.setErrCode("No Info"); this.setErrDesc("No Info"); } } return SUCCESS; }
@Override public String execute() throws Exception { TempRecruitDetailCondition tempRecruitDetailCondition = new TempRecruitDetailCondition(); tempRecruitDetailCondition.setPageSize(this.getPageSize()); tempRecruitDetailCondition.setPageIndex(this.getPageIndex()); List<SortItem> sortItemList = new ArrayList<SortItem>(); SortItem sortItem = new SortItem(); sortItem.setSortFeild(this.getSidx()); sortItem.setSortType(this.getSortType()); sortItemList.add(sortItem); tempRecruitDetailCondition.setSortItemList(sortItemList); PagedList<TempRecruitDetail> tempRecruitDetailPagedList = TempRecruitDetailModel.getPagingList(tempRecruitDetailCondition); this.setResultList(tempRecruitDetailPagedList.getResultList()); this.setPageCount(tempRecruitDetailPagedList.getPagingInfo().getPageCount()); this.setPageIndex(tempRecruitDetailPagedList.getPagingInfo().getPageIndex()); this.setRecordCount(tempRecruitDetailPagedList.getPagingInfo().getTotalCount()); return SUCCESS; }