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

<%@ Register Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" TagPrefix="telerik" %>
<!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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1">
        </telerik:RadScriptManager>
        <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="sc_end_time"
            DataKeyField="sc_id" DataRecurrenceField="sc_RecurrenceRule" DataRecurrenceParentKeyField="sc_RecurrenceParentID"
            DataSourceID="SqlDSchedule" DataStartField="sc_start_time" DataSubjectField="sc_subject"
            HoursPanelTimeFormat="htt" Skin="Office2007" ValidationGroup="RadScheduler1"
            DayEndTime="22:00:00" Width="70%" WorkDayEndTime="22:00:00" OnAppointmentInsert="RadScheduler1_AppointmentInsert">
            <WeekView DayEndTime="22:00:00" WorkDayEndTime="22:00:00" />
            <Localization AdvancedAllDayEvent="All day"></Localization>
            <AdvancedForm Modal="true" />
            <TimelineView GroupBy="Calendar" GroupingDirection="Vertical" />
            <AdvancedForm DateFormat="d/M/yyyy" TimeFormat="h:mm tt"></AdvancedForm>
            <ResourceTypes>
                <telerik:ResourceType KeyField="room_id" Name="rooms" TextField="room_name" ForeignKeyField="sc_room"
                    DataSourceID="RoomsDataSource" />
                <telerik:ResourceType KeyField="type_id" Name="types" TextField="type_name" ForeignKeyField="sc_type"
                    DataSourceID="TypesDataSource" />
            </ResourceTypes>
            <DayView DayEndTime="22:00:00" WorkDayEndTime="22:00:00" />
            <MultiDayView DayEndTime="22:00:00" WorkDayEndTime="22:00:00" />
        </telerik:RadScheduler>
        <asp:SqlDataSource ID="SqlDSchedule" runat="server" ConnectionString="<%$ ConnectionStrings:MedisConnectionString %>"
            DeleteCommand="DELETE FROM [Schedule] WHERE [sc_id] = @sc_id" InsertCommand="INSERT INTO [Schedule] ([sc_start_time], [sc_end_time], [sc_subject], [sc_RecurrenceRule], [sc_RecurrenceParentID], [sc_memo], [sc_room], [sc_type]) VALUES (@sc_start_time, @sc_end_time, @sc_subject, @sc_RecurrenceRule, @sc_RecurrenceParentID, @sc_memo, @sc_room, @sc_type)"
            SelectCommand="SELECT * FROM [Schedule]" UpdateCommand="UPDATE [Schedule] SET [sc_start_time] = @sc_start_time, [sc_end_time] = @sc_end_time, [sc_subject] = @sc_subject, [sc_RecurrenceRule] = @sc_RecurrenceRule, [sc_RecurrenceParentID] = @sc_RecurrenceParentID, [sc_memo] = @sc_memo, [sc_room] = @sc_room, [sc_type] = @sc_type WHERE [sc_id] = @sc_id">
            <DeleteParameters>
                <asp:Parameter Name="sc_id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="sc_start_time" Type="DateTime" />
                <asp:Parameter Name="sc_end_time" Type="DateTime" />
                <asp:Parameter Name="sc_subject" Type="String" />
                <asp:Parameter Name="sc_RecurrenceRule" Type="String" />
                <asp:Parameter Name="sc_RecurrenceParentID" Type="Int32" />
                <asp:Parameter Name="sc_memo" Type="String" />
                <asp:Parameter Name="sc_room" Type="Int32" />
                <asp:Parameter Name="sc_type" Type="Int32" />
                <asp:Parameter Name="sc_id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="sc_start_time" Type="DateTime" />
                <asp:Parameter Name="sc_end_time" Type="DateTime" />
                <asp:Parameter Name="sc_subject" Type="String" />
                <asp:Parameter Name="sc_RecurrenceRule" Type="String" />
                <asp:Parameter Name="sc_RecurrenceParentID" Type="Int32" />
                <asp:Parameter Name="sc_memo" Type="String" />
                <asp:Parameter Name="sc_room" Type="Int32" />
                <asp:Parameter Name="sc_type" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="RoomsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MedisConnectionString %>"
            SelectCommand="SELECT * FROM [Rooms]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="TypesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MedisConnectionString %>"
            SelectCommand="SELECT * FROM [Types]"></asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
