private void create_article_Click(object sender, EventArgs e) { Exam newExam = new Exam(); ExamInformation examModal = new ExamInformation(newExam); if (examModal.ShowDialog() == DialogResult.OK) { studentInfo.AddExam(newExam); //studentInfo.CalculatePagesAndAuthors(); //articles_list.Items.Add(newArticle.ToString()); //total_pages_label.Text = studentInfo.TotalPagesNumber.ToString(); } else { MessageBox.Show("Changes was not saved"); } }
private void edit_Article_Click(object sender, EventArgs e) { int selectedIndex = exams_list.SelectedIndex; if (selectedIndex < 0 || selectedIndex >= studentInfo.Exams.Count) { MessageBox.Show("You need to choose exam!"); return; } ExamInformation articleModal = new ExamInformation(studentInfo.Exams[selectedIndex]); if (articleModal.ShowDialog() == DialogResult.OK) { exams_list.Items[selectedIndex] = studentInfo.Exams[selectedIndex].ToString(); // studentInfo.CalculatePagesAndAuthors(); //total_pages_label.Text = studentInfo.TotalPagesNumber.ToString(); } else { MessageBox.Show("Changes was not saved"); } }