private void EditDelMovie_Load(object sender, EventArgs e) { ControllerMovie ctrlMovie = new ControllerMovie(); ctrlMovie.LoadMoviesToListView(listView1); comboBox1.Items.AddRange(ControllerCategory.LoadAllCategories()); }
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()); }
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); }
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; }
private void AddMovies_Load(object sender, EventArgs e) { comboBoxCategory.Items.AddRange(ControllerCategory.LoadAllCategories()); }
/// <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); }
/// <summary> /// Restore the controller. The controller affects this body. /// </summary> /// <param name="category">The logic type.</param> public void RestoreController(ControllerCategory category) { ControllerCategories |= category; }
/// <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; }
public ControllerFilter(ControllerCategory controllerCategory) { this.ControllerCategories = controllerCategory; }
public Controller(ControllerType type, ControllerCategory category) { this.type = type; this.category = category; }