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