private void UpdateOperation() { long id = -1; while (id < 0) { id = view.EnterId(); } if (id < 0) { throw new Exception("Wrong id"); } switch (view.entity) { case Entity.Movie: Movie m = view.MovieAddOrUpdateEnter(); m.Id = id; movieDAO.Update(m); break; case Entity.Seance: Seance s = view.SeanceAddOrUpdateEnter(movieDAO.GetList(), hallDAO.GetHalls()); s.Id = id; seanceDAO.Update(s); break; /*case Entity.Booking: * Booking booking = view.BookingAddOrUpdate(); * booking.Id = id; * bookingDAO.Update(booking); * break;*/ } }
private void UpdateOperation() { int id = -1; while (id < 0) { id = view.EnterId(); } if (id < 0) { throw new Exception("Wrong id"); } switch (view.entity) { case Entity.Movie: Movie m = view.MovieAddOrUpdateEnter(); m.Id = id; movieDAO.Update(m); break; case Entity.Seance: Seance s = view.SeanceAddOrUpdateEnter(movieDAO.GetList(), hallDAO.GetHalls()); s.Id = id; seanceDAO.Update(s); break; case Entity.Ticket: Ticket ticket = view.TicketAddOrUpdateGetSeance(seanceDAO.GetList()); ticket.Id = id; ticket = view.TicketAddOrUpdateGetSeat(hallDAO.GetSeatsInHall(ticket.Seance.HallId), ticket); ticketDAO.Update(ticket); break; } }