private void AddParticipant_Load(object sender, EventArgs e) { textBox1.Text = first.FirstName; textBox2.Text = first.LastName; textBox3.Text = first.SurName; FilmsList five = FilmsList.SelectFilms(); comboBox1.DataSource = five; comboBox1.DisplayMember = "NameFilm"; comboBox1.ValueMember = "id"; if (five.Count == 0) { DialogResult da = MessageBox.Show("List Empty", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); if (da == DialogResult.OK) { this.Close(); } } Rating_FKList six = Rating_FKList.SelectRating_FK(); comboBox2.DataSource = six; comboBox2.DisplayMember = "Name_of_Rating"; comboBox2.ValueMember = "id"; if (five.Count == 0) { DialogResult da = MessageBox.Show("List Empty", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); if (da == DialogResult.OK) { this.Close(); } } }
private void Update_Flims_Click(object sender, EventArgs e) { Filmes = FilmsList.SelectFilms(); dataGridView1.DataSource = null; dataGridView1.DataSource = Filmes; dataGridView1.AutoResizeColumns(); }