All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

AppointmentCRUDEventArgs Class

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v20.2.dll

Declaration

public class AppointmentCRUDEventArgs :
    RoutedEventArgs
Public Class AppointmentCRUDEventArgs
    Inherits RoutedEventArgs

Remarks

The code snippet below saves changes to the data source.

// data context
public class SchedulingContext : DbContext {
    public SchedulingContext() : base(CreateConnection(), true) { }
    static DbConnection CreateConnection() {
        //...
    }
    public DbSet<AppointmentEntity> AppointmentEntities { get; set; }
    public DbSet<ResourceEntity> ResourceEntities { get; set; }
}

// save changes to the data source
public void ProcessChanges(AppointmentCRUDEventArgs args) {
    using(var dbContext = new SchedulingContext()) {
        dbContext.AppointmentEntities.AddRange(args.AddToSource.Select(x => (AppointmentEntity)x.SourceObject));

        foreach(var appt in args.UpdateInSource.Select(x => (AppointmentEntity)x.SourceObject))
            AppointmentEntityHelper.CopyProperties(appt, dbContext.AppointmentEntities.Find(appt.Id));

        foreach(var appt in args.DeleteFromSource.Select(x => (AppointmentEntity)x.SourceObject))
            dbContext.AppointmentEntities.Remove(dbContext.AppointmentEntities.Find(appt.Id));

        dbContext.SaveChanges();
    }
}
See Also