public static void DeleteAppointments() { EditableSchedule[] carSchedulings = GetAppointmentsToRemove <EditableSchedule>(EditableDataObject, SchedulerDemoHelper.DefaultAppointmentStorage); foreach (EditableSchedule schedule in carSchedulings) { CarsDataProvider.DeleteCarScheduling <EditableSchedule>(schedule); } }
static void UpdateAppointments() { EditableSchedule[] carScheduling = GetAppointmentsToUpdate <EditableSchedule>(EditableDataObject, SchedulerDemoHelper.DefaultAppointmentStorage); foreach (EditableSchedule schedule in carScheduling) { CarsDataProvider.UpdateSchedule <EditableSchedule>(schedule); } }
void AddNewAppointmentWithReminder() { EditableSchedule schedule = CreateAppointmentWithReminders(); try { CarsDataProvider.InsertSchedule <EditableSchedule>(schedule); } catch (Exception e) { ViewData["SchedulerErrorText"] = e.Message; } }
void RemoveAppointments() { if (!ModelState.IsValid) { return; } ValidationSchedule[] schedules = SchedulerDataHelper.GetAppointmentsToRemove <ValidationSchedule>( SchedulerDataHelper.CustomDataObject, SchedulerDemoHelper.CustomAppointmentStorage); foreach (var schedule in schedules) { CarsDataProvider.DeleteCarScheduling <ValidationSchedule>(schedule); } }
void InsertAppointment() { ValidationSchedule schedule = SchedulerDataHelper.GetAppointmentToInsert <ValidationSchedule>( SchedulerDataHelper.CustomDataObject, SchedulerDemoHelper.CustomAppointmentStorage); if (schedule != null && TryValidateModel(schedule)) { CarsDataProvider.InsertSchedule <ValidationSchedule>(schedule); } else { ViewData["EditableSchedule"] = schedule; } }
public ActionResult ICalendarImport() { UploadedFile[] files = UploadControlExtension.GetUploadedFiles("schedulerAptImporter"); if (files.Count() > 0) { try { EditableSchedule[] schedules = SchedulerExtension.ImportFromICalendar <EditableSchedule>(SchedulerDemoHelper.ExportSchedulerSettings, files[0].FileContent); CarsDataProvider.SetImportedCarSchedulings(schedules); } catch (Exception e) { TempData["SchedulerErrorText"] = e.Message; } } return(RedirectToAction("ICalendar")); }
public ActionResult CarImage() { if (Request.QueryString[SchedulerDemoHelper.ImageQueryKey] != null) { int carId = int.Parse(Request.QueryString[GridViewDemosHelper.ImageQueryKey]); Response.ContentType = "image"; Binary photo = CarsDataProvider.GetCarPictureById(carId); if (photo != null) { Response.BinaryWrite(photo.ToArray()); } Response.End(); } return(null); }
void UpdateAppointment() { if (!ModelState.IsValid) { return; } ValidationSchedule[] schedules = SchedulerDataHelper.GetAppointmentsToUpdate <ValidationSchedule>( SchedulerDataHelper.CustomDataObject, SchedulerDemoHelper.CustomAppointmentStorage); foreach (var schedule in schedules) { if (!TryValidateModel(schedule)) { ViewData["EditableSchedule"] = schedule; break; } CarsDataProvider.UpdateSchedule <ValidationSchedule>(schedule); } }
static void InsertAppointment() { EditableSchedule carScheduling = GetAppointmentToInsert <EditableSchedule>(EditableDataObject, SchedulerDemoHelper.DefaultAppointmentStorage); CarsDataProvider.InsertSchedule <EditableSchedule>(carScheduling); }
public ActionResult ICalendar() { return(DemoView("ICalendar", CarsDataProvider.GetImportedCarSchedulings())); }
public ActionResult ICalendarExport() { return(SchedulerExtension.ExportToICalendar(SchedulerDemoHelper.ExportSchedulerSettings, CarsDataProvider.GetImportedCarSchedulings())); }
public ActionResult ICalendarPartial() { return(PartialView("ICalendarPartial", CarsDataProvider.GetImportedCarSchedulings())); }