private void AddSubject_Click(object sender, EventArgs e) { var dialog = new NameDialog(); if (dialog.ShowDialog() == DialogResult.OK) { _viewController.NewSubject(dialog.Value); _ReInitComboBox(_viewController.SubjectsList, listSubjects); listSubjects.SelectedIndex = listSubjects.FindStringExact(dialog.Value); } }
private void AddTheme_Click(object sender, EventArgs e) { if (listSubjects.Items.Count < 1) { MessageBox.Show(@"Добавте сначала хотя бы один Предмет."); return; } var dialog = new NameDialog(); if (dialog.ShowDialog() == DialogResult.OK) { _viewController.NewTheme(listSubjects.Text, dialog.Value); _ReInitComboBox(_viewController.ThemesList, listThemes); listThemes.SelectedIndex = listThemes.FindStringExact(dialog.Value); } }
private void AddQuestion_Click(object sender, EventArgs e) { if (listThemes.Items.Count < 1) { MessageBox.Show(@"Добавте сначала хотя бы одну тему."); return; } var dialog = new NameDialog(); if (dialog.ShowDialog() == DialogResult.OK) { _viewController.NewDataObject(); _viewController.Question = dialog.Value; listQuestions.Text = dialog.Value; _viewController.Subject = listSubjects.Text; _viewController.Theme = listThemes.Text; _viewController.SaveDataObject(); _ReInitComboBox(_viewController.QuestionsList, listQuestions); listQuestions.SelectedItem = dialog.Value; } }