Hey Guys,
I am attempting to create a schedule that will track nurse jobs/availabilies.
For this, I have created a resource called 'Facilitator' (the nurse).
I am trying to implement the Resource Avalability Demo from the telerik site, so that a single Facilitator cannot be double booked, and keep running into the following error with the javascript -
This is doing me head in, so any assistance would be appeciated.
BTW - RadControls for ASP.NET AJAX Q2 2009
in the function isFacilitatorOccupied the first line of code is -
.aspx page
aspx.vb page
If anybody can steer me in the right direction, would fantastic.
Cheers,
Steve
I am attempting to create a schedule that will track nurse jobs/availabilies.
For this, I have created a resource called 'Facilitator' (the nurse).
I am trying to implement the Resource Avalability Demo from the telerik site, so that a single Facilitator cannot be double booked, and keep running into the following error with the javascript -
- appointment.get_resources is not a function
This is doing me head in, so any assistance would be appeciated.
BTW - RadControls for ASP.NET AJAX Q2 2009
in the function isFacilitatorOccupied the first line of code is -
- var currentFacilitator = appointment.get_resources().getResourcesByType("Facilitator").getResource(0);
.aspx page
| <%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" /> |
| <link href="cssStyle.css" rel="stylesheet" type="text/css" /> |
| </head> |
| <body> |
| <form id="form1" runat="server" method="post"> |
| <h1>Medical Schedule</h1> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| <Scripts> |
| <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> |
| <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> |
| </Scripts> |
| </telerik:RadScriptManager> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadScheduler1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" /> |
| <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Default" /> |
| <script type="text/javascript"> |
| /* <![CDATA[ */ |
| /* Helper functions */ |
| /// <summary> |
| /// Returns the appointments in the specified period filtered by the specified resource. |
| /// </summary> |
| /// <param name="scheduler"> |
| /// RadScheduler's client-side object |
| /// </param> |
| /// <param name="start" type="Date"> |
| /// The start of the period |
| /// </param> |
| /// <param name="end" type="Date"> |
| /// The end of the period |
| /// </param> |
| /// <param name="resource"> |
| /// The resource (room or user) to filter by |
| /// </param> |
| /// <param name="appointment"> |
| /// The current appointment |
| /// </param> |
| function getAppointmentsInRangeByResource(scheduler, start, end, resource, appointment) |
| { |
| //Get all appointments within the specified time period |
| var result = scheduler.get_appointments().getAppointmentsInRange(start, end); |
| //If specified remove the appointment from the appointment list |
| if (appointment) |
| result.remove(appointment); |
| //Filter the appointments based on the resource |
| return result.findByResource(resource); |
| } |
| /// <summary> |
| /// Checks if the user associated with the specified appointment has another |
| /// appointment in the specified time period |
| /// </sumary> |
| /// <param name="scheduler"> |
| /// RadScheduler's client-side object |
| /// </param> |
| /// <param name="start" type="Date"> |
| /// The start of the period |
| /// </param> |
| /// <param name="end" type="Date"> |
| /// The end of the period |
| /// </param> |
| /// <param name="appointment"> |
| /// The current appointment |
| /// </param> |
| function isFacilitatorOccupied(scheduler, start, end, appointment) |
| { |
| //get the "User" resource associated with the appointment |
| var currentFacilitator = appointment.get_resources().getResourcesByType("Facilitator").getResource(0); |
| //get all appointments in this period which are associated with this resource |
| var appointmentsForThisFacilitator = getAppointmentsInRangeByResource(scheduler, start, end, currentFacilitator, appointment); |
| //if the list of appointments is not empty the user has other appointments besides the specified in this time period |
| return appointmentsForThisFacilitator.get_count() > 0; |
| } |
| function warnIfOccupied(start, end, sender, args) |
| { |
| var slot = args.get_targetSlot(); |
| var appointment = args.get_appointment(); |
| if (isFacilitatorOccupied(sender, start, end, appointment)) |
| { |
| alert("This Facilitator is occupied in this time period."); |
| args.set_cancel(true); |
| } |
| appointment.get_element().style.border = ""; |
| } |
| /// <summary> |
| /// Checks if the specified time slot is occupied and visually shows it to the user. |
| /// Called by the resizeing and moving client-side event handlers. |
| /// </sumary> |
| function highlightIfOccupied(start, end, sender, args) |
| { |
| alert("4"); |
| var appointment = args.get_appointment(); |
| var slot = args.get_targetSlot(); |
| if (isFacilitatorOccupied(sender, start, end, appointment)) |
| { |
| appointment.get_element().style.border = "1px solid red"; |
| return; |
| } |
| appointment.get_element().style.border = ""; |
| } |
| function onAppointmentResizing(sender, args) |
| { |
| var start = args.get_appointment().get_start(); |
| var end = args.get_targetSlot().get_endTime(); |
| highlightIfOccupied(start, end, sender, args); |
| } |
| function onAppointmentResizeEnd(sender, args) |
| { |
| var start = args.get_appointment().get_start(); |
| var end = args.get_targetSlot().get_endTime(); |
| warnIfOccupied(start, end, sender, args); |
| } |
| function onAppointmentMoving(sender, args) |
| { |
| var start = args.get_targetSlot().get_startTime(); |
| var end = new Date(start.getTime() + args.get_appointment().get_duration()); |
| highlightIfOccupied(start, end, sender, args); |
| } |
| function onAppointmentMoveEnd(sender, args) |
| { |
| var start = args.get_targetSlot().get_startTime(); |
| var end = new Date(start.getTime() + args.get_appointment().get_duration()); |
| warnIfOccupied(start, end, sender, args); |
| } |
| function onAppointmentInserting(sender, args) |
| { |
| var slot = args.get_targetSlot(); |
| var start = slot.get_startTime(); |
| var end = slot.get_endTime(); |
| if (isFacilitatorOccupied(sender, start, end, slot)) |
| { |
| alert("This Facilitator is not available in this time period."); |
| args.set_cancel(true); |
| } |
| } |
| /* ]]> */ |
| </script> |
| <div> |
| <table cellspacing="0" cellpadding="5" class="Refinement"> |
| <tr valign="top"> |
| <td><h3>State:</h3></td> |
| <td><h3>Group By:</h3></td> |
| <td><h3>Direction:</h3></td> |
| <td><asp:Label ID="lblStates" runat="server" Text="Test Label" Visible="false" /></td> |
| </tr> |
| <tr valign="top"> |
| <td> |
| <asp:CheckBoxList runat="server" id="chkState" RepeatLayout="Table" RepeatDirection="Horizontal" RepeatColumns="5" Width="400px"> |
| <asp:ListItem Text="ACT" Value="ACT" /> |
| <asp:ListItem Text="NSW" Value="NSW" /> |
| <asp:ListItem Text="NT" Value="NT" /> |
| <asp:ListItem Text="NZ" Value="NZ" /> |
| <asp:ListItem Text="QLD" Value="QLD" /> |
| <asp:ListItem Text="SA" Value="SA" /> |
| <asp:ListItem Text="TAS" Value="TAS" /> |
| <asp:ListItem Text="VIC" Value="VIC" /> |
| <asp:ListItem Text="WA" Value="WA" /> |
| </asp:CheckBoxList> |
| </td> |
| <td> |
| <telerik:RadComboBox ID="ddlGroupBy" Runat="server" > |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Selected="True" Text="None" /> |
| <telerik:RadComboBoxItem runat="server" Text="Activity" Value="Activity" /> |
| <telerik:RadComboBoxItem runat="server" Text="Facilitator" Value="Facilitator" /> |
| <telerik:RadComboBoxItem runat="server" Text="Client" Value="Client" /> |
| <telerik:RadComboBoxItem runat="server" Text="State" Value="State" /> |
| </Items> |
| </telerik:RadComboBox> |
| </td> |
| <td> |
| <telerik:RadComboBox ID="ddlGroupingDirection" Runat="server"> |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Text="Vertical" Value="Vertical" Selected="True" /> |
| <telerik:RadComboBoxItem runat="server" Text="Horizontal" Value="Horizontal" /> |
| </Items> |
| </telerik:RadComboBox> |
| </td> |
| <td><asp:ImageButton runat="server" ID="btnSubmit_Refinement" ImageUrl="images/buttons/btnSubmit_Refinement.jpg" /></td> |
| </tr> |
| </table> |
| <br /> |
| <br /> |
| <telerik:RadScheduler ID="RadScheduler1" runat="server" |
| DataKeyField="ID" DataSourceID="dsSchedule" DataStartField="Start" DataEndField="End" DataSubjectField="Subject" |
| DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" |
| HoursPanelTimeFormat="htt" MinutesPerRow="15" |
| ValidationGroup="RadScheduler1" Height="700px" Skin="WebBlue" |
| Culture="English (Australia)" WorkDayEndTime="18:00:00" |
| FirstDayOfWeek="Monday" RowHeaderWidth="100px" |
| StartInsertingInAdvancedForm="True" |
| OnAppointmentCreated="RadScheduler1_AppointmentCreated" |
| OnClientAppointmentInserting="onAppointmentInserting" |
| OnClientAppointmentMoving="onAppointmentMoving" OnClientAppointmentMoveEnd="onAppointmentMoveEnd" |
| OnClientAppointmentResizing="onAppointmentResizing" OnClientAppointmentResizeEnd="onAppointmentResizeEnd"> |
| <ResourceTypes> |
| <telerik:ResourceType DataSourceID="dsActivity" ForeignKeyField="Activity_ID" KeyField="Activity_ID" Name="Activity" TextField="Activity_Name" /> |
| <telerik:ResourceType DataSourceID="dsFacilitator" ForeignKeyField="Facilitator_ID" KeyField="Facilitator_ID" Name="Facilitator" TextField="FirstName" /> |
| <telerik:ResourceType DataSourceID="dsClient" ForeignKeyField="Client_ID" KeyField="Client_ID" Name="Client" TextField="Client_Name" /> |
| <telerik:ResourceType DataSourceID="dsState" ForeignKeyField="State" KeyField="State" Name="State" TextField="State" /> |
| </ResourceTypes> |
| <Localization AdvancedAllDayEvent="All day"></Localization> |
| <AdvancedForm DateFormat="d/MM/yyyy" TimeFormat="h:mm tt"></AdvancedForm> |
| <TimelineView UserSelectable="false" /> |
| <MultiDayView UserSelectable="false" /> |
| <AppointmentTemplate> |
| <%# Eval("Client.Text") %> - <%# Eval("Activity.Text") %> - <%# Eval("Facilitator.Text") %> |
| </AppointmentTemplate> |
| <InlineInsertTemplate> |
| <asp:TextBox runat="server" ID="SubjectTextBox" Text='<%# Bind("Subject") %>' Width="99%"></asp:TextBox> |
| <div class="UserToolbox"> |
| User: |
| <telerik:RadComboBox runat="server" ID="FacilitatorComboBox" DataTextField="Facilitator_Display" DataValueField="Facilitator_ID" |
| Width="80px" Skin="Office2007" SelectedValue='<%# Bind("Facilitator_ID") %>' DataSource='<%# GetAvailableFacilitators(Container) %>'> |
| </telerik:RadComboBox> |
| <asp:LinkButton runat="server" ID="InsertLinkButton" CommandName="Insert" Text="Insert"></asp:LinkButton> |
| <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton> |
| </div> |
| </InlineInsertTemplate> |
| <InlineEditTemplate> |
| <asp:TextBox runat="server" ID="SubjectTextBox" Text='<%# Bind("Subject") %>' Width="99%"></asp:TextBox> |
| <div class="UserToolbox"> |
| User: |
| <telerik:RadComboBox runat="server" ID="FacilitatorComboBox" DataTextField="Facilitator_Display" DataValueField="Facilitator_ID" |
| Width="80px" Skin="Office2007" SelectedValue='<%# Bind("Facilitator_ID") %>' DataSource='<%# GetAvailableFacilitators(Container) %>' > |
| </telerik:RadComboBox> |
| <asp:LinkButton runat="server" ID="UpdateLinkButton" CommandName="Update" Text="Update"></asp:LinkButton> |
| <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton> |
| </div> |
| </InlineEditTemplate> |
| </telerik:RadScheduler> |
| <asp:SqlDataSource ID="dsSchedule" runat="server" |
| ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>" |
| SelectCommand="SELECT [ID], [Subject], [Start], [End], [Facilitator_ID], [RecurrenceRule], [RecurrenceParentID], [Annotations], [Activity_ID], [Client_ID], [Comments], [State] FROM [Appointments]" |
| ConflictDetection="CompareAllValues" |
| DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @original_ID AND [Subject] = @original_Subject AND [Start] = @original_Start AND [End] = @original_End AND (([Facilitator_ID] = @original_Facilitator_ID) OR ([Facilitator_ID] IS NULL AND @original_Facilitator_ID IS NULL)) AND (([RecurrenceRule] = @original_RecurrenceRule) OR ([RecurrenceRule] IS NULL AND @original_RecurrenceRule IS NULL)) AND (([RecurrenceParentID] = @original_RecurrenceParentID) OR ([RecurrenceParentID] IS NULL AND @original_RecurrenceParentID IS NULL)) AND (([Annotations] = @original_Annotations) OR ([Annotations] IS NULL AND @original_Annotations IS NULL)) AND (([Activity_ID] = @original_Activity_ID) OR ([Activity_ID] IS NULL AND @original_Activity_ID IS NULL)) AND (([Client_ID] = @original_Client_ID) OR ([Client_ID] IS NULL AND @original_Client_ID IS NULL)) AND (([Comments] = @original_Comments) OR ([Comments] IS NULL AND @original_Comments IS NULL)) AND (([State] = @original_State) OR ([State] IS NULL AND @original_State IS NULL))" |
| InsertCommand="INSERT INTO [Appointments] ([Subject], [Start], [End], [Facilitator_ID], [RecurrenceRule], [RecurrenceParentID], [Annotations], [Activity_ID], [Client_ID], [Comments], [State]) VALUES (@Subject, @Start, @End, @Facilitator_ID, @RecurrenceRule, @RecurrenceParentID, @Annotations, @Activity_ID, @Client_ID, @Comments, @State)" |
| OldValuesParameterFormatString="original_{0}" |
| UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [Facilitator_ID] = @Facilitator_ID, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Annotations] = @Annotations, [Activity_ID] = @Activity_ID, [Client_ID] = @Client_ID, [Comments] = @Comments, [State] = @State WHERE [ID] = @original_ID AND [Subject] = @original_Subject AND [Start] = @original_Start AND [End] = @original_End AND (([Facilitator_ID] = @original_Facilitator_ID) OR ([Facilitator_ID] IS NULL AND @original_Facilitator_ID IS NULL)) AND (([RecurrenceRule] = @original_RecurrenceRule) OR ([RecurrenceRule] IS NULL AND @original_RecurrenceRule IS NULL)) AND (([RecurrenceParentID] = @original_RecurrenceParentID) OR ([RecurrenceParentID] IS NULL AND @original_RecurrenceParentID IS NULL)) AND (([Annotations] = @original_Annotations) OR ([Annotations] IS NULL AND @original_Annotations IS NULL)) AND (([Activity_ID] = @original_Activity_ID) OR ([Activity_ID] IS NULL AND @original_Activity_ID IS NULL)) AND (([Client_ID] = @original_Client_ID) OR ([Client_ID] IS NULL AND @original_Client_ID IS NULL)) AND (([Comments] = @original_Comments) OR ([Comments] IS NULL AND @original_Comments IS NULL)) AND (([State] = @original_State) OR ([State] IS NULL AND @original_State IS NULL))"> |
| <DeleteParameters> |
| <asp:Parameter Name="original_ID" Type="Int32" /> |
| <asp:Parameter Name="original_Subject" Type="String" /> |
| <asp:Parameter Name="original_Start" Type="DateTime" /> |
| <asp:Parameter Name="original_End" Type="DateTime" /> |
| <asp:Parameter Name="original_Facilitator_ID" Type="Int32" /> |
| <asp:Parameter Name="original_RecurrenceRule" Type="String" /> |
| <asp:Parameter Name="original_RecurrenceParentID" Type="Int32" /> |
| <asp:Parameter Name="original_Annotations" Type="String" /> |
| <asp:Parameter Name="original_Activity_ID" Type="Int32" /> |
| <asp:Parameter Name="original_Client_ID" Type="Int32" /> |
| <asp:Parameter Name="original_Comments" Type="String" /> |
| <asp:Parameter Name="original_State" Type="String" /> |
| </DeleteParameters> |
| <UpdateParameters> |
| <asp:Parameter Name="Subject" Type="String" /> |
| <asp:Parameter Name="Start" Type="DateTime" /> |
| <asp:Parameter Name="End" Type="DateTime" /> |
| <asp:Parameter Name="Facilitator_ID" Type="Int32" /> |
| <asp:Parameter Name="RecurrenceRule" Type="String" /> |
| <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> |
| <asp:Parameter Name="Annotations" Type="String" /> |
| <asp:Parameter Name="Activity_ID" Type="Int32" /> |
| <asp:Parameter Name="Client_ID" Type="Int32" /> |
| <asp:Parameter Name="Comments" Type="String" /> |
| <asp:Parameter Name="State" Type="String" /> |
| <asp:Parameter Name="original_ID" Type="Int32" /> |
| <asp:Parameter Name="original_Subject" Type="String" /> |
| <asp:Parameter Name="original_Start" Type="DateTime" /> |
| <asp:Parameter Name="original_End" Type="DateTime" /> |
| <asp:Parameter Name="original_Facilitator_ID" Type="Int32" /> |
| <asp:Parameter Name="original_RecurrenceRule" Type="String" /> |
| <asp:Parameter Name="original_RecurrenceParentID" Type="Int32" /> |
| <asp:Parameter Name="original_Annotations" Type="String" /> |
| <asp:Parameter Name="original_Activity_ID" Type="Int32" /> |
| <asp:Parameter Name="original_Client_ID" Type="Int32" /> |
| <asp:Parameter Name="original_Comments" Type="String" /> |
| <asp:Parameter Name="original_State" Type="String" /> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="Subject" Type="String" /> |
| <asp:Parameter Name="Start" Type="DateTime" /> |
| <asp:Parameter Name="End" Type="DateTime" /> |
| <asp:Parameter Name="Facilitator_ID" Type="Int32" /> |
| <asp:Parameter Name="RecurrenceRule" Type="String" /> |
| <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> |
| <asp:Parameter Name="Annotations" Type="String" /> |
| <asp:Parameter Name="Activity_ID" Type="Int32" /> |
| <asp:Parameter Name="Client_ID" Type="Int32" /> |
| <asp:Parameter Name="Comments" Type="String" /> |
| <asp:Parameter Name="State" Type="String" /> |
| </InsertParameters> |
| </asp:SqlDataSource> |
| </div> |
| <asp:SqlDataSource ID="dsActivity" runat="server" |
| ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>" |
| SelectCommand="SELECT [Activity_ID], [Activity_Name], [Description], [Appt_Duration], [Acronym], [Status] FROM [Activity]"> |
| </asp:SqlDataSource> |
| <asp:SqlDataSource ID="dsFacilitator" runat="server" |
| ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>" |
| SelectCommand="SELECT [Facilitator_ID], [FirstName], [LastName], [Phone1], [Phone2], [Phone3], [Email1], [Email2], [Status], [LastName] + ', ' + [FirstName] As [Facilitator_Display] FROM [Facilitator]"> |
| </asp:SqlDataSource> |
| <asp:SqlDataSource ID="dsClient" runat="server" |
| ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>" |
| SelectCommand="SELECT [Client_ID], [Client_Code], [Client_Name], [Client_Address], [Client_Contact_FirstName], [Client_Contact_LastName], [Client_Phone1], [Client_Phone2], [Client_Phone3], [Client_Email1], [Client_Email2], [Client_Status] FROM [Client]"> |
| </asp:SqlDataSource> |
| <asp:SqlDataSource ID="dsState" runat="server" |
| ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>" |
| SelectCommand="SELECT [State], [TimeZoneOffset], [HasDaylightSaving] FROM [State]"> |
| </asp:SqlDataSource> |
| </form> |
| </body> |
| </html> |
aspx.vb page
| Imports Telerik.Web.UI |
| Imports System.Web.Security |
| Imports System.Web.UI.WebControls |
| Imports System.Data |
| Imports System.Data.Common |
| Imports System.Data.SqlClient |
| Imports System.Drawing |
| Imports System.Collections |
| Imports System.Collections.Generic |
| Partial Class _Default |
| Inherits System.Web.UI.Page |
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
| End Sub |
| Protected Sub RadScheduler1_AppointmentDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerEventArgs) Handles RadScheduler1.AppointmentDataBound |
| If e.Appointment.Resources.GetResourceByType("Client") <> Nothing Then |
| Select Case e.Appointment.Resources.GetResourceByType("Client").Text |
| Case "Client1" |
| e.Appointment.CssClass = "rsCategoryBlue" |
| Exit Select |
| Case "Client2" |
| e.Appointment.CssClass = "rsCategoryOrange" |
| Exit Select |
| Case "Client13" |
| e.Appointment.CssClass = "rsCategoryGreen" |
| Exit Select |
| Case Else |
| Exit Select |
| End Select |
| End If |
| End Sub |
| Protected Sub btnSubmit_Refinement_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSubmit_Refinement.Click |
| RadScheduler1.GroupBy = ddlGroupBy.SelectedValue |
| RadScheduler1.GroupingDirection = DirectCast([Enum].Parse(GetType(GroupingDirection), ddlGroupingDirection.SelectedValue), GroupingDirection) |
| If chkState.SelectedIndex > -1 Then |
| Dim myStateRefinement As String = "" |
| For Each li As ListItem In chkState.Items |
| If li.Selected = True Then |
| If myStateRefinement = "" Then |
| myStateRefinement = "State = '" & li.Value & "'" |
| Else |
| myStateRefinement += " OR State = '" & li.Value & "'" |
| End If |
| End If |
| Next |
| dsState.SelectCommand = "Select * FROM State where " & myStateRefinement |
| dsState.DataBind() |
| dsSchedule.SelectCommand = "Select * FROM Appointments where " & myStateRefinement |
| dsSchedule.DataBind() |
| End If |
| End Sub |
| Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As Object, ByVal e As AppointmentCreatedEventArgs) |
| Dim Facilitator As Resource = e.Appointment.Resources.GetResourceByType("Facilitator") |
| 'Dim assignedTo As Label = DirectCast(e.Container.FindControl("AssignedTo"), Label) |
| 'assignedTo.Text = "Held by: " + Facilitator.Text |
| End Sub |
| Protected Function GetAvailableFacilitators(ByVal container As Control) As IEnumerable |
| Dim appointment As Appointment = (DirectCast(container, SchedulerFormContainer)).Appointment |
| Dim availableFacilitator As New List(Of Resource)(RadScheduler1.Resources.GetResourcesByType("Facilitator")) |
| For Each appointmentInRange As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(appointment.Start, appointment.[End]) |
| If appointmentInRange Is appointment Then |
| Continue For |
| End If |
| For Each occupiedFacilitator As Resource In appointmentInRange.Resources.GetResourcesByType("Facilitator") |
| availableFacilitator.Remove(occupiedFacilitator) |
| Next |
| Next |
| Return availableFacilitator |
| End Function |
| End Class |
If anybody can steer me in the right direction, would fantastic.
Cheers,
Steve