Exemplo n.º 1
0
 public static void SaveGradebook(GradebookModel gradebook)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(GradebookModel));
     using (StreamWriter writer = new StreamWriter(PATH))
     {
         serializer.Serialize(writer, gradebook);
     }
 }
Exemplo n.º 2
0
        public static GradebookModel getGradebook()
        {
            GradebookModel gradebook = new GradebookModel();
            XmlSerializer deserializer = new XmlSerializer(typeof(GradebookModel));

            try
            {
                using (StreamReader reader = new StreamReader(PATH))
                {
                    gradebook = (GradebookModel)deserializer.Deserialize(reader);
                }
            }
            catch (FileNotFoundException)
            {
                //TODO: Do Something
            }

            return gradebook;
        }
Exemplo n.º 3
0
        public void Save()
        {
            GradebookModel _gradebook = new GradebookModel(this);
            GradebookDao.SaveGradebook(_gradebook);

            StateManager.Clean();
        }