private void GetAllOperation() { int page = 0; while (true) { switch (view.entity) { case Entity.Room: List <Room> r_table = roomDAO.GetAll(page); view.PrintTable(view.Rooms_table(r_table)); break; case Entity.Guest: List <Guest> g_table = guestDAO.GetAll(page); view.PrintTable(view.Guests_table(g_table)); break; case Entity.Booking: List <Booking> b_table = bookingDAO.GetAll(page); view.PrintTable(view.Booking_table(b_table)); break; } int arr = view.Page(); if (arr == 0) { break; } else { page += arr; } if (page < 0) { page = 0; } } view.Success(); }
private void GetListOperation() { int page = 0; while (true) { switch (view.entity) { case Entity.Movie: List <Movie> movies = movieDAO.GetList(page); view.PrintMovies(movies); break; case Entity.Seance: List <Seance> seances = seanceDAO.GetList(page); view.PrintSeances(seances); break; case Entity.Ticket: List <Ticket> tickets = ticketDAO.GetList(page); view.PrintTicket(tickets); break; } int arrow = view.Page(); if (arrow == 0) { break; } else { page += arrow; } if (page < 0) { page = 0; } } }