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