public void Save() { try { if (!HasChanges()) { return; } var other = new Gradebook(); other.ReadXml("gradebook.xml"); if (other.Config.Guid != Config.Guid) { if (CheckMerge(other)) { return; } } } catch (Exception exc) { } var guid = Guid.NewGuid(); Config.Guid = guid.ToString(); WriteXml("gradebook.xml"); Maintenance.BackupFile("gradebook.xml", CurrentUserName); /*Student.WriteXml("studentTable.xml"); * Grade.WriteXml("gradeTable.xml"); * Course.WriteXml("courseTable.xml"); */ }
public static Gradebook Read() { var rv = new Gradebook(); try { rv.ReadXml("gradebook.xml"); rv.AcceptChanges(); } catch (System.Exception) { return null; } return rv; }
public static Gradebook Read() { var rv = new Gradebook(); try { rv.ReadXml("gradebook.xml"); rv.AcceptChanges(); } catch (System.Exception) { return(null); } return(rv); }
public void Save() { try { if (!HasChanges()) return; var other = new Gradebook(); other.ReadXml("gradebook.xml"); if (other.Config.Guid != Config.Guid) { if (CheckMerge(other)) return; } } catch (Exception exc) { } var guid = Guid.NewGuid(); Config.Guid = guid.ToString(); WriteXml("gradebook.xml"); Maintenance.BackupFile("gradebook.xml", CurrentUserName); /*Student.WriteXml("studentTable.xml"); Grade.WriteXml("gradeTable.xml"); Course.WriteXml("courseTable.xml"); */ }