or
<WebServiceSettings Path="~/Webservices/Scheduler.asmx" ResourcePopulationMode="ServerSide" />public class MySchedulerInfo : SchedulerInfo { private int _hubID; public int HubID { get { return _hubID; } set { _hubID = value; } } private int _orderID; public int OrderID { get { return _orderID; } set { _orderID = value; } } private string _date; public string Date { get { return _date; } set { _date = value; } } } [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class Scheduler : System.Web.Services.WebService { private WebServiceAppointmentController _controller; /// <summary> /// The WebServiceAppointmentController class is used as a facade to the SchedulerProvider. /// </summary> private WebServiceAppointmentController Controller { get { if (_controller == null) { _controller = new WebServiceAppointmentController("MyDBSchedulerProvider"); } return _controller; } } [WebMethod(EnableSession=true)] //public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo) public IEnumerable<AppointmentData> GetAppointments(MySchedulerInfo schedulerInfo) { // Session["schHubID"] = schedulerInfo.HubID; Session["schDate"] = schedulerInfo.Date; Session["schOrderID"] = schedulerInfo.OrderID; return Controller.GetAppointments(schedulerInfo); } [WebMethod(EnableSession = true)] //public IEnumerable<AppointmentData> UpdateAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) public IEnumerable<AppointmentData> UpdateAppointment(MySchedulerInfo schedulerInfo, AppointmentData appointmentData) { Session["schHubID"] = schedulerInfo.HubID; Session["schDate"] = schedulerInfo.Date; Session["schOrderID"] = schedulerInfo.OrderID; return Controller.UpdateAppointment(schedulerInfo, appointmentData); } #region not used [WebMethod] public IEnumerable<AppointmentData> InsertAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) { return Controller.InsertAppointment(schedulerInfo, appointmentData); } [WebMethod] public IEnumerable<AppointmentData> CreateRecurrenceException(SchedulerInfo schedulerInfo, AppointmentData recurrenceExceptionData) { return Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData); } [WebMethod] public IEnumerable<AppointmentData> RemoveRecurrenceExceptions(SchedulerInfo schedulerInfo, AppointmentData masterAppointmentData) { return Controller.RemoveRecurrenceExceptions(schedulerInfo, masterAppointmentData); } [WebMethod] public IEnumerable<AppointmentData> DeleteAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData, bool deleteSeries) { return Controller.DeleteAppointment(schedulerInfo, appointmentData, deleteSeries); } #endregion [WebMethod(EnableSession = true)] public IEnumerable<ResourceData> GetResources(MySchedulerInfo schedulerInfo) { Session["schHubID"] = schedulerInfo.HubID; return Controller.GetResources(schedulerInfo); } }public class MyDbSchedulerProvider2 : DbSchedulerProviderBase { #region get Vans private IDictionary<int, Resource> _vans; private IDictionary<int, Resource> Vans { get { bool load = false; if (_vans == null) { load = true; } if (!load) { //if (_vans.Count == 0) load = true; } if (load) { _vans = new Dictionary<int, Resource>(); foreach (Resource van in LoadVans()) <---NEED TO PASS PARAM HERE { _vans.Add((int)van.Key, van); } } return _vans; } } public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner) { ResourceType[] resourceTypes = new ResourceType[1]; resourceTypes[0] = new ResourceType("Van", false); return resourceTypes; }#region LoadVans private IEnumerable<Resource> LoadVans() { List<Resource> resources = new List<Resource>(); int hubID = (int)HttpContext.Current.Session["schHubID"];
DO the load based on hubIDMySkinManager.TargetControls.Add(ControlTypeToApplySkin.RadTreeViewContextMenu, mythema);<td style="vertical-align: middle"> <telerik:RadDatePicker ID="FromDate" runat="server" AutoPostBack="false" Calendar-AutoPostBack="false" Culture="English (United States)" SelectedDate="2011-10-01" Width="120px"> <ClientEvents OnDateSelected="FromDateSelected" /> <Calendar UseRowHeadersAsSelectors="False" AutoPostBack="false" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"> </Calendar> <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton> <DateInput DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" AutoPostBack="false" CssClass="txtBack-Color" SelectedDate="2011-10-04"> </DateInput> </telerik:RadDatePicker> </td>
function RowDblClick(sender, eventArgs) { window.radopen("ViewForum.aspx?ForumID=" + eventArgs.getDataKeyValue("ForumID"), "RadWindow1");} <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="ForumSource" AllowPaging="True" AllowSorting="True" CellSpacing="0" GridLines="None" Height="520px" Skin="MetroTouch" Width="889px" OnItemCreated="RadGrid1_ItemCreated" CommandItemDisplay="Top"> <MasterTableView DataSourceID="ForumSource" PageSize="13" DataKeyNames="ForumID" AutoGenerateColumns="False" ClientDataKeyNames="ForumID"> <Columns> </Columns> </MasterTableView> <ClientSettings> <Selecting AllowRowSelect="true"></Selecting> <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents> <Scrolling AllowScroll="false" UseStaticHeaders="True" /> </ClientSettings> </telerik:RadGrid> <telerik:RadWindowManager ID="RadWindowManager1" runat="server"> <Windows> <telerik:RadWindow ID="RadWindow1" runat="server" Height="450" Width="800" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" Skin="MetroTouch"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager>