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

    <div class="alert alert-danger">
        <b>如何建立文档库</b>在“<a href=Tabs.aspx>页面管理</a>”新建页面，点击“模块配置”添加“页面Pages”模块。单击预览，再单击顶部“编辑页面”进入编辑模式，单击“创建页面Pages”，选择“空白文档库(PageDoc)”，
        输入文档库名称，即可建立文档库目录。在页面里单击左边文档节点，在右边选择“上传文件”即可。

        <a href="http://www.cnblogs.com/mqingqing123/p/3864810.html" target="_blank">详细介绍</a>
    </div>


    

    <div class="action form-inline">
      
    &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>

        &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:ControlParameter ControlID="ddl_cat" ConvertEmptyStringToNull="false"  Name="catid"/>
         <asp:ControlParameter ControlID="txt_filename" ConvertEmptyStringToNull="false"  Name="filename"/>

        </SelectParameters>


    </asp:SqlDataSource>


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

























</asp:Content>
