/// <summary> /// 线路更新 /// </summary> /// <param name="lineUpdateViewModel"></param> /// <returns></returns> public int Line_Update(LineUpdateViewModel lineUpdateViewModel) { var Line_Info = _IBusLineRepository.GetInfoByLineId(lineUpdateViewModel.Id); var line_Info = _IMapper.Map <LineUpdateViewModel, Bus_Line>(lineUpdateViewModel, Line_Info); _IBusLineRepository.Update(line_Info); return(_IBusLineRepository.SaveChanges()); }
public ActionResult <LineUpdateResModel> Manage_Line_Update(LineUpdateViewModel lineUpdateViewModel) { LineUpdateResModel lineUpdateResModel = new LineUpdateResModel(); int UpdateRowNum = _lineService.Line_Update(lineUpdateViewModel); if (UpdateRowNum > 0) { lineUpdateResModel.IsSuccess = true; lineUpdateResModel.AddCount = UpdateRowNum; lineUpdateResModel.baseViewModel.Message = "更新成功"; lineUpdateResModel.baseViewModel.ResponseCode = 200; _ILogger.Information("更新线路信息成功"); return(Ok(lineUpdateResModel)); } else { lineUpdateResModel.IsSuccess = false; lineUpdateResModel.AddCount = 0; lineUpdateResModel.baseViewModel.Message = "更新失败"; lineUpdateResModel.baseViewModel.ResponseCode = 400; _ILogger.Information("更新线路信息失败"); return(Ok(lineUpdateResModel)); } }