<%@ Page Language="C#" Theme="Default" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="WorkHourList.aspx.cs" Inherits="OAWeb.NewProject.WorkHourList" EnableViewState="true"  %>

<%@ Register Src="/UserControls/TaskNav.ascx" TagName="TaskNav" TagPrefix="uc1" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlace" runat="server">
    <script language="javascript" type="text/javascript">
        function OpenEditDialog(id) {
            OpenDialog("/NewProject/WorkHourEdit.aspx?Id=" + id, "修改工时");
            return false;
        }
        function AuditWorkHour(id) {

            OpenDialog("/NewProject/WorkHourAudit.aspx?ActionId=" + id, "工时审批");
            return false;
        }  	
    </script>
    <style>
        .TypeList a
        {
            margin-left: 10px;
        }
        
        .TypeList
        {
            font-size: 16px;
            text-align: left;
            padding-top: 15px;
            padding-bottom: 5px;
        }
    </style>
    <table id="plc_profile" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td class="main_left">
                <uc1:TaskNav ID="TaskNav1" runat="server" />
            </td>
            <td class="main_center">
                <div class="page_main">
                    <div class="page_content">
                        <div style="width: 100%" class="divNewProject">
                            <div class=" TypeList " style="">
                                <a id="ListType1" href="workHourList.aspx?ListType=1">已审批工时</a> <a id="ListType2"
                                    href="workHourList.aspx?ListType=2">待审批工时</a> <a id="ListType3" href="workHourList.aspx?ListType=3">
                                        工时统计</a>
                            </div>
                            <div class=" " style="text-align: left; padding-top: 10px; padding-bottom: 5px; padding-left: 10px;">
                                部门：<asp:DropDownList ID="ddlDeptID" runat="server" AutoPostBack="True" 
                                    onselectedindexchanged="ddlDeptID_SelectedIndexChanged">
                                </asp:DropDownList>
                                员工：<asp:DropDownList ID="ddlUser" runat="server">
                                </asp:DropDownList>
                                期间：<asp:TextBox ID="txtBeginDate" runat="server" onfocus="WdatePicker()"></asp:TextBox>
                                -
                                <asp:TextBox ID="txtEndDate" runat="server" onfocus="WdatePicker()"></asp:TextBox>
                                <asp:Button ID="Button1" CssClass="btn_77px" runat="server" Text="查询" OnClick="Button1_Click" />
                            </div>
                            <div id="divWorkHour" runat="server">
                                <asp:GridView ID="gvDutieList" runat="server" AutoGenerateColumns="False" DataKeyNames="ActionId"
                                    Width="99%" PageSize="20" OnRowDataBound="gvDutieList_RowDataBound" OnRowCommand="gvDutieList_RowCommand">
                                    <HeaderStyle Wrap="False" CssClass="title"></HeaderStyle>
                                    <Columns>
                                        <asp:BoundField DataField="CreateBy" HeaderText="员工" ReadOnly="True" HtmlEncode="false">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:TemplateField HeaderText="所属任务">
                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblIssue" runat="server" Text='<%# Eval("IssueId") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="所属项目">
                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblProject" runat="server" Text=''></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="WorkHour" HeaderText="工时" ReadOnly="True">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:TemplateField HeaderText="状态">
                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblState" runat="server" Text='<%# Eval("ActionState") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="CreateDate" HeaderText="创建时间" ReadOnly="True">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:TemplateField HeaderText="操作">
                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <asp:LinkButton ID="lbtnAudit" runat="server"> 审批 </asp:LinkButton>
                                                <a id="LinkEdit" runat="server" href="javascript:void(0)">修改 </a>
                                                <asp:LinkButton ID="lbtnDel" runat="server" CommandName="Del" CommandArgument='<%# Eval("ActionId") %>'> 删除 </asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                                <div class="pager-bar">
                                    <webdiyer:AspNetPager ID="plDutie" runat="server" AlwaysShow="True" Direction="LeftToRight"
                                        FirstPageText="[首页]" HorizontalAlign="Right" LastPageText="[末页]" NextPageText="[下一页]"
                                        OnPageChanged="plDutie_PageChanged" PageSize="20" PrevPageText="[上一页]" ShowCustomInfoSection="Left">
                                    </webdiyer:AspNetPager>
                                </div>
                            </div>
                            <div id="divMath" runat="server" visible="false">
                                <asp:GridView ID="gvMath" runat="server" AutoGenerateColumns="False" DataKeyNames=""
                                    Width="99%" OnRowDataBound="gvMath_RowDataBound">
                                    <HeaderStyle Wrap="False" CssClass="title"></HeaderStyle>
                                    <Columns>
                                        <asp:TemplateField HeaderText="员工">
                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblUserName" runat="server" Text=""></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="部门">
                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <asp:Label ID="LblDepartment" runat="server" Text=""></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="开始时间">
                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <%=  txtBeginDate.Text %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="结束时间">
                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <%=  txtEndDate.Text %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="TotalWorkHour" HeaderText="工时" ReadOnly="True">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <script>
        var ListType = "<%= ListType %>";
        $("#ListType" + ListType).css("color", "red");
    </script>
</asp:Content>
