Example #1
0
        public void DeleteBooking(BookingVM bookingVM)
        {
            CinemaMovieShowBooking deleteBooking = new CinemaMovieShowBooking {
                BookingMail = bookingVM.BookingMail, BookingPhone = bookingVM.BookingPhone
            };

            try
            {
                repo.Delete(deleteBooking);
                Bookings.Remove(bookingVM);
                RefreshVMs();
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        public void AddBooking(string bookingMail, string bookingPhone)
        {
            try
            {
                CinemaMovieShowBooking booking = new CinemaMovieShowBooking {
                    BookingMail = bookingMail, BookingPhone = bookingPhone
                };
                if (LockedCinema != null)
                {
                    booking.CinemaName = LockedCinema.Cinema;
                    booking.CinemaTown = LockedCinema.Town;
                }
                if (LockedMovie != null)
                {
                    booking.MovieTitle       = LockedMovie.Title;
                    booking.MovieGenre       = LockedMovie.Genre;
                    booking.MovieDuration    = LockedMovie.Duration;
                    booking.MovieDirector    = LockedMovie.Director;
                    booking.MovieReleaseDate = LockedMovie.ReleaseDate;
                }
                if (LockedShow != null)
                {
                    booking.ShowDateTime = LockedShow.ShowDateTime;
                }

                repo.Add(booking);

                BookingVM bookingVM = new BookingVM {
                    BookingMail = bookingMail, BookingPhone = bookingPhone, Locked = false
                };
                Bookings.Add(bookingVM);

                SelectedBooking = bookingVM;
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #3
0
        public void UpdateBooking(BookingVM bookingVM, string newBookingMail, string newBookingPhone)
        {
            CinemaMovieShowBooking fromBooking = new CinemaMovieShowBooking {
                BookingMail = bookingVM.BookingMail, BookingPhone = bookingVM.BookingPhone
            };
            CinemaMovieShowBooking toBooking = new CinemaMovieShowBooking {
                BookingMail = newBookingMail, BookingPhone = newBookingPhone
            };

            try
            {
                repo.Update(fromBooking, toBooking);

                bookingVM.BookingMail  = newBookingMail;
                bookingVM.BookingPhone = newBookingPhone;

                RefreshVMs();
            }
            catch (Exception)
            {
                throw;
            }
        }