<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="OnCall.aspx.cs" Inherits="TEC_OnCall" Title="TEC_OnCall" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" type="text/javascript">
    function AssignOnCallStaff(assignComponent, employeeComponent){
        
    }
</script>
    <script language="javascript" type="text/javascript" src="../../Script/OpenSubPage.js">
        // open sub page
        
    </script>
<center>
    <asp:HiddenField ID="hidCurrentDate" runat="server" />

    <table id="tblCommand" runat="server">
        <tr>
            <td style="width: 100px">
                <asp:HyperLink ID="hlPreviousMonth" runat="server"><</asp:HyperLink></td>
            <td style="width: 100px">
                <asp:Label ID="lblCurrentMonth" runat="server" Text="Label"></asp:Label></td>
            <td style="width: 100px">
                <asp:HyperLink ID="hlNextMonth" runat="server">></asp:HyperLink></td>
        </tr>
        <tr id="trAssignComs" runat="Server" >
            <td align="center">
                <asp:DropDownList ID="ddlArea" runat="server" DataSourceID="ObjectDataSource3" OnSelectedIndexChanged="ddlArea_SelectedIndexChanged" AutoPostBack="True">
                </asp:DropDownList></td>
            <td visible="false">
                <asp:DropDownList ID="ddlEmployee" runat="server" DataSourceID="ObjectDataSource2">
                </asp:DropDownList></td>
            <td visible="false">
                <asp:Button ID="btnSubmit" runat="server" Text="<%$ Resources: Universal, Data_Submit %>" OnClick="btnSubmit_Click"/></td>
        </tr>
        <tr id="trPrompt" runat="Server" visible="False">
            <td colspan="3">
                <asp:Label ID="lblPrompt" Text="<%$ Resources: Universal, OnCall_Prompt %>" runat="Server" ForeColor="red"></asp:Label>
            </td>
        </tr>
    </table>
    
    <asp:GridView DataSourceID="ObjectDataSource1" ID="GridView1" AutoGenerateColumns="false"
    runat="server" CellPadding="4" ForeColor="#333333" GridLines="both" OnRowDataBound="GridView1_RowDataBound" >
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <Columns>
            <asp:TemplateField HeaderText="<%$ resources:Universal,Comm_Year %>" Visible="False">
                <ItemTemplate>
                    <asp:Label ID="lblYear" runat="server" Text='<%# Eval("Year") %>' />
                </ItemTemplate>
                <ItemStyle ForeColor="Blue" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal,Comm_Month %>" Visible="False">
                <ItemTemplate>
                    <asp:Label ID="lblMonth" runat="server" Text='<%# Eval("Month") %>' />
                </ItemTemplate>
                <ItemStyle ForeColor="Blue" />
            </asp:TemplateField>
            <asp:TemplateField >
                <ItemTemplate>
                    <asp:Label ID="lblDay" runat="server" Text='<%# Eval("Day") %>' />
                </ItemTemplate>
                <ItemStyle ForeColor="Blue" />
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="lblWeekDay" runat="server" Text='' />
                </ItemTemplate>
                <ItemStyle ForeColor="Blue" />
            </asp:TemplateField>

            <asp:TemplateField HeaderText="<%$ resources:Universal,OnCall_MechanicMain %>">
                <ItemTemplate>
                    <asp:TextBox ID="txtMechanicMain" runat="server" Text='<%# Eval("MM") %>' OnLoad="ContentTextBox_Load" Width="100px" Visible="false" />
                    <asp:Label ID="lblMechanicMain" runat="server" Text='<%# Eval("MM") %>' Visible="false"></asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal,OnCall_MechanicSub %>">
                <ItemTemplate>
                    <asp:TextBox ID="txtMechanicSub" runat="server" Text='<%# Eval("MS") %>' OnLoad="ContentTextBox_Load" Width="100px" Visible="false" />
                    <asp:Label ID="lblMechanicSub" runat="server" Text='<%# Eval("MS") %>' Visible="false"></asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal,OnCall_ElectricMain %>">
                <ItemTemplate>
                    <asp:TextBox ID="txtElectricMain" runat="server" Text='<%# Eval("EM") %>' OnLoad="ContentTextBox_Load" Width="100px" Visible="false" />
                    <asp:Label ID="lblElectricMain" runat="server" Text='<%# Eval("EM") %>' Visible="false"></asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal,OnCall_ElectricSub %>">
                <ItemTemplate>
                    <asp:TextBox ID="txtElectricSub" runat="server" Text='<%# Eval("ES") %>' OnLoad="ContentTextBox_Load" Width="100px" Visible="false" />
                    <asp:Label ID="lblElectricSub" runat="server" Text='<%# Eval("ES") %>' Visible="false"></asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="center" />
            </asp:TemplateField>
        </Columns>
        <RowStyle BackColor="#DFF3FB" Font-Size="X-Small" />
        <EditRowStyle Width="50px" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    </asp:GridView>
    
    
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="TEC_OnCallData"
        SelectMethod="SelectByMonth" InsertMethod="Insert"
        UpdateMethod="Update" DeleteMethod="Delete" ><%--FilterExpression="IsClosed='{0}'">--%>
        <UpdateParameters>
            <asp:Parameter Name="Year" Type="Int32" />        
            <asp:Parameter Name="Month" Type="Int32" />
            <asp:Parameter Name="Day" Type="Int32" />
            <asp:Parameter Name="Contents" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:Parameter Name="Year" Type="Int32" />
            <asp:Parameter Name="Month" Type="Int32" />
            <asp:Parameter Name="Area" Type="string" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" TypeName="HR_EmployeesData"
        SelectMethod="SelectEmployeeOnly" >
    </asp:ObjectDataSource>
    
    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" TypeName="Common_AreaData"
        SelectMethod="Select" >
    </asp:ObjectDataSource>   
    </center>
</asp:Content>

