protected void Page_Init(object sender, EventArgs e) { ResourcesListBox.DataSource = ResourceDataSourceHelper.GetItems(); ResourcesListBox.DataBind(); if (!IsPostBack) { ResourcesListBox.SelectAll(); } // DXCOMMENT: Setting ViewType: a compact view (Day) for mobile devices, a large view (WorkWeek) for desktops Scheduler.ActiveViewType = RenderUtils.Browser.Platform.IsMobileUI ? SchedulerViewType.Day : SchedulerViewType.WorkWeek; if (!IsPostBack) { // DXCOMMENT: Scroll to actual time var currentTime = new TimeSpan(DateTime.Now.Hour - 1, 0, 0); Scheduler.DayView.TopRowTime = currentTime; Scheduler.WorkWeekView.TopRowTime = currentTime; Scheduler.FullWeekView.TopRowTime = currentTime; } // DXCOMMENT: Map labels by their ids Scheduler.Storage.Appointments.Labels.Clear(); foreach (SchedulerLabel label in SchedulerLabelsHelper.GetItems()) { Scheduler.Storage.Appointments.Labels.Add(label.Id, label.Name, label.Name, label.Color); } }
public static List <CustomAppointment> GetCustomAppointmentsList() { if (System.Web.HttpContext.Current.Session["CustomAppointmentsList"] == null) { List <CustomAppointment> appts = new List <CustomAppointment>(); List <CustomResource> resourcesList = ResourceDataSourceHelper.GetCustomResources(); int uniqueID = 0; foreach (var resource in resourcesList) { appts.Add(new CustomAppointment() { Id = uniqueID++, AllDay = false, Description = "Some Test Description", StartTime = DateTime.Now.Date.AddHours(12 + resource.ResourceId), EndTime = DateTime.Now.Date.AddHours(15 + resource.ResourceId), EventType = 0, Label = 2, ResourceId = resource.ResourceId, Status = 3, Subject = "Meeting" }); } System.Web.HttpContext.Current.Session["CustomAppointmentsList"] = appts; } return(System.Web.HttpContext.Current.Session["CustomAppointmentsList"] as List <CustomAppointment>); }