コード例 #1
0
        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");
             */
        }
コード例 #2
0
 public static Gradebook Read()
 {
     var rv = new Gradebook();
     try
     {
         rv.ReadXml("gradebook.xml");
         rv.AcceptChanges();
     }
     catch (System.Exception)
     {
         return null;
     }
     return rv;
 }
コード例 #3
0
        public static Gradebook Read()
        {
            var rv = new Gradebook();

            try
            {
                rv.ReadXml("gradebook.xml");
                rv.AcceptChanges();
            }
            catch (System.Exception)
            {
                return(null);
            }
            return(rv);
        }
コード例 #4
0
        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");
            */
        }