private void buttonAdd_Click(object sender, EventArgs e) { if (textBoxTitle.Text == "" || textBoxDirector.Text == "" || comboBoxCategory.SelectedIndex == -1 || comboBoxGenre.SelectedIndex == -1) { MessageBox.Show("Complete data"); } else { string description = ""; if (textBoxDescription.Text != null) { description = textBoxDescription.Text; } moviesService.AddMovie(textBoxTitle.Text, textBoxDirector.Text, dateTimePickerRelease.Value.ToString("yyyy-MM-dd"), Int32.Parse(comboBoxGenre.SelectedValue.ToString()), Int32.Parse(comboBoxCategory.SelectedItem.ToString()), Int32.Parse(numericUpDownDuration.Value.ToString()), description); MessageBox.Show("Movie added to database"); ClearInput(); moviesService.GetMovies(dataGridViewMovies); } }