/// <summary> /// Read default Data XML Default /// Load data into data grid /// </summary> private void UpdateDatagridSchedule() { LoadDefaultDataFile(); NailSalonXMLDAO NailSalonDAO = XMLHelpers.Instance(); scheduleViewModel.Today = DateTime.Now; scheduleViewModel.AppointmentList = NailSalonDAO.Appointments; }
public static void ReadFromXML(string path) { TextReader textReader = null; try { XmlSerializer xmlSerializer = new XmlSerializer(typeof(NailSalonXMLDAO)); textReader = new StreamReader(path); nailSalonXMLDAOInstance = (NailSalonXMLDAO)xmlSerializer.Deserialize(textReader); } catch (Exception e) { textReader.Close(); throw new Exception("Failed to loading data file." + e.InnerException.Message); } finally { textReader.Close(); } }