public async Task <MessageModel <string> > Post([FromBody] d_shaowei_preplan d_shaowei_preplan) { var data = new MessageModel <string>(); var id = (await _d_shaowei_preplanServices.Add(d_shaowei_preplan)); data.success = id > 0; if (data.success) { data.response = id.ObjToString(); data.msg = "添加成功"; } return(data); }
public async Task <MessageModel <string> > Update([FromBody] d_shaowei_preplan d_shaowei_preplan) { var data = new MessageModel <string>(); if (d_shaowei_preplan != null) { var id = (await _d_shaowei_preplanServices.Update(d_shaowei_preplan)); data.success = id; if (data.success) { data.response = "id为" + d_shaowei_preplan.ID.ToString() + "的数据更新成功"; data.msg = "更新成功"; } else { data.response = "id为" + d_shaowei_preplan.ID.ToString() + "的数据不存在"; } } return(data); }