/// <summary> /// 报修表单更新 /// </summary> /// <param name="repairUpdateViewModel"></param> /// <returns></returns> public int Repair_Update(RepairUpdateViewModel repairUpdateViewModel) { var repair_Info = _IRepairInfoRepository.GetInfoByRepairId(repairUpdateViewModel.id); var repair_Info_update = _IMapper.Map <RepairUpdateViewModel, Repair_Info>(repairUpdateViewModel, repair_Info); _IRepairInfoRepository.Update(repair_Info_update); return(_IRepairInfoRepository.SaveChanges()); }
public ActionResult <RepairUpdateResModel> Manage_Bus_Update(RepairUpdateViewModel repairUpdateViewModel) { RepairUpdateResModel repairUpdateResModel = new RepairUpdateResModel(); int UpdateRowNum = _IRepairService.Repair_Update(repairUpdateViewModel); if (UpdateRowNum > 0) { repairUpdateResModel.IsSuccess = true; repairUpdateResModel.AddCount = UpdateRowNum; repairUpdateResModel.baseViewModel.Message = "更新成功"; repairUpdateResModel.baseViewModel.ResponseCode = 200; _ILogger.Information("更新报修信息成功"); return(Ok(repairUpdateResModel)); } else { repairUpdateResModel.IsSuccess = false; repairUpdateResModel.AddCount = 0; repairUpdateResModel.baseViewModel.Message = "更新失败"; repairUpdateResModel.baseViewModel.ResponseCode = 400; _ILogger.Information("更新报修信息失败"); return(BadRequest(repairUpdateResModel)); } }