private void Save() { try { IOFile.WriteFile(Converter.CoursesToStrings(courses)); MessageBox.Show("Data has been saved", "Save"); } catch (CourseException ce) { MessageBox.Show(ce.Message, "Error"); } }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { try { IOFile.NewFile(); StartSetting(); courses = new List <Course>(); ShowEditCourses(); } catch (CourseException ce) { MessageBox.Show(ce.Message, "Error"); } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { try { IOFile.OpenFile(); courses = Converter.StringsToCourses(IOFile.ReadFile()); foreach (Course course in courses) { Debug.WriteLine(course); } saveToolStripMenuItem.Enabled = true; AddItemToCombo(); ShowEditCourses(); } catch (CourseException ce) { MessageBox.Show(ce.Message, "Error"); } }