<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="DocCategory.aspx.cs" Inherits="Portal.Admin.DocCategory" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  
<div class="result-wrap">

    <div class="result-title">
                <h1>文档类别管理</h1>
            </div>
          
            <table class="table">
         <tr>
         <th width=150px>类别名称</th>
         <td>
               <asp:TextBox ID="catname" Width="300px" CssClass="form-control"  runat="server"></asp:TextBox>
        
         </td>
        </tr>


         <tr>
         <th width=150px>类别顺序</th>
         <td>
          <asp:TextBox ID="txt_orderid" Text="0"  Width="300px" CssClass="form-control" runat="server"></asp:TextBox> 
         </td>
        </tr>




         <tr>
        <td colspan="2">
        
        <div class="btnc">
        

  
    <asp:Button ID="btn_add" runat="server" Text="添加" onclick="btn_add_Click"  CssClass="btn btn-primary"/>

   <asp:Button ID="btn_back" runat="server" onclick="Button2_Click" Text="返回" CssClass="btn"/>
        </div>
        </td>
        
        </tr>

        </table>



  

  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"   
      Width="100%" CssClass="result-tab"   
        DataKeyNames="id" DataSourceID="SqlDataSource1">
      <Columns>
 
          <asp:BoundField DataField="id" HeaderText="ID号" InsertVisible="False" 
              ReadOnly="True" SortExpression="id" ItemStyle-Width="90px" />
          <asp:BoundField DataField="catname" HeaderText="类别名称" 
              SortExpression="catname" ItemStyle-Width="280px"/>
          <asp:BoundField DataField="orderid" HeaderText="顺序ID" 
              SortExpression="orderid" ItemStyle-Width="80px"/>


                      <asp:BoundField DataField="opusername" HeaderText="操作者" 
              SortExpression="opusername"  ReadOnly="true"/>


             <asp:BoundField DataField="moduleid" ReadOnly="true"  Visible="false"  HeaderText="moduleid" 
              SortExpression="moduleid" />


     <asp:TemplateField>
            <HeaderTemplate>权限设置</HeaderTemplate>
            <ItemTemplate>
                <a target="_blank" href="../portal/tabsecrity.aspx?tabid=<%#Eval("id") %>&sectype=doccat">设置类别权限</a>
            </ItemTemplate>
            </asp:TemplateField>

             <asp:CommandField HeaderText="操作" EditText="编辑" DeleteText="<span onclick=&quot;JavaScript:return confirm('确定删除吗？')&quot;>删除</span> "  UpdateText="更新"  CancelText="取消" ShowDeleteButton="True" ShowEditButton="True" />
      </Columns>
       
    
    
    </asp:GridView>
   
   
   
    <asp:SqlDataSource 
      ConnectionString="<%$ ConnectionStrings:ConnectionString %>"    
      ID="SqlDataSource1" 
      runat="server" 
        DeleteCommand="DELETE FROM [portal_documentscat] WHERE [id] = @id" 
        SelectCommand="SELECT * FROM [portal_documentscat]  where moduleid=@moduleid ORDER BY [orderid] asc " 
        
        UpdateCommand=" UPDATE [portal_documentscat] SET [catname] = @catname, [orderid] = @orderid, opusername=@opusername WHERE [id] = @id" 
        onselecting="SqlDataSource1_Selecting" 
        onupdating="SqlDataSource1_Updating">
       
       <SelectParameters>
          <asp:Parameter Name="moduleid" Type="Int32"  DefaultValue="0"/>
       </SelectParameters>
       
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
       
        <UpdateParameters>
            <asp:Parameter Name="catname" Type="String" />
            <asp:Parameter Name="orderid" Type="Int32" />
            <asp:Parameter Name="id" Type="Int32" />
             <asp:Parameter Name="opusername" Type="String" />
        </UpdateParameters>
       
    </asp:SqlDataSource>
    
    </div>
    
    
</asp:Content>
