<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <style>
        .editInlineButton, .insertInlineButton {
            margin-bottom: 5px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <asp:Label Text="CurrentTime: " ID="Label1" runat="server" />
        <asp:Label  ID="CurrentTime" runat="server" />
        <br />  
        <div class="demo-container no-bg">
            <telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler1" AdvancedForm-EnableCustomAttributeEditing="true"
                SelectedView="WeekView" SelectedDate="2012-04-16" DataSourceID="AppointmentsDataSource"
                DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End"
                DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID"
                CustomAttributeNames="Annotations, LastModified" OnAppointmentCreated="RadScheduler1_AppointmentCreated"
                OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" OnAppointmentInsert="RadScheduler1_AppointmentInsert"
                OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnFormCreated="RadScheduler1_FormCreated"
                OnFormCreating="RadScheduler1_FormCreating"
                StartEditingInAdvancedForm="False"
                RowHeight="30px" OnAppointmentClick="RadScheduler1_AppointmentClick" Height="100%" ShowFooter="False">
                <AdvancedForm Modal="true"></AdvancedForm>
                <AppointmentTemplate>
                    <%# Eval("Subject") %>
                    <p style="font-style: italic;">
                        <%# Eval("Annotations") %>
                    </p>
                </AppointmentTemplate>
                <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
                <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
            </telerik:RadScheduler>
        </div>
        <asp:SqlDataSource ID="AppointmentsDataSource" runat="server"
            ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
            SelectCommand="SELECT * FROM [Appointments]" InsertCommand="INSERT INTO [Appointments] ([Subject], [Start], [End], [UserID], [RoomID], [RecurrenceRule], [RecurrenceParentID], [Annotations], [Description], [Reminder], [LastModified]) VALUES (@Subject, @Start, @End, @UserID, @RoomID, @RecurrenceRule, @RecurrenceParentID, @Annotations, @Description, @Reminder, @LastModified)"
            UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [UserID] = @UserID, [RoomID] = @RoomID, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Annotations] = @Annotations, [Description] = @Description, [Reminder] = @Reminder, [LastModified] = @LastModified WHERE [ID] = @ID"
            DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Subject" Type="String"></asp:Parameter>
                <asp:Parameter Name="Start" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="End" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="UserID" Type="Int32"></asp:Parameter>
                <asp:Parameter Name="RoomID" Type="Int32"></asp:Parameter>
                <asp:Parameter Name="RecurrenceRule" Type="String"></asp:Parameter>
                <asp:Parameter Name="RecurrenceParentID" Type="Int32"></asp:Parameter>
                <asp:Parameter Name="Annotations" Type="String"></asp:Parameter>
                <asp:Parameter Name="Description" Type="String"></asp:Parameter>
                <asp:Parameter Name="Reminder" Type="String"></asp:Parameter>
                <asp:Parameter Name="LastModified" Type="String"></asp:Parameter>
                <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Subject" Type="String"></asp:Parameter>
                <asp:Parameter Name="Start" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="End" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="UserID" Type="Int32"></asp:Parameter>
                <asp:Parameter Name="RoomID" Type="Int32"></asp:Parameter>
                <asp:Parameter Name="RecurrenceRule" Type="String"></asp:Parameter>
                <asp:Parameter Name="RecurrenceParentID" Type="Int32"></asp:Parameter>
                <asp:Parameter Name="Annotations" Type="String"></asp:Parameter>
                <asp:Parameter Name="Description" Type="String"></asp:Parameter>
                <asp:Parameter Name="Reminder" Type="String"></asp:Parameter>
                <asp:Parameter Name="LastModified" Type="String"></asp:Parameter>
            </InsertParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
