Posted 26 April 2019, 7:49 am EST
Hi,
C1Scheduler has Importand Exportmethods in DataStorage that allows one to import and export scheduler’s data from/to a file in formats like Binary, xml etc. You can use these methods as they save all the information of the appointments.
Once you have read the data, instead of modifying their you should first add the Resource/Contact/Category instances to their respective collection like DataStorage.ResourceStorage.Resources/ DataStorage.ContactStorage.Contacts/ DataStorage.CategoryStorage.Categories respectively, before adding them to the appointment objects.```
if (File.Exists(“C1Schedule.xml”))
{
// load data from the file.
this.c1Schedule1.DataStorage.Import(“C1Schedule.xml”, FileFormatEnum.XML);
ContactCollection contColl = this.c1Schedule1.DataStorage.ContactStorage.Contacts;
Contact conct1 = new Contact();
conct1.Text = "Andrey";
contColl.Add(conct1);
ResourceCollection resColl = this.c1Schedule1.DataStorage.ResourceStorage.Resources;
Resource res1 = new C1.C1Schedule.Resource();
res1.Text = "Digital Projector";
resColl.Add(res1);
CategoryCollection catColl= this.c1Schedule1.DataStorage.CategoryStorage.Categories;
Category category = new Category();
category.Text = "Suppliers";
catColl.Add(category);
foreach (Appointment app in c1Schedule1.DataStorage.AppointmentStorage.Appointments)
{
app.Body = "Body of Appointment";
app.Links.Clear();
app.Links.Add(conct1);
app.Resources.Clear();
app.Resources.Add(res1);
app.Categories.Clear();
app.Categories.Add(category);
}
}
Thanks,
Ruchir
[zip filename="C1Scheduler_Win.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-334daf98-2eb0-45cf-b740-b68d15a6bdb9.zip[/zip]