public void DeleteRoomStatus() { try { Console.WriteLine("Print Id: "); int id = Int32.Parse(Console.ReadLine()); roomStatusService.DeleteRoomStatus(id); Console.WriteLine("Object successful deleted"); ConsoleRoomStatusPresenter.Present(roomStatusService.ReadRoomStatuses()); } catch (Exception ex) { Console.WriteLine(ex.Message); DeleteRoomStatus(); } }
public void AddRoomStatus() { try { var roomStatus = new RoomStatus(); Console.WriteLine("Print Status: "); roomStatus.Status = Console.ReadLine(); if (!Validation.IsNullOrEmpty(roomStatus.Status) || !Validation.ValidateString(roomStatus.Status)) { AddRoomStatus(); } roomStatusService.AddRoomStatus(roomStatus); Console.WriteLine("Object successful added"); ConsoleRoomStatusPresenter.Present(roomStatusService.ReadRoomStatuses()); } catch (Exception ex) { Console.WriteLine(ex.Message); AddRoomStatus(); } }
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(); } }
public void ReadRoomStatus() { ConsoleRoomStatusPresenter.Present(roomStatusService.ReadRoomStatuses()); }