예제 #1
0
        private void FormMovie_Load(object sender, EventArgs e)
        {
            ProgressBar pro = (ProgressBar)this.Tag;

            this.WindowState = FormWindowState.Maximized;
            this.Text        = _Movie.Name;

            rchbxRate.Text        = _Movie.Rate.ToString();
            rchbxDescription.Text = _Movie.Description;
            rchbxDate.Text        = _Movie.Date.ToString();
            pro.Value             = 30;

            rchbxMyRate.Text = DbMethods.DbFindMyRate(_Movie);


            if (_Movie.Poster != "")
            {
                pbxPoster.Load(_Movie.Poster);
            }
            else
            {
                pbxPoster.Load("https://us.123rf.com/450wm/pavelstasevich/pavelstasevich1811/pavelstasevich181101065/112815953-stock-vector-no-image-available-icon-flat-vector.jpg?ver=6");
            }

            _Movie.FindCast();
            pro.Value = 40;

            int incrementCast = Convert.ToInt32(50 / _Movie.Casts.Count);
            int incrementRole;

            foreach (Cast cast in _Movie.Casts)
            {
                incrementRole = Convert.ToInt32(incrementCast / cast.Roles.Count);

                foreach (String role in cast.Roles)
                {
                    rchbxRole.Text += role + ",";
                    pro.Value      += incrementRole;
                }
                rchbxRole.Text += "\n";
                lstbxCast.Items.Add(cast);
            }
            List <Genre> genres = DbMethods.DbFindMovieGenre(_Movie.MovieId);

            if (genres.Count == 0)
            {
                _Movie.FindGenre();
                genres = _Movie.Genres;
            }
            pro.Value = 100;
            foreach (Genre genre in genres)
            {
                DbMethods.DbHasGenre(genre);
                lstbxGenre.Items.Add(genre);
            }
        }
예제 #2
0
        private void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProgressBar pro = (ProgressBar)this.Tag;

            pro.Value = 5;
            Movie movie = (Movie)listBox1.SelectedItem;

            DbMethods.DbHasMovie(movie);
            pro.Value = 20;
            FormMovie form = new FormMovie();

            form.MdiParent = this.MdiParent;
            form._Movie    = movie;
            form.Tag       = pro;
            form.Show();
        }
예제 #3
0
        private void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Movie       movie = (Movie)lstbxGenreMovies.SelectedItem;
            ProgressBar pro   = (ProgressBar)this.Tag;

            pro.Value = 5;
            DbMethods.DbHasMovie(movie);
            pro.Value = 15;
            FormMovie form = new FormMovie();

            form.MdiParent   = this.MdiParent;
            form.WindowState = FormWindowState.Maximized;
            form._Movie      = movie;
            pro.Value        = 20;
            form.Tag         = pro;
            form.Show();
        }
예제 #4
0
        private void LstbxGenre_SelectedIndexChanged(object sender, EventArgs e)
        {
            (this.Tag as ProgressBar).Value = 5;
            Genre genre = (Genre)lstbxGenre.SelectedItem;
            int   id    = DbMethods.DbHasGenre(genre);

            (this.Tag as ProgressBar).Value = 15;
            DbMethods.DbHasMovieGenre(_Movie.MovieId, id);
            (this.Tag as ProgressBar).Value = 30;
            FormGenre form = new FormGenre();

            form.MdiParent   = this.MdiParent;
            form.Tag         = this.Tag;
            form._Genre      = genre;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }
        private void FormWatch_Load(object sender, EventArgs e)
        {
            (this.Tag as ProgressBar).Value = 40;
            List <Movie> list = DbMethods.DbFindMovieWatch(1);

            foreach (Movie movie in list)
            {
                lstbxWatched.Items.Add(movie);
            }

            (this.Tag as ProgressBar).Value = 70;
            list = DbMethods.DbFindMovieWatch(0);

            foreach (Movie movie in list)
            {
                lstbxWatch.Items.Add(movie);
            }
            (this.Tag as ProgressBar).Value = 100;
        }
예제 #6
0
        private void LstbxCast_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProgressBar pro = (ProgressBar)this.Tag;

            pro.Value = 5;
            Cast cast = (Cast)lstbxCast.SelectedItem;

            DbMethods.DbHasPerson(cast);
            pro.Value = 15;
            foreach (String role in cast.Roles)
            {
                int id = DbMethods.DbHasRole(role);  //yeni role varsa db ye ekler
                DbMethods.DbHasMoviePerson(_Movie.MovieId, cast.CastId, id);
            }
            pro.Value = 35;
            FormCast form = new FormCast();

            form.MdiParent = this.MdiParent;
            form._Cast     = cast;
            form.Tag       = pro;
            form.Show();
        }
예제 #7
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            int status;

            if (checkbxWatched.Checked)
            {
                status = 1;
            }
            else
            {
                status = 0;
            }
            if (rchbxMyRate.Text != "")
            {
                DbMethods.DbHasMovieWatch(_Movie, status, Convert.ToDouble(rchbxMyRate.Text));
                MessageBox.Show("Kayıtlar güncenlendi");
            }
            else
            {
                DbMethods.DbHasMovieWatch(_Movie, status, Convert.ToDouble(0));
                MessageBox.Show("Kayıtlar güncenlendi");
            }
        }
예제 #8
0
        private void FormUser_Load(object sender, EventArgs e)
        {
            (this.Tag as ProgressBar).Value = 10;
            if (_Movie != null)
            {
                DbMethods.DbHasMovieImage(_Movie);

                (this.Tag as ProgressBar).Value = 25;

                for (int i = 0; i < _Movie.Pictures.Count; i++)
                {
                    if (i == 0)
                    {
                        pictureBox1.Load(_Movie.Pictures[i].ImageUrl);
                        pictureBox1.Visible              = true;
                        richTextBox1.Text                = _Movie.Pictures[i].ImageName;
                        richTextBox1.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 1)
                    {
                        pictureBox2.Load(_Movie.Pictures[i].ImageUrl);
                        pictureBox2.Visible              = true;
                        richTextBox2.Text                = _Movie.Pictures[i].ImageName;
                        richTextBox2.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 2)
                    {
                        pictureBox3.Load(_Movie.Pictures[i].ImageUrl);
                        pictureBox3.Visible              = true;
                        richTextBox3.Text                = _Movie.Pictures[i].ImageName;
                        richTextBox3.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 3)
                    {
                        pictureBox4.Load(_Movie.Pictures[i].ImageUrl);
                        pictureBox4.Visible              = true;
                        richTextBox4.Text                = _Movie.Pictures[i].ImageName;
                        richTextBox4.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 4)
                    {
                        pictureBox5.Load(_Movie.Pictures[i].ImageUrl);
                        pictureBox5.Visible              = true;
                        richTextBox5.Text                = _Movie.Pictures[i].ImageName;
                        richTextBox5.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 5)
                    {
                        pictureBox6.Load(_Movie.Pictures[i].ImageUrl);
                        pictureBox6.Visible              = true;
                        richTextBox6.Text                = _Movie.Pictures[i].ImageName;
                        richTextBox6.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                }
            }
            else
            {
                DbMethods.DbHasPersonImage(_Cast);

                (this.Tag as ProgressBar).Value = 25;

                for (int i = 0; i < _Cast.Pictures.Count; i++)
                {
                    if (i == 0)
                    {
                        pictureBox1.Load(_Cast.Pictures[i].ImageUrl);
                        pictureBox1.Visible = true;

                        richTextBox1.Text                = _Cast.Pictures[i].ImageName;
                        richTextBox1.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 1)
                    {
                        pictureBox2.Load(_Cast.Pictures[i].ImageUrl);
                        pictureBox2.Visible              = true;
                        richTextBox2.Text                = _Cast.Pictures[i].ImageName;
                        richTextBox2.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 2)
                    {
                        pictureBox3.Load(_Cast.Pictures[i].ImageUrl);
                        pictureBox3.Visible              = true;
                        richTextBox3.Text                = _Cast.Pictures[i].ImageName;
                        richTextBox3.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 3)
                    {
                        pictureBox4.Load(_Cast.Pictures[i].ImageUrl);
                        pictureBox4.Visible              = true;
                        richTextBox4.Text                = _Cast.Pictures[i].ImageName;
                        richTextBox4.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 4)
                    {
                        pictureBox5.Load(_Cast.Pictures[i].ImageUrl);
                        pictureBox5.Visible              = true;
                        richTextBox5.Text                = _Cast.Pictures[i].ImageName;
                        richTextBox5.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                    else if (i == 5)
                    {
                        pictureBox6.Load(_Cast.Pictures[i].ImageUrl);
                        pictureBox6.Visible              = true;
                        richTextBox6.Text                = _Cast.Pictures[i].ImageName;
                        richTextBox6.Visible             = true;
                        (this.Tag as ProgressBar).Value += 10;
                    }
                }
            }
            (this.Tag as ProgressBar).Value = 100;
        }