Exemple #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;
            }
        }
Exemple #2
0
        public void DeleteMovie(MovieVM movieVM)
        {
            CinemaMovieShowBooking deleteMovie = new CinemaMovieShowBooking {
                MovieTitle = movieVM.Title, MovieGenre = movieVM.Genre, MovieDuration = movieVM.Duration, MovieDirector = movieVM.Director, MovieReleaseDate = movieVM.ReleaseDate
            };

            try
            {
                repo.Delete(deleteMovie);
                Movies.Remove(movieVM);
                RefreshVMs();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #3
0
        public void DeleteShow(ShowVM showVM)
        {
            CinemaMovieShowBooking deleteShow = new CinemaMovieShowBooking {
                ShowDateTime = showVM.ShowDateTime
            };

            try
            {
                repo.Delete(deleteShow);
                Shows.Remove(showVM);
                RefreshVMs();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #4
0
        public void DeleteCinema(CinemaVM cinemaVM)
        {
            CinemaMovieShowBooking deleteCinema = new CinemaMovieShowBooking {
                CinemaName = cinemaVM.Cinema, CinemaTown = cinemaVM.Town
            };

            try
            {
                repo.Delete(deleteCinema);
                Cinemas.Remove(cinemaVM);
                RefreshVMs();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #5
0
        public void AddMovie(string movieTitle, string movieGenre, int movieDuration, string movieDirector, DateTime movieReleaseDate)
        {
            try
            {
                CinemaMovieShowBooking movie = new CinemaMovieShowBooking {
                    MovieTitle = movieTitle, MovieGenre = movieGenre, MovieDuration = movieDuration, MovieDirector = movieDirector, MovieReleaseDate = movieReleaseDate
                };
                if (LockedCinema != null)
                {
                    movie.CinemaName = LockedCinema.Cinema;
                    movie.CinemaTown = LockedCinema.Town;
                }
                if (LockedShow != null)
                {
                    movie.ShowDateTime = LockedShow.ShowDateTime;
                }
                if (LockedBooking != null)
                {
                    movie.BookingMail  = LockedBooking.BookingMail;
                    movie.BookingPhone = LockedBooking.BookingPhone;
                }

                repo.Add(movie);

                MovieVM movieVM = new MovieVM
                {
                    Title       = movieTitle,
                    Genre       = movieGenre,
                    Duration    = movieDuration,
                    Director    = movieDirector,
                    ReleaseDate = movieReleaseDate,
                    Locked      = false
                };
                Movies.Add(movieVM);

                SelectedMovie = movieVM;
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #6
0
        public void AddShow(DateTime showDateTime)
        {
            try
            {
                CinemaMovieShowBooking show = new CinemaMovieShowBooking {
                    ShowDateTime = showDateTime
                };
                if (LockedCinema != null)
                {
                    show.CinemaName = LockedCinema.Cinema;
                    show.CinemaTown = LockedCinema.Town;
                }
                if (LockedMovie != null)
                {
                    show.MovieTitle       = LockedMovie.Title;
                    show.MovieGenre       = LockedMovie.Genre;
                    show.MovieDuration    = LockedMovie.Duration;
                    show.MovieDirector    = LockedMovie.Director;
                    show.MovieReleaseDate = LockedMovie.ReleaseDate;
                }
                if (LockedBooking != null)
                {
                    show.BookingMail  = LockedBooking.BookingMail;
                    show.BookingPhone = LockedBooking.BookingPhone;
                }

                repo.Add(show);

                ShowVM showVM = new ShowVM {
                    ShowDateTime = showDateTime, Locked = false
                };
                Shows.Add(showVM);

                SelectedShow = showVM;
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #7
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;
            }
        }
Exemple #8
0
        public void UpdateShow(ShowVM showVM, DateTime newShowDateTime)
        {
            CinemaMovieShowBooking fromShow = new CinemaMovieShowBooking {
                ShowDateTime = showVM.ShowDateTime
            };
            CinemaMovieShowBooking toShow = new CinemaMovieShowBooking {
                ShowDateTime = newShowDateTime
            };

            try
            {
                repo.Update(fromShow, toShow);

                showVM.ShowDateTime = newShowDateTime;

                RefreshVMs();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #9
0
        public void AddCinema(string cinemaName, string cinemaTown)
        {
            try
            {
                CinemaMovieShowBooking cinema = new CinemaMovieShowBooking {
                    CinemaName = cinemaName, CinemaTown = cinemaTown
                };
                if (LockedMovie != null)
                {
                    cinema.MovieTitle       = LockedMovie.Title;
                    cinema.MovieGenre       = LockedMovie.Genre;
                    cinema.MovieDuration    = LockedMovie.Duration;
                    cinema.MovieDirector    = LockedMovie.Director;
                    cinema.MovieReleaseDate = LockedMovie.ReleaseDate;
                }
                if (SelectedShow != null)
                {
                    cinema.ShowDateTime = SelectedShow.ShowDateTime;
                }
                if (SelectedBooking != null)
                {
                    cinema.BookingMail  = SelectedBooking.BookingMail;
                    cinema.BookingPhone = SelectedBooking.BookingPhone;
                }

                repo.Add(cinema);

                CinemaVM cinemaVM = new CinemaVM {
                    Cinema = cinemaName, Town = cinemaTown, Locked = false
                };
                Cinemas.Add(cinemaVM);

                SelectedCinema = cinemaVM;
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #10
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;
            }
        }
Exemple #11
0
        public void UpdateCinema(CinemaVM cinemaVM, string newCinemaName, string newCinemaTown)
        {
            CinemaMovieShowBooking fromCinema = new CinemaMovieShowBooking {
                CinemaName = cinemaVM.Cinema, CinemaTown = cinemaVM.Town
            };
            CinemaMovieShowBooking toCinema = new CinemaMovieShowBooking {
                CinemaName = newCinemaName, CinemaTown = newCinemaTown
            };

            try
            {
                repo.Update(fromCinema, toCinema);

                cinemaVM.Cinema = newCinemaName;
                cinemaVM.Town   = newCinemaTown;

                RefreshVMs();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #12
0
        public void UpdateMovie(MovieVM movieVM, string newMovieTitle, string newMovieGenre, int newMovieDuration, string newMovieDirector, DateTime newMovieReleaseDate)
        {
            CinemaMovieShowBooking fromMovie = new CinemaMovieShowBooking
            {
                MovieTitle       = movieVM.Title,
                MovieGenre       = movieVM.Genre,
                MovieDuration    = movieVM.Duration,
                MovieDirector    = movieVM.Director,
                MovieReleaseDate = movieVM.ReleaseDate
            };
            CinemaMovieShowBooking toMovie = new CinemaMovieShowBooking
            {
                MovieTitle       = newMovieTitle,
                MovieGenre       = newMovieGenre,
                MovieDuration    = newMovieDuration,
                MovieDirector    = newMovieDirector,
                MovieReleaseDate = newMovieReleaseDate
            };

            try
            {
                repo.Update(fromMovie, toMovie);

                movieVM.Title       = newMovieTitle;
                movieVM.Genre       = newMovieGenre;
                movieVM.Duration    = newMovieDuration;
                movieVM.Director    = newMovieDirector;
                movieVM.ReleaseDate = newMovieReleaseDate;

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