public static SchedulerSettings CreateSchedulerSettings(this HtmlHelper htmlHelper)
        {
            SchedulerSettings settings = new SchedulerSettings();

            settings.Name = "scheduler";
            settings.CallbackRouteValues        = new { Controller = "Home", Action = "SchedulerPartial" };
            settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" };

            settings.Storage.Appointments.Assign(DefaultAppointmentStorage);
            settings.Storage.Resources.Assign(DefaultResourceStorage);

            settings.AppointmentFormShowing = (sender, e) => {
                MVCxScheduler scheduler = sender as MVCxScheduler;
                if (scheduler != null)
                {
                    e.Container = new CustomAppointmentFormTemplateContainer(scheduler);
                }
            };

            settings.OptionsForms.SetAppointmentFormTemplateContent(c => {
                CustomAppointmentFormTemplateContainer container = (CustomAppointmentFormTemplateContainer)c;
                ValidationSchedule schedule = new ValidationSchedule()
                {
                    ID        = container.Appointment.Id == null ? -1 : (int)container.Appointment.Id,
                    Subject   = container.Appointment.Subject,
                    StartTime = container.Appointment.Start,
                    EndTime   = container.Appointment.End,
                    Price     = container.Price,
                };

                htmlHelper.ViewData["DeleteButtonEnabled"] = container.CanDeleteAppointment;

                htmlHelper.RenderPartial("CustomAppointmentFormPartial", schedule);
            });

            settings.Storage.Appointments.ResourceSharing = true;
            settings.Start = new DateTime(2008, 7, 11);
            return(settings);
        }
Esempio n. 2
0
 public CustomAppointmentTemplateContainer(MVCxScheduler scheduler) : base(scheduler)
 {
 }
Esempio n. 3
0
 public MVCxSchedulerGotoDateFormCallbackCommand(MVCxScheduler control)
     : base(control)
 {
 }