コード例 #1
0
 public void DeleteRoomType()
 {
     try
     {
         Console.WriteLine("Print Id: ");
         int id = Int32.Parse(Console.ReadLine());
         roomTypeService.DeleteRoomType(id);
         Console.WriteLine("Object successful updated");
         ConsoleRoomTypePresenter.Present(roomTypeService.ReadRoomTypes());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         DeleteRoomType();
     }
 }
コード例 #2
0
 public void AddRoomType()
 {
     try
     {
         var roomType = new RoomType();
         Console.WriteLine("Print Status: ");
         roomType.Type = Console.ReadLine();
         if (!Validation.IsNullOrEmpty(roomType.Type) || !Validation.ValidateString(roomType.Type))
         {
             AddRoomType();
         }
         roomTypeService.AddRoomType(roomType);
         Console.WriteLine("Object successful added");
         ConsoleRoomTypePresenter.Present(roomTypeService.ReadRoomTypes());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         AddRoomType();
     }
 }
コード例 #3
0
 public void UpdateRoomType()
 {
     try
     {
         var roomType = new RoomType();
         Console.WriteLine("Print Id: ");
         int id = Int32.Parse(Console.ReadLine());
         Console.WriteLine("Print Type: ");
         roomType.Type = Console.ReadLine();
         if (!Validation.IsNullOrEmpty(roomType.Type) || !Validation.ValidateString(roomType.Type))
         {
             UpdateRoomType();
         }
         roomTypeService.UpdateRoomType(id, roomType);
         Console.WriteLine("Object successful updated");
         ConsoleRoomTypePresenter.Present(roomTypeService.ReadRoomTypes());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         UpdateRoomType();
     }
 }
コード例 #4
0
 public void ReadRoomType()
 {
     ConsoleRoomTypePresenter.Present(roomTypeService.ReadRoomTypes());
 }