Exemple #1
0
        public async Task <MessageModel <string> > Post([FromBody] PM_PLAN_SUB request)
        {
            var data = new MessageModel <string>();

            var id = await _PM_PLAN_SUBServices.Add(request);

            data.success = id > 0;

            if (data.success)
            {
                data.response = id.ObjToString();
                data.msg      = "添加成功";
            }

            return(data);
        }
Exemple #2
0
        public async Task <MessageModel <string> > Put([FromBody] PM_PLAN_SUB request)
        {
            var data = new MessageModel <string>();

            if (request.ID > 0)
            {
                data.success = await _PM_PLAN_SUBServices.Update(request);

                if (data.success)
                {
                    data.msg      = "更新成功";
                    data.response = request?.ID.ObjToString();
                }
            }

            return(data);
        }