Exemplo n.º 1
0
 public static void DeleteAppointments()
 {
     EditableSchedule[] carSchedulings = GetAppointmentsToRemove <EditableSchedule>(EditableDataObject, SchedulerDemoHelper.DefaultAppointmentStorage);
     foreach (EditableSchedule schedule in carSchedulings)
     {
         CarsDataProvider.DeleteCarScheduling <EditableSchedule>(schedule);
     }
 }
Exemplo n.º 2
0
 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;
            }
        }
Exemplo n.º 6
0
 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"));
 }
Exemplo n.º 7
0
 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);
            }
        }
Exemplo n.º 9
0
        static void InsertAppointment()
        {
            EditableSchedule carScheduling = GetAppointmentToInsert <EditableSchedule>(EditableDataObject, SchedulerDemoHelper.DefaultAppointmentStorage);

            CarsDataProvider.InsertSchedule <EditableSchedule>(carScheduling);
        }
Exemplo n.º 10
0
 public ActionResult ICalendar()
 {
     return(DemoView("ICalendar", CarsDataProvider.GetImportedCarSchedulings()));
 }
Exemplo n.º 11
0
 public ActionResult ICalendarExport()
 {
     return(SchedulerExtension.ExportToICalendar(SchedulerDemoHelper.ExportSchedulerSettings, CarsDataProvider.GetImportedCarSchedulings()));
 }
Exemplo n.º 12
0
 public ActionResult ICalendarPartial()
 {
     return(PartialView("ICalendarPartial", CarsDataProvider.GetImportedCarSchedulings()));
 }