<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Doc_Files.aspx.cs" Inherits="Portal.Admin.Doc_Files" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <script src="../javascript/jquery-1.9.1.min.js" type="text/javascript"></script>

    <script src="../bootstrap/js/bootstrap.min.js"></script>


    <script src="../Javascript/common.js"></script>



</head>
<body style="margin:15px">
    <form id="form1" runat="server">
    <div>
    

        
    <div class="action form-inline">
      
    &nbsp;&nbsp;&nbsp;
        <b>
        <asp:Label runat="server" ID="lbl_foldername"></asp:Label></b>  内容列表

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        文档名 <asp:TextBox runat="server" ID="txt_filename" CssClass="form-control" style="display:inline-block"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" CssClass="btn btn-primary" Text="查找" />

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


    </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="../portal/binn.ashx?id=<%# Eval("itemid") %>&guid=<%# Eval("guid") %>" target="_blank">
                 <%# Eval("filename") %>   </a>
                </td>

                  <td>
                   <%# Eval("foldername") %>
                </td>
             
                <td>
                 <%# DateTime.Parse(Eval("createdate").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 portal_pagedoc.createdate, click, portal_pagedoc.id as itemid, username,filename, contenttype, treeid,mid, pagename as foldername, guid from portal_pagedoc
left  join portal_pages  on portal_pagedoc.treeid=portal_pages.id   where isdelete=0 and (@catid='' or treeid=@catid) and (@filename='' or filename like '%'+@filename+'%') order by portal_pagedoc.id desc "
         ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        
        runat="server" ProviderName="System.Data.SqlClient">

        <SelectParameters>
      
          <asp:QueryStringParameter Name="catid" ConvertEmptyStringToNull="false" QueryStringField="treeid" /> 
         <asp:ControlParameter ControlID="txt_filename" ConvertEmptyStringToNull="false"  Name="filename"/>

        </SelectParameters>


    </asp:SqlDataSource>


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
















    </div>
    </form>
</body>
</html>
