示例#1
0
 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();
     }
 }
示例#2
0
 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();
     }
 }
示例#3
0
 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();
     }
 }
示例#4
0
 public void ReadRoomStatus()
 {
     ConsoleRoomStatusPresenter.Present(roomStatusService.ReadRoomStatuses());
 }