public SingleResponeMessage <ProposalTypeInfo> Get(int id) { SingleResponeMessage <ProposalTypeInfo> ret = new SingleResponeMessage <ProposalTypeInfo>(); ret.isSuccess = true; ret.item = ProposalTypeService.GetInstance().getProposalTypebyId(id); return(ret); }
public ActionMessage Delete(int id) { ActionMessage ret = new ActionMessage(); try { ret = ProposalTypeService.GetInstance().deleteProposalType(id); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "001"; ret.err.msgString = ex.ToString(); } return(ret); }
public ActionMessage Put(int id, [FromBody] ProposalTypeInfo _department) { ActionMessage ret = new ActionMessage(); try { ret = ProposalTypeService.GetInstance().editProposalType(id, _department, GetUserId()); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "001"; ret.err.msgString = ex.ToString(); } return(ret); }
public ActionMessage Post([FromBody] ProposalTypeInfo _proposalType) { ActionMessage ret = new ActionMessage(); try { ret = ProposalTypeService.GetInstance().createProposalType(_proposalType, GetUserId()); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "001"; ret.err.msgString = ex.ToString(); } return(ret); }
public ListResponeMessage <ProposalTypeInfo> GetList(int pageSize = 10, int pageIndex = 0) { ListResponeMessage <ProposalTypeInfo> ret = new ListResponeMessage <ProposalTypeInfo>(); try { ret.isSuccess = true; ret.data = ProposalTypeService.GetInstance().getAllProposalType(pageSize, pageIndex); ret.totalRecords = ProposalTypeService.GetInstance().getTotalRecords(ret.data); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "005"; ret.err.msgString = ex.ToString(); } return(ret); }