public void SaveChanges() { // Alle Jobs, die Termine erstellen, realisieren while (CreateJobQueue.Count > 0) { var job = CreateJobQueue.Dequeue(); mko.TraceHlp.ThrowArgExIfNot(job.IsValid, "ungültige Termine"); var appointment = job.Create(); _timelineDict[GetKey(appointment.Owner, ToDateTime(appointment.BeginDate, appointment.BeginTime), ToDateTime(appointment.EndDate, appointment.EndTime))] = appointment; } // Alle Jobs, die Termine löschen, realisieren while (DeleteJobQueue.Count > 0) { var key = DeleteJobQueue.Dequeue(); mko.TraceHlp.ThrowArgExIfNot(_timelineDict.ContainsKey(key), "Nicht existierender Termin " + key + " sollte gelöscht werden"); _timelineDict.Remove(key); } }
public IAppointmentBuilder Create() { var bld = new AppointmentBuilder(); CreateJobQueue.Enqueue(bld); return(bld); }
public void Rollback() { CreateJobQueue.Clear(); DeleteJobQueue.Clear(); }