Пример #1
0
        public async Task <MessageModel <string> > Post([FromBody] b_education_level b_education_level)
        {
            var data = new MessageModel <string>();

            var id = (await _b_education_levelServices.Add(b_education_level));

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

            return(data);
        }
Пример #2
0
        public async Task <MessageModel <string> > Update([FromBody] b_education_level b_education_level)
        {
            var data = new MessageModel <string>();

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

            return(data);
        }