<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="staff_manage.aspx.cs" Inherits="Web.yw.staff_manage" %>

<!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 id="Head1" runat="server">
    <title>OA标题页</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            padding: 4px;
            text-align: right;
            vertical-align: middle;
            height: 33px;
        }
        .style2
        {
            padding: 4px;
            text-align: left;
            vertical-align: middle;
            height: 33px;
        }
    </style>
</head>
<body>
    <form id="fom" runat="server">
        <div id ="main-c-03-right" >
            <table cellpadding="0"; cellspacing ="0"; style =" width :100%;background-image: url('../css/images/right_top.png'); background-repeat :repeat-x" >
                <tr>
      <td class  ="main-c-03-right02-top">
                	   <!--这里添加页面标题 -->
                      	员工管理
              </td>
                </tr>
            </table>
            <div id="main-c-03-right02-main">
            <asp:Panel ID="Panel3" runat="server">
<!--栏目开始 -->
            

            <div style =" text-align :right ;"> 
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                ControlToValidate="tbNum" Display="Dynamic" ErrorMessage="行数不能为空。" 
                                                ValidationGroup="RowNum" ForeColor="Red"></asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                                ControlToValidate="tbNum" Display="Dynamic" ErrorMessage="请输入大于0的整数。" 
                                                ValidationExpression="^\+?[1-9][0-9]*$" 
                    ValidationGroup="RowNum" ForeColor="Red"></asp:RegularExpressionValidator>
            每页显示行数：<asp:TextBox ID="tbNum" runat="server" 
                    Width="44px" MaxLength="4"></asp:TextBox>&nbsp; <asp:Button ID="btnQuery" runat="server" onclick="tijiao_Click" Text="确定" ToolTip="RowNum" 
                           ValidationGroup="RowNum" />    
            
            
            </div>


            <!--这里添加内容 -->
            <div>部门：<asp:DropDownList ID="ddlDepartment" runat="server">
            </asp:DropDownList>
                &nbsp;人员编号/登录名/智能卡/姓名：<asp:TextBox ID="tbStaff" runat="server" 
                Width="150px"></asp:TextBox>
            &nbsp;
            <asp:Button ID="tijiao" runat="server" CausesValidation="False" 
                 onclick="tijiao_Click" Text="提交" ValidationGroup="RowNum" />
                &nbsp;<asp:Label ID="lbRowscountview" runat="server" ForeColor="Red"></asp:Label>
                <br />
                （支持姓名模糊查询，为空则查询所有人员）<div style ="margin-bottom :6px; margin-top :6px">
           <asp:GridView ID="GridView1" 
                  runat="server" BorderWidth="1px" onrowdatabound="GridView1_RowDataBound" 
                Width="100%" CssClass="gv" AutoGenerateColumns="False" 
                        onrowcreated="GridView1_RowCreated" onrowdeleting="GridView1_RowDeleting" >
                <RowStyle BorderWidth="1px" CssClass="gvrow" />
                <Columns>
                 <asp:BoundField DataField="id" HeaderText="序号" ReadOnly="True" />
                <asp:BoundField DataField="人员编号" HeaderText="人员编号" ReadOnly="True" />
                <asp:BoundField DataField="登录名" HeaderText="登录名" ReadOnly="True" />
                <asp:BoundField DataField="智能卡" HeaderText="智能卡" ReadOnly="True" />
                <asp:BoundField DataField="姓名" HeaderText="姓名" ReadOnly="True" />
                <asp:BoundField DataField="部门" HeaderText="部门" ReadOnly="True" />
                <asp:BoundField DataField="权限" HeaderText="权限" ReadOnly="True" />
                <asp:BoundField DataField="电话" HeaderText="电话" ReadOnly="True" />
                <asp:BoundField DataField="邮箱" HeaderText="邮箱" ReadOnly="True" />
                <asp:BoundField DataField="帐号状态" HeaderText="帐号状态" ReadOnly="True" />
                <asp:BoundField DataField="在职状态" HeaderText="在职状态" ReadOnly="True" />
                    <asp:CommandField HeaderText="操作" DeleteText="修改" ShowDeleteButton="True" />
                </Columns>
                <HeaderStyle BorderWidth="1px" CssClass="gvhead" />
            </asp:GridView></div> 
            </div>
            <table cellpadding="0" cellspacing="0" style ="width :100%">
              <tr>
                  <td style =" padding-left :5px; text-align :left  ">
                      
                  </td>
                  <td  id ="allowpage" runat ="server" style ="text-align :right ;  padding-right  :5px">
                      &nbsp;</td>
              </tr>
          </table>
            <asp:Panel ID="plOutput" runat="server" Visible ="false" >
            <div class =" td_rightnoborder  ">      
                <asp:Button ID="btPrintView" runat="server" onclick="btPrintView_Click" 
                    Text="打印预览" />
                <asp:Button ID="btExcel" runat="server" Text="导出到EXCEL" 
                  onclick="btExcel_Click"  />
                  </div>
              </asp:Panel>
              

<!--栏目结束 -->
               
<!--栏目开始 -->
         <asp:Panel ID="Panel4" runat="server">

                        <!--这里添加内容 -->
                        <table border="1"  style=" width :700px" class ="table" cellpadding ="0" cellspacing ="0">
            <tr>
                <td  class ="tabletd_left " colspan="2">
                   添加员工：</td>
            </tr>
                            <tr>
                                <td class="tabletd_right " style="width :100px">
                                    人员编号</td>
                                <td class="tabletd_left ">
                                    <asp:TextBox ID="tbAddStaffId" runat="server" MaxLength="25" Width="130px"></asp:TextBox>
                                    <span style="color :Red ">（必填）</span><asp:RequiredFieldValidator 
                                        ID="RequiredFieldValidator11" runat="server" ControlToValidate="tbAddStaffId" 
                                        Display="Dynamic" ErrorMessage="人员编号不能为空。" ForeColor="Red" 
                                        ValidationGroup="Add"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                                        ControlToValidate="tbAddStaffId" Display="Dynamic" ErrorMessage="请输入2-25个合法字符。" 
                                        ForeColor="Red" ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{2,25}$" 
                                        ValidationGroup="Add"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
            <tr>
                <td class ="tabletd_right ">
                    登录名</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbAddLoginName" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                        ControlToValidate="tbAddLoginName" Display="Dynamic" 
                        ErrorMessage="请输入2-20个合法字符。" 
                        ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{2,20}$" 
                        ValidationGroup="Add" ForeColor="Red"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class ="tabletd_right ">
                    密码</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbAddPassword" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                    <span style ="color :Red ">（必填）</span><asp:RequiredFieldValidator 
                        ID="RequiredFieldValidator13" runat="server" 
                        ControlToValidate="tbAddPassword" Display="Dynamic" ErrorMessage="密码不能为空。" 
                        ValidationGroup="Add" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
                        ControlToValidate="tbAddPassword" Display="Dynamic" 
                        ErrorMessage="请输入6-20个合法字符。" 
                        ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{6,20}$" 
                        ValidationGroup="Add" ForeColor="Red"></asp:RegularExpressionValidator>
                </td>
            </tr>
                            <tr>
                                <td class="tabletd_right ">
                                    智能卡</td>
                                <td class="tabletd_left ">
                                    <asp:TextBox ID="tbAddCardid" runat="server" MaxLength="50" Width="214px"></asp:TextBox>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator16" 
                                        runat="server" ControlToValidate="tbAddCardid" Display="Dynamic" 
                                        ErrorMessage="请输入少于50个合法字符。" 
                                        ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{0,50}$" 
                                        ValidationGroup="Add" ForeColor="Red"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
            <tr>
                <td class ="tabletd_right ">
                    姓名</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbAddStaffName" runat="server" MaxLength="25" Width="130px"></asp:TextBox>
                    <span  style ="color :Red ">（必填）</span><asp:RequiredFieldValidator 
                        ID="RequiredFieldValidator14" runat="server" 
                        ControlToValidate="tbAddStaffName" Display="Dynamic" ErrorMessage="姓名不能为空。" 
                        ValidationGroup="Add" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
                        ControlToValidate="tbAddStaffName" Display="Dynamic" 
                        ErrorMessage="请输入2-25个合法字符。" 
                        ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{2,25}$" 
                        ValidationGroup="Add" ForeColor="Red"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class ="tabletd_right ">
                    部门</td>
                <td class ="tabletd_left ">
                    <asp:DropDownList ID="ddlAddDepartment" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class ="tabletd_right ">
                    电话</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbAddTel" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator15" 
                        runat="server" ControlToValidate="tbAddTel" Display="Dynamic" 
                        ErrorMessage="请输入正确的电话号码。" 
                        ValidationExpression="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$" 
                        ValidationGroup="Add" ForeColor="Red"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class ="tabletd_right ">
                    邮箱</td>
                <td class ="tabletd_left">
                    <asp:TextBox ID="tbAddEmail" runat="server" MaxLength="100" Width="130px"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator14" 
                        runat="server" ControlToValidate="tbAddEmail" Display="Dynamic" 
                        ErrorMessage="请输入正确的邮箱。" 
                        ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*.[a-zA-Z0-9]{2,7}" 
                        ValidationGroup="Add" ForeColor="Red"></asp:RegularExpressionValidator>
                </td>
            </tr>
              <tr>
                  <td class="tabletd_right">
                      &nbsp;</td>
                  <td class="tabletd_left ">
                      <asp:Button ID="btAdd" runat="server" onclick="btAdd_Click" Text="添加" 
                          ValidationGroup="Add" />
                  </td>
              </tr>
            </table>
                               </asp:Panel>          
<!--栏目结束 -->
        </asp:Panel>   
        
<!--栏目开始 -->
        <asp:Panel ID="Panel2" runat="server" Visible="False">
            <!--这里添加内容 -->
            <table  style =" width :700px" border = "1" class ="table " cellpadding ="0" cellspacing ="0">
                <tr>
                    <td class ="tabletd_left " colspan="2" >
                       人员修改：</td>
                </tr>
                <tr>
                    <td class="tabletd_right " style=" width :100px">
                        人员编号</td>
                    <td class="tabletd_left ">
                        <asp:Label ID="lbEditStaffId" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td  class ="tabletd_right ">
                        登录名</td>
                    <td class ="tabletd_left ">
                        <asp:TextBox ID="tbEditLoginName" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator9" runat="server" 
                            ControlToValidate="tbEditLoginName" Display="Dynamic" 
                            ErrorMessage="请输入2-20个合法字符。" 
                            ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{2,20}$" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td  class ="tabletd_right ">
                        密码</td>
                    <td class ="tabletd_left " style="color: #FF0000">
                                         <asp:TextBox ID="tbEditPassword" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                                         密码不修改请留空。<asp:RegularExpressionValidator ID="RegularExpressionValidator10" 
                            runat="server" ControlToValidate="tbEditPassword" Display="Dynamic" 
                            ErrorMessage="请输入6-20个合法字符。" 
                            ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{6,20}$" 
                            ValidationGroup="btPassword"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class="tabletd_right ">
                        智能卡</td>
                    <td class="tabletd_left " style="color: #FF0000">
                        <asp:TextBox ID="tbEditCardid" runat="server" MaxLength="50" Width="214px"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator17" 
                            runat="server" ControlToValidate="tbEditCardid" Display="Dynamic" 
                            ErrorMessage="请输入少于50个合法字符。" 
                            ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{0,50}$" 
                            ValidationGroup="Edit"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right ">
                        姓名</td>
                    <td class ="tabletd_left ">
                        <asp:TextBox ID="tbEditStaffName" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" 
                            ControlToValidate="tbEditStaffName" Display="Dynamic" ErrorMessage="姓名不能为空。" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator11" 
                            runat="server" ControlToValidate="tbEditStaffName" Display="Dynamic" 
                            ErrorMessage="请输入2-25个合法字符。" 
                            ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{2,25}$" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right ">
                        部门</td>
                    <td class ="tabletd_left ">
                        <asp:DropDownList ID="ddlEditDepartment" runat="server">
                        </asp:DropDownList>
                        <asp:Label ID="lbEditDepartment" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right ">
                        电话</td>
                    <td class ="tabletd_left">
                        <asp:TextBox ID="tbEditTel" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator12" 
                            runat="server" ControlToValidate="tbEditTel" Display="Dynamic" 
                            ErrorMessage="请输入正确的电话号码。" 
                            ValidationExpression="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class ="style1">
                        邮箱</td>
                    <td class ="style2">
                        <asp:TextBox ID="tbEditEmail" runat="server" MaxLength="100" Width="130px"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator13" 
                            runat="server" ControlToValidate="tbEditEmail" Display="Dynamic" 
                            ErrorMessage="请输入正确的邮箱。" 
                            ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*.[a-zA-Z0-9]{2,7}" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right ">
                        账号状态</td>
                    <td class ="tabletd_left ">
                        <asp:DropDownList ID="ddlEditZhuangtai" runat="server">
                            <asp:ListItem Selected="True">正常</asp:ListItem>
                            <asp:ListItem>禁用</asp:ListItem>
                            <asp:ListItem>锁定</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Label ID="lbEditZhuangtai" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="tabletd_right ">
                        状态</td>
                    <td class="tabletd_left ">
                        <asp:DropDownList ID="ddlEditLoginSelect" runat="server">
                            <asp:ListItem Selected="True">全部允许</asp:ListItem>
                            <asp:ListItem>仅人员编号登录</asp:ListItem>
                            <asp:ListItem>仅登录名登录</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Label ID="lbEditLoginSelect" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="tabletd_right ">
                        <asp:Label ID="lbEditId" runat="server" Visible="False"></asp:Label>
                    </td>
                    <td class="tabletd_left ">
                        <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="提交修改" 
                            ValidationGroup="Edit" />
                    </td>
                </tr>
            </table>
 </asp:Panel>
<!--栏目结束 -->
                </div>
            </div>
        </form>
    </body>
</html>

