示例#1
0
        public SingleResponeMessage <CapitalInfo> Get(int id)
        {
            SingleResponeMessage <CapitalInfo> ret = new SingleResponeMessage <CapitalInfo>();

            ret.item      = CapitalServices.GetInstance().getCapitalbyId(id);
            ret.isSuccess = true;

            return(ret);
        }
示例#2
0
        public ListResponeMessage <CapitalInfo> GetByName(string name)
        {
            ListResponeMessage <CapitalInfo> ret = new ListResponeMessage <CapitalInfo>();

            ret.data      = CapitalServices.GetInstance().GetByName(name);
            ret.isSuccess = true;

            return(ret);
        }
示例#3
0
        public ListResponeMessage <CapitalInfo> GetAll()
        {
            ListResponeMessage <CapitalInfo> ret = new ListResponeMessage <CapitalInfo>();

            ret.data      = CapitalServices.GetInstance().getAllCapital();
            ret.isSuccess = true;

            return(ret);
        }
示例#4
0
        public ActionMessage Post([FromBody] CapitalInfo _capital)
        {
            ActionMessage ret = new ActionMessage();

            try
            {
                ret = CapitalServices.GetInstance().createCapital(_capital);
            }
            catch (Exception ex)
            {
                ret.isSuccess     = false;
                ret.err.msgCode   = "001";
                ret.err.msgString = ex.ToString();
            }
            return(ret);
        }
示例#5
0
        public ActionMessage Delete(int id)
        {
            ActionMessage ret = new ActionMessage();

            try
            {
                CapitalServices.GetInstance().deleteCapital(id);
                ret.isSuccess = true;
            }
            catch (Exception ex)
            {
                ret.isSuccess     = false;
                ret.err.msgCode   = "001";
                ret.err.msgString = ex.ToString();
            }
            return(ret);
        }
示例#6
0
        public ActionMessage Put(int id, [FromBody] CapitalInfo _capital)
        {
            ActionMessage ret = new ActionMessage();

            try
            {
                CapitalServices.GetInstance().editEmloyee(id, _capital);
                ret.isSuccess = true;
            }
            catch (Exception ex)
            {
                ret.isSuccess     = false;
                ret.err.msgCode   = "001";
                ret.err.msgString = ex.ToString();
            }
            return(ret);
        }