예제 #1
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;
            }
        }
예제 #2
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;
            }
        }
예제 #3
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;
            }
        }