示例#1
0
        public MoviesList(VideoStoreEntities videoStore, MovieView.GetID getIDHandler)
        {
            this._videoStore   = videoStore;
            this._getIDHandler = getIDHandler;

            InitializeComponent();

            genresComboBox.ItemsSource   = _videoStore.Genres.Select(s => s.GenreName).ToList();
            countiesComboBox.ItemsSource = _videoStore.Movies.Select(s => s.Country).Distinct().ToList();

            sorting = new Sorting(_videoStore.Movies.Count(), 10, "none", "none");

            var movies = _videoStore.Movies.OrderBy(order => order.FilmID).Take(sorting.PageSize).ToList();

            prevButton.IsEnabled = false;
            nextButton.IsEnabled = true;
            pageTextBox.Text     = sorting.CurrentPage.ToString();

            for (int i = 0; i < movies.Count; i++)
            {
                moviesList.Items.Add(new MovieListItem(movies[i].FilmID,
                                                       movies[i].FilmName,
                                                       movies[i].ShortDescription,
                                                       movies[i].ReleaseYear,
                                                       movies[i].Genres.GenreName,
                                                       movies[i].Mark,
                                                       movies[i].Duration,
                                                       movies[i].FilmImage));
            }
        }
示例#2
0
        public LibraryMovieDescription(int id, VideoStoreEntities videoStore)
        {
            InitializeComponent();

            _videoStore = videoStore;

            movieModel = _videoStore.Movies.Where(i => i.FilmID == id).Select(s => new MovieModel
            {
                MovieID     = s.FilmID,
                MovieName   = s.FilmName,
                Description = s.Description,
                ReleaseYear = s.ReleaseYear,
                Director    = s.Director,
                Actors      = s.Actors,
                Producers   = s.Producers,
                Country     = s.Country,
                GenreName   = s.Genres.GenreName,
                Duration    = s.Duration,
                Mark        = s.Mark,
                MovieImage  = s.FilmImage,
                Price       = s.MoviePrice
            }).FirstOrDefault();

            movieImage.Source          = new BitmapImage(new Uri(movieModel.MovieImage));
            movieNameTextBox.Text      = movieModel.MovieName;
            descriptionTextBox.Text    = movieModel.Description;
            releaseYearTextBlock.Text += $" {movieModel.ReleaseYear}";
            directorTextBlock.Text    += $" {movieModel.Director}";
            actorsTextBlock.Text      += $"{movieModel.Actors}";
            producersTextBlock.Text   += $"{movieModel.Producers}";
            countryTextBlock.Text     += $" {movieModel.Country}";
            genreTextBlock.Text       += $" {movieModel.GenreName}";
            durationTextBlock.Text    += $" {movieModel.Duration}";
            markTextBlock.Text        += $" {movieModel.Mark}";
        }
        public LibraryList(VideoStoreEntities videoStore, LibraryView.GetID getIDHandler)
        {
            this._videoStore   = videoStore;
            this._getIDHandler = getIDHandler;

            InitializeComponent();

            genresComboBox.ItemsSource   = _videoStore.Genres.Select(s => s.GenreName).ToList();
            countiesComboBox.ItemsSource = _videoStore.Movies.Select(s => s.Country).Distinct().ToList();
        }
示例#4
0
        public LibraryView(VideoStoreEntities videoStore)
        {
            InitializeComponent();

            _videoStore = videoStore;
            Description_Button.Visibility = Visibility.Collapsed;

            getIDHandler += ShowDecription;

            libraryList = new LibraryList(_videoStore, getIDHandler);
            movieViewFrame.Navigate(libraryList);
        }
        public UserInfoPage(VideoStoreEntities videoStore)
        {
            InitializeComponent();

            this._videoStore = videoStore;

            textBoxDate.Text      = CurrentUser.RegisterDate.ToString();
            textBoxName.Text      = CurrentUser.UserName;
            textBoxSurname.Text   = CurrentUser.UserSurname;
            textBoxMidname.Text   = CurrentUser.UserMiddlename;
            textBoxCardNmber.Text = CurrentUser.CardNumber;
        }
示例#6
0
 public Store()
 {
     _videoStore  = new VideoStoreEntities();
     _mainOptions = new List <string>
     {
         "1) View the current videos in the store",
         "2) Add a new video to the store",
         "3) Purchase video(s)",
         "4) View item(s) in cart",
         "5) View previous orders",
         "6) Quit"
     };
     _customer = new StoreCustomer();
 }
示例#7
0
        public SubscriptionPage(VideoStoreEntities _videoStore)
        {
            InitializeComponent();

            this.videoStore = _videoStore;

            var subs = videoStore.Subscritions.ToList();

            subscriptionList.Items.Add(new SubscriptionListItem(0, "Бесплатная", "Подписка не предоставляет никаких дополнительных преимуществ, доступна всем пользователям", 0, 0));

            for (int i = 0; i < subs.Count; i++)
            {
                subscriptionList.Items.Add(new SubscriptionListItem(
                                               subs[i].SubscriptionID,
                                               subs[i].SubscriptionName,
                                               subs[i].SubDescription,
                                               subs[i].SubPeriodDays,
                                               subs[i].SubPrice));
            }

            CheckSubscription();

            AppUpdate.UpdateApp += CheckSubscription;
        }