示例#1
0
        public InfoForm(int MID)//add Param for passed data
        {
            InitializeComponent();
            ConnectionClass con = new ConnectionClass();
            Movie           mov = con.GetMovieByID(MID);

            //titleOfMovie.Text = mov.Title;
            //movieGenre.Text = mov.Genre;
            //mainActor.Text = mov.Actors;
            //descriptionOfMovie.Text = mov.Plot;
            //ratingOfMovie.Text = mov.imdbRating + " " + mov.Rated;
            movieTitle.Text         = mov.Title;
            genreLabel.Text         = mov.Genre;
            descriptionOfMovie.Text = "Starring: " + mov.Actors.Replace(",", ", ").TrimEnd(',', ' ') + "\r\n\r\n\r\n" + mov.Plot;
            ratingsLabel.Text       = "Rated " + mov.Rated + "          IMDB Rating: " + mov.imdbRating + "/10";

            this.Text = mov.Title;  //Set form text to the  movie title
            focusScapegoat.Focus(); //Sets the focus on a hidden text box (for design purposes)

            buildServiceTable(con.GetServicesByID(MID));
        }
示例#2
0
        //loads movie data into dataGridView Data
        //parameter initial load specifies whether this is the inital load of the gridview
        private void loadMovieGrid()
        {
            ConnectionClass connect = new ConnectionClass();

            movieGrid = connect.loadMovieData();

            Data.DataSource = movieGrid;


            //hide certain columns if they exist
            if (Data.Columns.Contains("MID"))
            {
                Data.Columns["MID"].Visible = false;
            }

            if (Data.Columns.Contains("Plot"))
            {
                Data.Columns["Plot"].Visible = false;
            }

            Data.Update();
        }