private void SortStudentsBtn_Click(object sender, EventArgs e) { try { List <Student> students = StudentsDGVConvert.DGVToStudentsList(InputStudentsDGV); StudentsDGVConvert.StudentsListToDGV(InputStudentsDGV, StudentsSorter.Sort(students)); } catch (Exception ex) { MessagesUtils.ShowError("Произошла ошибка!"); } }
private void MainMenuFileSave_Click(object sender, EventArgs e) { if (SaveFileDialog.ShowDialog() == DialogResult.OK) { try { string path = SaveFileDialog.FileName; List <Student> studentsList = StudentsDGVConvert.DGVToStudentsList(InputStudentsDGV); StudentsFilesUtils.SaveStudentsListInFile(path, studentsList); MessagesUtils.ShowMessage("Данные сохранены в файл"); } catch (Exception ex) { MessagesUtils.ShowError("Ошибка сохранения в файл"); } } }