Ejemplo n.º 1
0
        private bool EditMovie()
        {
            if ((MessageBox.Show("Add new Movie with current information?", "Confirm",
                                 MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                                 MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes))
            {
                try
                {
                    String title    = TitleBox.Text;
                    String genre    = GenreComboBox.Text;
                    int    copies   = int.Parse(CopyAmountBox.Text);
                    float  fees     = float.Parse(FeesBox.Text);
                    Movie  newMovie = new Movie(title, genre, fees, copies, copies, 0);
                    newMovie.Id = movie.Id;
                    DBEnvironment.Edit(newMovie);

                    Starred starred = new Starred(this.movieActors.ToArray(), deletedActors.ToArray(), newMovie);
                    DBEnvironment.Edit(starred);
                }
                catch (Exception e)
                {
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        public MovieViewForm(Movie selectedMovie, Customer CurrentUser, bool canRate, CustomerForm parent)

        {
            this.parent  = parent;
            this.canRate = canRate;
            movie        = selectedMovie;
            user         = CurrentUser;
            InitializeComponent();
            NameLabel.Text   = movie.Name;
            GenreLabel.Text  = movie.Genre;
            RatingLabel.Text = movie.Rating.ToString();
            CopyLabel.Text   = movie.Num_copies.ToString();
            BindingList <Actor> actors  = DBEnvironment.RetrieveActors();
            Starred             starred = new Starred(actors.ToArray(), null, movie);

            actorsInMovie       = DBEnvironment.GetStarred(movie);
            MovieCastLabel.Text = CreateStarredText();
            RatingSlider.Hide();
            RatingButton.Hide();
            if (!canRate)
            {
                return;
            }
            RatingSlider.Show();
            RatingButton.Show();
            RentButton.Hide();
        }
Ejemplo n.º 3
0
        private bool InsertActors(Movie movie)
        {
            Starred s = new Starred(movieActors.ToArray(), null, movie);

            if (!DBEnvironment.Add(s))
            {
                return(false);
            }

            return(true);
        }