Ejemplo n.º 1
0
        private void EditDelMovie_Load(object sender, EventArgs e)
        {
            ControllerMovie ctrlMovie = new ControllerMovie();

            ctrlMovie.LoadMoviesToListView(listView1);
            comboBox1.Items.AddRange(ControllerCategory.LoadAllCategories());
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            var controls = new[]
            {
                textBoxCast,
                textBoxCountry,
                textBoxDescr,
                textBoxDirector,
                textBoxNewCat,
                textBoxTitle
            };

            foreach (var item in controls)
            {
                if (string.IsNullOrWhiteSpace(item.Text))
                {
                    MessageBox.Show("Empty entries not allowed!", "Warining!",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    item.Focus();
                    return;
                }
            }

            int category;

            if (checkBox1.Checked == true)
            {
                ctrCat = new ControllerCategory(new Category {
                    CategoryName = textBoxNewCat.Text
                });
                category = ctrCat.InsertNewCategory();

                if (category == 0)
                {
                    MessageBox.Show("This category already exist!", "Warining!",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
            }
            else
            {
                category = comboBoxCategory.SelectedIndex;
                ctrCat   = new ControllerCategory(new Category {
                    CategoryName = comboBoxCategory.SelectedText
                });
            }

            SubmitTheMovie(category);
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
0
 private void AddMovies_Load(object sender, EventArgs e)
 {
     comboBoxCategory.Items.AddRange(ControllerCategory.LoadAllCategories());
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Determines whether this body ignores the the specified controller.
 /// </summary>
 /// <param name="category">The logic type.</param>
 /// <returns>
 ///     <c>true</c> if the body has the specified flag; otherwise, <c>false</c>.
 /// </returns>
 public bool IsControllerIgnored(ControllerCategory category)
 {
     return((ControllerCategories & category) != category);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Restore the controller. The controller affects this body.
 /// </summary>
 /// <param name="category">The logic type.</param>
 public void RestoreController(ControllerCategory category)
 {
     ControllerCategories |= category;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Ignores the controller. The controller has no effect on this body.
 /// </summary>
 /// <param name="type">The logic type.</param>
 public void IgnoreController(ControllerCategory category)
 {
     ControllerCategories &= ~category;
 }
Ejemplo n.º 9
0
 public ControllerFilter(ControllerCategory controllerCategory)
 {
     this.ControllerCategories = controllerCategory;
 }
Ejemplo n.º 10
0
 public Controller(ControllerType type, ControllerCategory category)
 {
     this.type     = type;
     this.category = category;
 }