<%@ Page Title="" Language="C#" MasterPageFile="Admin.Master" AutoEventWireup="true" CodeBehind="NewsCategory.aspx.cs" Inherits="Portal.Admin.NewsCategory" %>
<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" 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="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="Button1" ValidationGroup="vg_catname" CssClass="btn btn-primary" runat="server" Text="添加" onclick="Button1_Click"   />


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

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

        </table>

 
  

    <asp:GridView ID="GridView1" AutoGenerateColumns="false"  
    DataKeyNames="catid" runat="server"  CssClass="table"  GridLines="None" 
    DataSourceID="ObjectDataSource1">
    
    <Columns>
  
    <asp:BoundField DataField="catid"  ReadOnly="true"  HeaderText="类别ID" ItemStyle-Width="90px" /> 
    <asp:BoundField DataField="catname"   HeaderText="类名名称" ItemStyle-Width="280px"/>
    <asp:BoundField DataField="orderid"   HeaderText="顺序ID"  ItemStyle-Width="80px" />
   <asp:BoundField DataField="opusername" HeaderText="操作者"  ReadOnly="true"    SortExpression="opusername" ItemStyle-Width="100px" />


         <asp:TemplateField>
            <HeaderTemplate>权限设置 
               <a target="_blank"  href="http://www.cnblogs.com/mqingqing123/p/3859385.html"><i class="icon-font">&#xe023;</i></a>
            </HeaderTemplate>
            <ItemTemplate>
              <a target="_blank" href="../portal/tabsecrity.aspx?tabid=<%#Eval("catid") %>&sectype=newscat">设置类别权限</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:ObjectDataSource ID="ObjectDataSource1" runat="server"
     TypeName="Portal.BLL.NewsHelper"
     SelectMethod="GetNewsCategory"
     DeleteMethod="DeleteNewsCategory"
     UpdateMethod="UpdateNewsCategory"    
    >
    
    <SelectParameters>
     <asp:QueryStringParameter   QueryStringField="mid" Name="moduleid" />
     <asp:Parameter DefaultValue="-1" Name="uid" Type="Int32" />
    </SelectParameters>
    
   
   
   <UpdateParameters>
       <asp:Parameter    Name="catid" Type="Int32" />
       <asp:Parameter   Name="catname" Type="String" />
       <asp:Parameter    Name="orderid" Type="String" />
   </UpdateParameters>
    
    
    <DeleteParameters>
    <asp:Parameter Name="catid" Type="Int32"  />
    </DeleteParameters>
    
    </asp:ObjectDataSource>





   </div>


</asp:Content>
