Ejemplo n.º 1
0
 public void UpdateteRoom()
 {
     try
     {
         Room room = new Room();
         Console.WriteLine("Print Id: ");
         int id = Int32.Parse(Console.ReadLine());
         Console.WriteLine("Print RoomTypeId: ");
         room.RoomTypeId = Int32.Parse(Console.ReadLine());
         Console.WriteLine("Print RoomStatusId: ");
         room.RoomStatusId = Int32.Parse(Console.ReadLine());
         Console.WriteLine("Print RoomNumber: ");
         room.RoomNumber = Int32.Parse(Console.ReadLine());
         Console.WriteLine("Print MaxPerson: ");
         room.MaxPerson = Int32.Parse(Console.ReadLine());
         roomService.UpdateRoom(id, room);
         Console.WriteLine("Object successful updated");
         ConsoleRoomPresenter.Present(roomService.ReadRooms());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         UpdateteRoom();
     }
 }
Ejemplo n.º 2
0
 public void DeleteRoom()
 {
     try
     {
         Console.WriteLine("Print Id: ");
         int id = Int32.Parse(Console.ReadLine());
         roomService.DeleteRoom(id);
         Console.WriteLine("Object successful deleted");
         ConsoleRoomPresenter.Present(roomService.ReadRooms());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         DeleteRoom();
     }
 }
Ejemplo n.º 3
0
 public void ReadRoom()
 {
     ConsoleRoomPresenter.Present(roomService.ReadRooms());
 }