Exemple #1
0
        public SingleResponeMessage <ProposalTypeInfo> Get(int id)
        {
            SingleResponeMessage <ProposalTypeInfo> ret = new SingleResponeMessage <ProposalTypeInfo>();

            ret.isSuccess = true;
            ret.item      = ProposalTypeService.GetInstance().getProposalTypebyId(id);
            return(ret);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }