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


    


    <div class="action form-inline">
        <asp:Button runat="server" ID="btn_del"    OnClientClick="if(isselect()) return true; return false;" Text="删除Announce" 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>

        过滤部门
        <asp:DropDownList runat="server" ID="ddl_dept" 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="EditAnnouncements.aspx?itemid=<%# Eval("itemid") %>&catid=<%# Eval("catid") %>">
                 <%# Eval("title") %>   </a>
                </td>

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


                <td>
                    <asp:Label ID="usernameLabel" runat="server" Text='<%# Eval("releasedepartment") %>' />
                </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,  Title, createdate, releasedepartment, username, click, catid, catname  from v_Announcements   where  (@catid='' or catid=@catid) and (@dept='' or releasedepartment=@dept) order by itemid desc "
         ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        
        runat="server" ProviderName="System.Data.SqlClient">

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


    </asp:SqlDataSource>


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








</asp:Content>
