<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="AnnounceCat.aspx.cs" Inherits="Portal.Admin.AnnounceCat" %>
 
<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" ValidationGroup="vg_catname" CssClass="form-control"  runat="server"></asp:TextBox>
          <asp:RequiredFieldValidator Display="Dynamic" ValidationGroup="vg_catname" ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="catname"></asp:RequiredFieldValidator>

         </td>
        </tr>
        
        <tr>
        <th>顺序序号</th>
        <td>
        <asp:TextBox ID="txt_orderid" ValidationGroup="vg_catname" CssClass="form-control" runat="server" Text="0"></asp:TextBox> 
        
        </td>
        </tr>

        <tr>
        <td colspan="2">
        
        <div class="btnc">
        
            <asp:Button ID="btn_submits"  ValidationGroup="vg_catname"  runat="server" Text="添加" CssClass="btn btn-primary" onclick="btn_submits_Click"  />

   <asp:Button ID="btn_cancel" runat="server" onclick="cancel_Click" CausesValidation="false"  Text="返回" CssClass="btn"/>

    
 
        </div>
        </td>
        
        </tr>

        </table>







          

  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  
 CssClass="table" GridLines="None"  
        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="catname" 
              SortExpression="catname" ItemStyle-Width="280px"/>
          <asp:BoundField DataField="orderid" HeaderText="orderid" 
              SortExpression="orderid" ItemStyle-Width="80px"/>


          <asp:BoundField DataField="opusername" HeaderText="操作者" 
              SortExpression="opusername"  ReadOnly="true"  ItemStyle-Width="100px"/>


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

            <asp:TemplateField>
            <HeaderTemplate>权限设置</HeaderTemplate>
            <ItemTemplate>
                 <a target="_blank" href="../portal/tabsecrity.aspx?tabid=<%#Eval("id") %>&sectype=announcecat">设置类别权限</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_Announcementscat] WHERE [id] = @id"   
         onselecting="SqlDataSource1_Selecting"
         onupdating="SqlDataSource1_Updating"
         SelectCommand="SELECT * FROM [Portal_Announcementscat]  where moduleid=@moduleid ORDER BY [orderid] asc " 
         UpdateCommand="UPDATE [Portal_Announcementscat] SET [catname] = @catname, [orderid] = @orderid,opusername=@opusername WHERE [id] = @id" 
       >
       
       
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        
         <SelectParameters>
          <asp:Parameter Name="moduleid" Type="Int32"  DefaultValue="0"/>
       </SelectParameters>
       
        <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>
</asp:Content>
