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