Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
            }
        }