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

<!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" />
<script type="text/javascript" src="/css/popcalendar.js"></script>
</head>
<body>
    <form id="form1" runat="server" >
<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>
<asp:GridView ID="gvCategories" runat="server" Width="100%" CssClass="gv" 
            cellspacing="1" BorderWidth="1px" 
                AutoGenerateColumns="False" 
        onrowcancelingedit="gvCategories_RowCancelingEdit" 
        onrowdatabound="gv_RowDataBound" onrowdeleting="gvCategories_RowDeleting" 
        onrowediting="gvCategories_RowEditing" 
        onrowupdating="gvCategories_RowUpdating" 
        onrowcreated="gvCategories_RowCreated" >
            <RowStyle  CssClass="gvrow" BorderWidth="1px" />
                <Columns>
                    <asp:BoundField DataField="id" HeaderText="序号" ReadOnly="True" />
                    
                    <asp:TemplateField HeaderText="类别名称">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("categories") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" 
                                ControlToValidate="TextBox1" ErrorMessage="类别不能为空" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
                                   <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBox1_2" runat="server" 
                    ControlToValidate="TextBox1" Display="Dynamic" 
                    ErrorMessage="请输入少于15个字符。" 
                    ValidationExpression="^[^%&gt;&lt;&amp;=\s]{1,15}$" 
                    ForeColor="Red"></asp:RegularExpressionValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBox1_3" runat="server" 
                    ControlToValidate="TextBox1" Display="Dynamic" 
                    ErrorMessage="请用汉字或字母开头。" ValidationExpression="^(?!\d)[a-zA-Z0-9\u4e00-\u9fa5]+$"                                                     
                    ForeColor="Red"></asp:RegularExpressionValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("categories") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="类别编码">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("number") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" 
                                ControlToValidate="TextBox2" ErrorMessage="类别编码不能为空" Display="Dynamic"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBox2_2" runat="server" 
                    ControlToValidate="TextBox2" Display="Dynamic" 
                    ErrorMessage="请输入少于15个字符。" 
                    ValidationExpression="^[^%&gt;&lt;&amp;=\s]{1,15}$" 
                    ForeColor="Red"></asp:RegularExpressionValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("number") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                                     <asp:TemplateField HeaderText="操作范围">
                  <ControlStyle Width="60px" />
                  <ItemTemplate>
                        <asp:DropDownList ID="ddlColumntype" runat="server" Text='<%# Eval("type").ToString()=="领用"?"领用":"借用" %>'>
                        <asp:ListItem >借用</asp:ListItem>
                        <asp:ListItem>领用</asp:ListItem>
                      </asp:DropDownList>
                  </ItemTemplate>
              </asp:TemplateField>
                    <asp:CommandField EditText="修改" HeaderText="修改" ShowEditButton="True" />
                    <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />

                    


                    
                </Columns>
            <HeaderStyle  CssClass="gvhead"  />
        </asp:GridView>
        类别名称：<asp:TextBox ID="tbAddCategories" runat="server" Width ="200px"></asp:TextBox>

                &nbsp;类别编码：<asp:TextBox ID="tbCategoriesnumber" runat="server"></asp:TextBox>

                &nbsp;<asp:DropDownList ID="ddlType" runat="server">
        <asp:ListItem Selected="True">借用</asp:ListItem>
        <asp:ListItem>领用</asp:ListItem>
    </asp:DropDownList>
&nbsp;<asp:Button ID="btAddCategories" runat="server" Text="添加" 
                    ValidationGroup="AddCategories" onclick="btAddCategories_Click" />
                      <asp:Label ID="lbMessageCategories" runat="server" ForeColor="Red"></asp:Label>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="tbAddCategories" Display="Dynamic" 
                    ErrorMessage="名称不能为空。" ValidationGroup="AddCategories" 
        ForeColor="Red"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                    ControlToValidate="tbAddCategories" Display="Dynamic" 
                    ErrorMessage="请输入少于15个字符。" 
                    ValidationExpression="^[^%&gt;&lt;&amp;=\s]{1,15}$" 
                    ValidationGroup="AddCategories" ForeColor="Red"></asp:RegularExpressionValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
                    ControlToValidate="tbAddCategories" Display="Dynamic" 
                    ErrorMessage="请用汉字或字母开头。" ValidationExpression="^(?!\d)[a-zA-Z0-9\u4e00-\u9fa5]+$" 
                                                    
        ValidationGroup="AddCategories" ForeColor="Red"></asp:RegularExpressionValidator>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" 
                    ControlToValidate="tbCategoriesnumber" Display="Dynamic" 
                    ErrorMessage="类别编码不能为空。" ValidationGroup="AddCategories" 
        ForeColor="Red"></asp:RequiredFieldValidator>
                                            &nbsp;<asp:RegularExpressionValidator 
        ID="RegularExpressionValidator15" runat="server" 
                    ControlToValidate="tbCategoriesnumber" Display="Dynamic" 
                    ErrorMessage="请输入少于15个字符。" 
                    ValidationExpression="^[^%&gt;&lt;&amp;=\s]{1,15}$" 
                    ValidationGroup="AddCategories" ForeColor="Red"></asp:RegularExpressionValidator>
        </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>