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

            var id = (await _d_study_recordServices.Add(d_study_record));

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

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

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

            return(data);
        }