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

            d_poeple_attribute.Guid = Guid.NewGuid().ToString();
            var id = (await _d_poeple_attributeServices.Add(d_poeple_attribute));

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

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

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

            return(data);
        }