public void SaveSettings() { if (old_schema != SmaNaSettings.Schema) { CsvAccess csv = new CsvAccess(SmaNaSettings.Schema); var removeList = ViewModelOverview.Appointments.Where(x => x.Generated && x.AppointmentState == Enumerations.AppointmentState.geplant).ToList(); ViewModelOverview.Appointments.RemoveRange(removeList); var appointments = csv.Load(SmaNaSettings.OperationDate); foreach (Appointment appointment in appointments) { appointment.AppointmentID = Guid.NewGuid(); } ViewModelOverview.Appointments.AddRange(appointments); old_schema = SmaNaSettings.Schema; } _xmlAccess.Save(SmaNaSettings); }
//Dear Professors, please visit one of the Students who created this code and tell them the line of Code to get a free coffee :) /// <summary> /// Saves the Data to the database. No Params needed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveData(object sender, NotifyCollectionChangedEventArgs e) { _xmlAccess.Save(new ObservableCollection <Appointment>(Appointments)); App.NotificationEventReceiver.UpdateAlarms(Appointments.Where(appointment => appointment.AppointmentReminder && !appointment.AppointmentDone)); Regroup(); }
public void Save() { _xmlAccess.Save(Operation); }