public RoomStatusViewModel UpdateRoomStatus(int id, RoomStatusViewModel model) { var roomStatuModel = mapper.Map <RoomStatus>(model); var roomStatus = roomStatusRepository.UpdateRoomStatus(id, roomStatuModel); return(mapper.Map <RoomStatusViewModel>(roomStatus)); }
public void UpdateteRoomStatus() { try { var roomStatus = new RoomStatus(); Console.WriteLine("Print Id: "); int id = Int32.Parse(Console.ReadLine()); Console.WriteLine("Print Status: "); roomStatus.Status = Console.ReadLine(); if (!Validation.IsNullOrEmpty(roomStatus.Status) || !Validation.ValidateString(roomStatus.Status)) { UpdateteRoomStatus(); } roomStatusService.UpdateRoomStatus(id, roomStatus); Console.WriteLine("Object successful updated"); ConsoleRoomStatusPresenter.Present(roomStatusService.ReadRoomStatuses()); } catch (Exception ex) { Console.WriteLine(ex.Message); UpdateteRoomStatus(); } }