<%@ Page Language="C#" CodeFile="BusEmployeeList.aspx.cs" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="BusEmployeeList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderToolbar" runat="Server">
    <table id="__tblSubmitImage" height="100%" style="display: none" width="100%">
        <tr>
            <td align="center">
                <img src="../Images/Sumiting.gif" /></td>
        </tr>
    </table>
    <table cellpadding="5" cellspacing="0" class="Navigator" width="100%">
        <tr>
            <td nowrap="nowrap" width="80">
            </td>
            <td align="left">
                <font class="NavigatorTitle">公交車輛駕駛員管理-&gt;公交車輛駕駛員信息管理</font></td>
            <td width="150">
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderList" runat="Server">
    <div>
        <table cellspacing="0" cellpadding="5" align="center" runat="server" id="tblQuery">
            <tr>
                <td>
                    共
                    <asp:Label ID="lblRecordCount" runat="server" ForeColor="Red" />條記錄，分
                    <asp:Label ID="lblPageCount" runat="server" ForeColor="Red" />頁顯示，每页显示
                    <asp:TextBox ID="txtPageSize" runat="server" Width="32px" CssClass="treemenu" Text="10" /><asp:RequiredFieldValidator
                        ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtPageSize" Display="None"
                        EnableViewState="False" ErrorMessage="请填写每页显示数量！"> 
							*
                    </asp:RequiredFieldValidator><asp:RangeValidator ID="RangeValidator1" runat="server"
                        ErrorMessage="每页显示数量必须为正整数！" Type="Integer" MinimumValue="0" MaximumValue="100000000"
                        Display="None" ControlToValidate="txtPageSize" EnableViewState="False">
						*
                    </asp:RangeValidator>
                    条，当前为
                    <asp:TextBox ID="txtCurrentPage" runat="server" Width="32px" CssClass="textboxmoney">
							1
                    </asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                        ControlToValidate="txtCurrentPage" Display="None" EnableViewState="False" ErrorMessage="请填写页码！">
						*
                    </asp:RequiredFieldValidator><asp:RangeValidator ID="RangeValidator2" runat="server"
                        ErrorMessage="非法的页码" Type="Integer" MinimumValue="0" MaximumValue="100000000"
                        Display="None" ControlToValidate="txtCurrentPage" EnableViewState="False">
							*
                    </asp:RangeValidator>頁
                    <asp:Button ID="btnGo" runat="server" Text="Go..." EnableViewState="False" OnClick="btnGo_Click">
                    </asp:Button><input type="button" value="新增" onclick="OpenAdd()" /><asp:ValidationSummary
                        ID="pageValidation" runat="server" ShowSummary="False" ShowMessageBox="True"
                        EnableViewState="False"></asp:ValidationSummary>
                </td>
            </tr>
        </table>
    </div>
    <div style="width: 100%">
        <asp:GridView ID="dgResult" runat="server" AllowSorting="True" AllowPaging="True"
            AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderWidth="1px"
            CellPadding="5" OnRowDataBound="dgResult_RowDataBound" OnRowDeleting="dgResult_RowDeleting" OnSorting="dgResult_Sorting">
            <SelectedRowStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedRowStyle>
            <RowStyle ForeColor="#330099" BackColor="White"></RowStyle>
            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" BackColor="#DDDDDD">
            </HeaderStyle>
            <FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
            <Columns>
                <asp:TemplateField SortExpression="ID" HeaderText="編號">
                    <ItemTemplate>
                        <asp:Label ID="labID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"ID")%>' /></ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="IDCard" SortExpression="IDCard" HeaderText="身份证号" />
                <asp:BoundField DataField="Name" SortExpression="Name" HeaderText="姓名" />
                <asp:BoundField DataField="Sex" SortExpression="Sex" HeaderText="性别" />
                <asp:BoundField DataField="Phone" SortExpression="Phone" HeaderText="联系电话" />
                <asp:BoundField DataField="Landscape" SortExpression="Landscape" HeaderText="政治面貌" />
                <asp:BoundField DataField="Address" SortExpression="Address" HeaderText="住址" />
                <asp:BoundField DataField="DriverLicenseNO" SortExpression="DriverLicenseNO" HeaderText="驾驶证" />
                <asp:BoundField DataField="DriverLicenseNoVehicleType" SortExpression="DriverLicenseNoVehicleType"
                    HeaderText="駕照類型" />
                <asp:BoundField DataField="DriverLicenseNoIssueDate" SortExpression="DriverLicenseNoIssueDate"
                    HeaderText="有效日期" DataFormatString="{0:yyyy-MM-dd}" />
                <asp:BoundField DataField="BirthDay" SortExpression="BirthDay" HeaderText="出生日期" DataFormatString="{0:yyyy-MM-dd}" />
                <asp:BoundField DataField="ServiceUnit" SortExpression="ServiceUnit" HeaderText="服务单位" />
                <asp:BoundField DataField="Education" SortExpression="Education" HeaderText="文化程度" />
                <asp:BoundField DataField="ServiceCardNO" SortExpression="ServiceCardNO" HeaderText="服务资格证" />
                <asp:BoundField DataField="ServiceCardNOFromDate" SortExpression="ServiceCardNOFromDate"
                    HeaderText="有效日期自" DataFormatString="{0:yyyy-MM-dd}" />
                <asp:BoundField DataField="ServiceCardNOToDate" SortExpression="ServiceCardNOToDate"
                    HeaderText="有效日期至" DataFormatString="{0:yyyy-MM-dd}" />
                <asp:BoundField DataField="BusID" SortExpression="BusID" HeaderText="服務車輛" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink ID="btnEdit" runat="server" NavigateUrl='<%# "javascript:OpenEdit(\"" + DataBinder.Eval(Container.DataItem,"ID") + "\");"%>'>编辑</asp:HyperLink></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="btnDelete"  OnClientClick="return confirm('你确定要删除吗？')" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID") %>'  runat="server" CommandName="Delete">刪除</asp:LinkButton></ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerTemplate>
            </PagerTemplate>
        </asp:GridView>
    </div>
    <table align="center" bgcolor="#e9e9e9" width="100%">
        <tr>
            <td style="text-align: right">
                <asp:LinkButton ID="lbtnFirst" runat="server" Text="首页" OnClick="lbtnFirst_Click" /><asp:LinkButton
                    ID="lbtnPrevious" runat="server" Text="上一页" OnClick="lbtnPrevious_Click" /><asp:LinkButton
                        ID="lbtnNext" runat="server" Text="下一页" OnClick="lbtnNext_Click" /><asp:LinkButton
                            ID="lbtnLast" runat="server" Text="末页" OnClick="lbtnLast_Click" /></td>
        </tr>
    </table>

    <script language="javascript">
				function OpenAdd(){
				location.href("BusEmployeeEdit.aspx?action=add");
				}
				function OpenEdit(ID){
				location.href("BusEmployeeEdit.aspx?action=edit"
					+ "&amp;ID=" + ID);
				}
    </script>

</asp:Content>
