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

<!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/admincss/skin.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            color: #FF0000;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server" defaultfocus ="tbAddDepartment">
<div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class ="top_bg_left "></td>
    <td  class ="top_bg_center " >
    <table style ="width :100%; height :31px"  border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
      
<!--这里写页标题 -->
        <td style ="height :31px"><div class="titlebt">系统设置</div></td>
      </tr>
    </table>
    </td> 
    <td class ="top_bg_right "></td>
  </tr>
  <tr>
    <td style ="background :url(/css/admincss/images/mail_leftbg.gif); vertical-align :middle " >&nbsp;</td>
    <td style ="background-color :#F7F8F9; vertical-align :top " >

<!--  一组内容模块开始   --> 
    <table class ="tablezong"   border="0"  cellpadding="0" cellspacing="0">
      <tr>
        <td style ="height :40px" >
        <table class="tablebiaoti"  border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td><div class ="biaotileft ">  
                下属机构设置</div> </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td>
<div >
        <table border = "0" class ="table_noborder" cellpadding ="0" cellspacing ="0" style ="width :100%">
            <tr>
                <td class =" td_leftnoborder   " style =" vertical-align :top; width:30%; padding-right :5%;">
                <asp:TextBox ID="tbAddDepartment" runat="server" Width ="150px"></asp:TextBox>
                                            &nbsp;                <asp:Button ID="btAddDepartment" runat="server" Text="添加" 
                    ValidationGroup="AddDeparment" onclick="btAddDepartment_Click" />
                                            
                    <div style ="padding :3px"> 
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="tbAddDepartment" Display="Dynamic" 
                    ErrorMessage="名称不能为空。" ValidationGroup="AddDeparment" ForeColor="Red"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="tbAddDepartment" Display="Dynamic" 
                    ErrorMessage="请输入2-15个字符。" 
                    ValidationExpression="^[^%&gt;&lt;&amp;=\s]{2,15}$" 
                    ValidationGroup="AddDeparment" ForeColor="Red"></asp:RegularExpressionValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                    ControlToValidate="tbAddDepartment" Display="Dynamic" 
                    ErrorMessage="请用汉字或字母开头。" ValidationExpression="^(?!\d)[a-zA-Z0-9\u4e00-\u9fa5]+$" 
                                                    ValidationGroup="AddDeparment" ForeColor="Red"></asp:RegularExpressionValidator>
                                          
                       </div>
                       <div>说明：<br />
                           1. 修改机构将同步更新人员表中的信息；<br />
                           2.
                           删除机构时，如果此机构没有成员则直接删除，如果有成员，则所属机构变为“未设置”。</div>
    
                </td>
                <td class ="td_leftnoborder " style =" vertical-align :top ">
                     <asp:GridView ID="GridView1" runat="server" 
            onrowdeleting="GridView1_RowDeleting" 
                BorderWidth="1px" CssClass="gv" Width="100%" cellspacing="1" 
                AutoGenerateColumns="False" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating">
            <RowStyle BorderWidth="1px" CssClass="gvrow" />
            <Columns>
          
                <asp:TemplateField HeaderText="机构名称">
                    <EditItemTemplate>
                 
                       原名称：  <asp:Label ID="lbEdep" runat="server" Text='<%# Bind("department") %>'></asp:Label>
                        修改为：<asp:TextBox ID="tbEdep" runat="server"></asp:TextBox>
                          <div style ="padding :3px"> 
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="tbEdep" Display="Dynamic" 
                    ErrorMessage="名称不能为空。" ValidationGroup="Edit" ForeColor="Red"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="tbEdep" Display="Dynamic" 
                    ErrorMessage="请输入2-15个字符。" 
                    ValidationExpression="^[^%&gt;&lt;&amp;=\s]{2,15}$" 
                    ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                    ControlToValidate="tbEdep" Display="Dynamic" 
                    ErrorMessage="请用汉字或字母开头。" ValidationExpression="^(?!\d)[a-zA-Z0-9\u4e00-\u9fa5]+$" 
                                                    ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                                          
                       </div>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Vdep" runat="server" Text='<%# Bind("department") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="修改" ShowHeader="False">
                    <EditItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="更新" ValidationGroup="Edit"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="取消"></asp:LinkButton>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="编辑"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
            </Columns>
            <HeaderStyle BorderWidth="1px" CssClass="gvhead" />
        </asp:GridView>
                                   </td>
            </tr>
       
        </table>
            </div>
             </td>
      </tr>
    </table>
<!-- 一组内容模块结束 -->
   </td>
    <td  style =" background-image:url(/css/admincss/images/mail_rightbg.gif )" >
    </td>
  </tr>
  <tr>
    <td  class ="buttom_bg_left "></td>
    <td class ="buttom_bg_center " ></td>
    <td  class ="buttom_bg_right " ></td>
  </tr>
</table>
    </div>
    </form>
</body>
</html>
