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





    <div class="action form-inline">
        <asp:Button runat="server" ID="btn_del"    OnClientClick="if(isselect()) return true; return false;" Text="删除News" CssClass="btn btn-danger" OnClick="btn_del_Click" />

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           过滤 <asp:DropDownList runat="server" ID="ddl_cat" CssClass="form-control"
               Width="200" 
               
                AppendDataBoundItems="true" AutoPostBack="true">
           <asp:ListItem Text="请选择类别" Value=""></asp:ListItem>

          </asp:DropDownList>
    </div>



    <asp:ListView ID="lv_lists" runat="server" DataKeyNames="itemid" DataSourceID="SqlDataSource1">
       
        <ItemTemplate>
            <tr style="">
                <td >
                   
                      <input type="checkbox" value="<%# Eval("itemid") %>"  class="ck_item" />
                     <asp:Label ID="itemidLabel" runat="server" Text='<%# Eval("itemid") %>' />
                </td>
                 
             
              
                <td>
                    <a href="editnews.aspx?itemid=<%# Eval("itemid") %>&mid=<%# Eval("moduleid") %>&tabid=<%# Eval("tabid") %>&newscatid=<%# Eval("catid") %>">
                 <%# Eval("title") %>   </a>
                </td>

                  <td>
                   <%# Eval("catname") %>
                </td>
             
                <td>
                 <%# DateTime.Parse(Eval("adddate").ToString()).ToString("yyyy-MM-dd HH:mm") %> 
                </td>


                <td>
                    <asp:Label ID="usernameLabel" runat="server" Text='<%# Eval("username") %>' />
                </td>

                   <td>
                    <asp:Label ID="clickLabel" runat="server" Text='<%# Eval("click") %>' />
                </td>
            </tr>
        </ItemTemplate>



        <LayoutTemplate>
           
      <table id="itemPlaceholderContainer" runat="server"  class="table table-hover">
                            <tr runat="server" >
                                <th runat="server" width="90px">ID
                                     <input type="checkbox"  class="ck_all" onclick="selectall(this);"  />


                                </th>
                                    
                              
                            
                                <th runat="server">标题</th>
                           
                                   <th runat="server" width="120px">类别</th>

                                  <th runat="server">发布日期</th>
                                <th runat="server" width="120px">发布人</th>
                                  <th runat="server" width="80px">点击</th>

                            </tr>
                            <tr id="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                   
        </LayoutTemplate>
        
    </asp:ListView>





    
<div>
 <asp:DataPager ID="DataPager1"   class="btn-group btn-group-sm" EnableViewState="false"
      QueryStringField="Page" PagedControlID="lv_lists" runat="server" PageSize=15>
 <Fields>
           
     
            <asp:NextPreviousPagerField 
                PreviousPageText="<" 
                FirstPageText="|<" 
                ShowPreviousPageButton="true"
                ShowFirstPageButton="true" 
                ShowNextPageButton="false" 
                ShowLastPageButton="false"
                ButtonCssClass="btn btn-default" 
                RenderNonBreakingSpacesBetweenControls="false" 
                RenderDisabledButtonsAsLabels="false" />

            <asp:NumericPagerField 
                ButtonType="Link" 
                CurrentPageLabelCssClass="btn btn-primary disabled"  
                RenderNonBreakingSpacesBetweenControls="false"
                NumericButtonCssClass="btn btn-default" 
                ButtonCount="10" 
                NextPageText="..." 
                NextPreviousButtonCssClass="btn btn-default" />
            
           <asp:NextPreviousPagerField 
               NextPageText=">" 
               LastPageText=">|" 
               ShowNextPageButton="true"
               ShowLastPageButton="true" 
               ShowPreviousPageButton="false" 
               ShowFirstPageButton="false"
               ButtonCssClass="btn btn-default" 
               RenderNonBreakingSpacesBetweenControls="false" 
               RenderDisabledButtonsAsLabels="false"/>
      

  </Fields> 
</asp:DataPager>
</div>




    <asp:SqlDataSource ID="SqlDataSource1" 
         SelectCommand=" select itemid, tabid, click, adddate, title, catid, catname ,  moduleid, username  from  v_news where isdeleted=0 and (@catid='' or catid=@catid) order by itemid desc "
         ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        
        runat="server" ProviderName="System.Data.SqlClient">

        <SelectParameters>
            <asp:ControlParameter ControlID="ddl_cat" ConvertEmptyStringToNull="false"  Name="catid"/>
        </SelectParameters>


    </asp:SqlDataSource>


    
        <input type="hidden" name="hf_ids" id="hf_ids" />
  





</asp:Content>
