public void Handle(TerminEvent message) { TerminVonOld = null; TerminBisOld = null; TerminErinnerungOld = null; db = new SteinbachEntities(); if (message.TerminID > 0) { CurrentTermin = db.CRMTermine.Where(t => t.id == message.TerminID).SingleOrDefault(); TerminVonOld = null; TerminBisOld = null; TerminErinnerungOld = null; NotifyUINewAppointment(CurrentTermin.AppointmentType); } else { CurrentTermin = EntitiesFactory.GetNewTermin(message.TerminTyp); NotifyUINewAppointment(CurrentTermin.AppointmentType); db.AddToCRMTermine(CurrentTermin); } PopulateListboxes(CurrentTermin, db); }
public void NewCompany() { CRMTermine t = new CRMTermine(); db.AddToCRMTermine(t); _CurrentTermin = t; NotifyViewTerminChanged(); LoadTermin(); }
void c1Scheduler1_AppointmentAdded(object sender, C1.WPF.Schedule.AppointmentActionEventArgs e) { var cd = e.Appointment.CustomData; if (cd == null) { CRMTermine t = new CRMTermine(); t.TerminVon = e.Appointment.Start; t.TerminBis = e.Appointment.End; t.TerminDauer = e.Appointment.Duration.Ticks; t.Betreff = e.Appointment.Subject; t.Standort = e.Appointment.Location; t.AppointmentType = "Termin"; t.Details = e.Appointment.Body; var r = e.Appointment.Reminder; db.AddToCRMTermine(t); db.SaveChanges(); } }