예제 #1
0
        private void SubmitTheMovie(int category)
        {
            Movy movie = new Movy
            {
                Category    = category + 1,
                Title       = textBoxTitle.Text,
                Cast        = textBoxCast.Text,
                Director    = textBoxDirector.Text,
                Year        = Convert.ToInt32(dateTimePickerYear.Text),
                Country     = textBoxCountry.Text,
                Description = textBoxDescr.Text,
                UserId      = CurrentUser.UserId
            };

            ControllerMovie ctrlMovie = new ControllerMovie();

            ctrlMovie.AddMovie(movie);

            DialogResult result =
                MessageBox.Show("Movie successfully added to the catalogue! \n Do you want to exit?", "Successfull operation!",
                                MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);

            if (result == DialogResult.Yes)
            {
                this.Close();
            }
        }
예제 #2
0
        private void ManageMovies_Activated(object sender, EventArgs e)
        {
            listView1.Items.Clear();
            ControllerMovie ctrlMovie = new ControllerMovie();

            ctrlMovie.LoadMoviesToListView(listView1);
        }
예제 #3
0
        private void EditDelMovie_Load(object sender, EventArgs e)
        {
            ControllerMovie ctrlMovie = new ControllerMovie();

            ctrlMovie.LoadMoviesToListView(listView1);
            comboBox1.Items.AddRange(ControllerCategory.LoadAllCategories());
        }
예제 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            Movy movie = new Movy
            {
                Category    = comboBoxCategory.SelectedIndex,
                Title       = textBoxTitle.Text,
                Cast        = textBoxCast.Text,
                Director    = textBoxDirector.Text,
                Year        = Convert.ToInt32(dateTimePickerYear.Text),
                Country     = textBoxCountry.Text,
                Description = textBoxDescr.Text,
                Id          = id
            };

            ControllerMovie ctrlMovie = new ControllerMovie();

            ctrlMovie.EditMovie(movie);

            DialogResult result =
                MessageBox.Show("Movie successfully edited! \n Do you want to exit?", "Successfull operation!",
                                MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);

            if (result == DialogResult.Yes)
            {
                this.Close();
            }
        }
예제 #5
0
파일: Main.cs 프로젝트: hoseto1/fmiedd
        private void Main_Activated(object sender, EventArgs e)
        {
            listView1.Items.Clear();
            comboBox1.Items.Clear();
            ControllerMovie ctrlMovie = new ControllerMovie();

            ctrlMovie.LoadMoviesToListView(listView1);
            comboBox1.Items.AddRange(ControllerCategory.LoadAllCategories());
        }
예제 #6
0
        private void ShowMovie_Load(object sender, EventArgs e)
        {
            ControllerMovie ctrlMovie = new ControllerMovie();
            ModelMovie      movie     = ctrlMovie.GetOneMovie(ModelMovie.MovieID);

            labelMovieTitleValue.Text = movie.Title;
            labelDirectorValue.Text   = movie.Director;
            labelCastValue.Text       = movie.Cast;
            labelCountryValue.Text    = movie.Country;
            labelYearValue.Text       = movie.Year.ToString();
            labelDescrValue.Text      = movie.Description;
        }
예제 #7
0
 private void button5_Click(object sender, EventArgs e)
 {
     try
     {
         ControllerMovie ctrlMovie = new ControllerMovie();
         ctrlMovie.DeleteMovie(Convert.ToInt32(listView1.SelectedItems[0].Text));
         ManageMovies_Activated(sender, e);
     }
     catch (Exception)
     {
         MessageBox.Show("No items are selected!");
     }
 }
예제 #8
0
        private void EditMovies_Load(object sender, EventArgs e)
        {
            comboBoxCategory.Items.AddRange(ControllerCategory.LoadAllCategories());
            ControllerMovie ctrlMovie = new ControllerMovie();

            movie = ctrlMovie.GetOneMovie(id);

            textBoxTitle.Text = movie.Title;
            comboBoxCategory.SelectedIndex = Convert.ToInt32(movie.Category) - 1;
            textBoxDirector.Text           = movie.Director;
            textBoxCast.Text         = movie.Cast;
            textBoxCountry.Text      = movie.Country;
            dateTimePickerYear.Value = new DateTime(movie.Year, 1, 1);
            textBoxDescr.Text        = movie.Description;
        }