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

            var id = (await _b_zhd_architectureServices.Add(b_zhd_architecture));

            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] b_zhd_architecture b_zhd_architecture)
        {
            var data = new MessageModel <string>();

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

            return(data);
        }