Ejemplo n.º 1
0
        public async Task <MessageModel <string> > Post([FromBody] d_pap_equipment d_pap_equipment)
        {
            var data = new MessageModel <string>();

            var id = (await _d_pap_equipmentServices.Add(d_pap_equipment));

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

            return(data);
        }
Ejemplo n.º 2
0
        public async Task <MessageModel <string> > Update([FromBody] d_pap_equipment d_pap_equipment)
        {
            var data = new MessageModel <string>();

            if (d_pap_equipment != null && d_pap_equipment.ID > 0)
            {
                var id = (await _d_pap_equipmentServices.Update(d_pap_equipment));
                data.success = id;
                if (data.success)
                {
                    data.response = "id为" + d_pap_equipment.ID.ToString() + "的数据更新成功";
                    data.msg      = "更新成功";
                }
                else
                {
                    data.response = "id为" + d_pap_equipment.ID.ToString() + "的数据不存在";
                }
            }

            return(data);
        }