/// <summary> /// 更改会议室信息 /// </summary> /// <param name="BookUpdateViewModel"></param> /// <returns></returns> public int Room_Update(RoomInformationUpdateViewModel roomInformationUpdateViewModel) { var room_information = _IRoomInformationRepository.GetInfoByRoomid(roomInformationUpdateViewModel.Id); var room_Information_Result = _IMapper.Map <RoomInformationUpdateViewModel, MeetingRoom_Information>(roomInformationUpdateViewModel, room_information); room_Information_Result.UpdateDate = DateTime.Now; _IRoomInformationRepository.Update(room_Information_Result); return(_IRoomInformationRepository.SaveChanges()); }
public ActionResult <RoomInformationUpdateResModel> Manage_Room_Update(RoomInformationUpdateViewModel roomInformationUpdateViewModel) { RoomInformationUpdateResModel roomInformationUpdateResModel = new RoomInformationUpdateResModel(); int UpdateRowNum = _RoomInformationService.Room_Update(roomInformationUpdateViewModel); if (UpdateRowNum > 0) { roomInformationUpdateResModel.IsSuccess = true; roomInformationUpdateResModel.AddCount = UpdateRowNum; roomInformationUpdateResModel.baseViewModel.Message = "更新成功"; roomInformationUpdateResModel.baseViewModel.ResponseCode = 200; _ILogger.Information("更新会议室信息,更新成功"); return(Ok(roomInformationUpdateResModel)); } else { roomInformationUpdateResModel.IsSuccess = false; roomInformationUpdateResModel.AddCount = 0; roomInformationUpdateResModel.baseViewModel.Message = "更新失败"; roomInformationUpdateResModel.baseViewModel.ResponseCode = 400; _ILogger.Information("更新会议室信息,更新失败"); return(Ok(roomInformationUpdateResModel)); } }