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

<%@ Register TagPrefix="cc1" Namespace="Focus.Control" Assembly="Focus.Control" %>
<%@ Import Namespace="Focus.Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>上传附件管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="styles/fntmanager.css" type="text/css" rel="stylesheet">
    <link href="styles/datagrid.css" type="text/css" rel="stylesheet">

    <script type="text/javascript" src="js/common.js"></script>

    <meta content="MSHTML 6.00.3790.0" name="GENERATOR">
</head>
<body leftmargin="5" topmargin="5" rightmargin="5" bottommargin="5">
    <form id="Form1" runat="server">
    <div class="Navbutton" style="width: 98%;">
        <table cellspacing="1" cellpadding="4" align="left" class="table1">
            <tbody>
                <tr>
                    <td align="left">
                        <input title="选中/取消选中 本页所有Case" onclick="CheckAll(this.form)" type="checkbox" name="chkall"
                            id="chkall" />全选/取消全选
                        <cc1:Button ID="DeleteAttachment" runat="server" Text=" 删除选中附件 " ButtonImgUrl="images/dell.gif"
                            OnClick="DeleteAttachment_Click"></cc1:Button>
                        <cc1:Button ID="DeleteAll" runat="server" Text=" 删除所有附件" ButtonImgUrl="images/del.gif"
                            OnClick="DeleteAll_Click"></cc1:Button>
                        <cc1:Button ID="Button1" runat="server" Text=" 清理垃圾附件" ButtonImgUrl="images/pi.gif"
                            OnClick="Button1_Click"></cc1:Button>&nbsp;
                        <button type="button" class="ManagerButton" onclick="window.location='attchmentsearch.aspx';">
                            <img src="images/search.gif" />
                            搜 索
                        </button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <cc1:DataGrid ID="DataGrid1" runat="server" OnPageIndexChanged="DataGrid_PageIndexChanged"
        OnSortCommand="Sort_Grid" AllowPaging="true" PageSize="20">
        <Columns>
            <asp:TemplateColumn HeaderText="选择">
                <ItemTemplate>
                    <input id="aid" onclick="javascript:SH_SelectOne(this)" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.aid").ToString() %>"
                        name="aid" />
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="aid" SortExpression="aid" HeaderText="文件id" Visible="false">
            </asp:BoundColumn>
            <asp:TemplateColumn ItemStyle-HorizontalAlign="Left" HeaderText="文件原名">
                <ItemTemplate>
                    <a href="<%=webpath %>upload/<%# DataBinder.Eval(Container, "DataItem.filename").ToString() %>"
                        target="_blank"><img src="<%# GetFileTypeIco(DataBinder.Eval(Container, "DataItem.attachment").ToString())%>" style="vertical-align:middle" border=0 />&nbsp;
                        <%# DataBinder.Eval(Container, "DataItem.attachment").ToString()%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn ItemStyle-HorizontalAlign="center" HeaderText="大小">
                <ItemTemplate>
                    <%# Utils.FormatBytesStr(Utils.StrToInt(DataBinder.Eval(Container, "DataItem.filesize").ToString(),0))%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="postdatetime" SortExpression="postdatetime" HeaderText="上传时间">
            </asp:BoundColumn>
            <asp:BoundColumn DataField="username" SortExpression="username" HeaderText="上传者">
            </asp:BoundColumn>
            <asp:BoundColumn DataField="sortname" SortExpression="sortname" HeaderText="所在栏目">
            </asp:BoundColumn>
            <asp:TemplateColumn ItemStyle-HorizontalAlign="center" HeaderText="所在主题">
                <ItemTemplate>
                    <%#GetTitle(Utils.StrToInt(DataBinder.Eval(Container, "DataItem.sortid").ToString(),0),Utils.StrToInt(DataBinder.Eval(Container, "DataItem.tid").ToString(),0))%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="操作" ItemStyle-HorizontalAlign="center">
                <ItemTemplate>
                    <a href="downloads.ashx?url=<%=webpath %>upload/<%# DataBinder.Eval(Container, "DataItem.filename").ToString() %>">[下载]</a>
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
    </cc1:DataGrid>
    </form>
</body>
</html>
