<%@ Page Language="C#" AutoEventWireup="true" CodeFile="inbox.aspx.cs" Inherits="general_email_inbox" %>

<%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">--%>
<html >
<head runat="server">
    <title>收件箱</title>
    <link rel="stylesheet" type="text/css" href="./../../styles/1/style.css">
</head>
<body class="bodycolor">

<script language="JavaScript">
var x_open_path =""; //设置图标地址
</script>
<script language="JavaScript" src="x_open.js"></script>
    <form id="form1" runat="server">
        <div style="text-align:center;">
            <table style="text-align:left;" border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
                <tr>
                    <td class="Big">
                        <img src="~/images/menu/inbox.gif" width="22" height="18" align="absmiddle" id="IMG5"
                            runat="server"><span class="big3"> 收件箱</span>
                    </td>
                </tr>
            </table>
            <br />
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:hqglConnectionString %>"
                SelectCommand="SELECT [SUBJECT], [FROM_ID], [EMAIL_ID] FROM [email] WHERE ([TO_ID] LIKE '%' + @TO_ID + '%')" DeleteCommand="DELETE FROM email WHERE (EMAIL_ID =@EMAIL_ID)">
                <SelectParameters>
                    <asp:SessionParameter Name="TO_ID" SessionField="u_id" Type="String" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:ControlParameter ControlID="GridView1" Name="EMAIL_ID" PropertyName="SelectedValue" />
                </DeleteParameters>
            </asp:SqlDataSource>
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
                CellPadding="3" DataKeyNames="email_id" DataSourceID="SqlDataSource1" Width="300px">
                <FooterStyle BackColor="White" ForeColor="#000066" />
                <Columns>
                    <asp:TemplateField HeaderText="主题">
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("email_id", "javascript:x_open(&#039;邮件详情&#039;, &#039;viewemail.aspx?id={0}&#039;,600,400)") %>'
                                Text='<%# Eval("SUBJECT") %>'></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="from_id" HeaderText="发送者" />
                    <asp:CommandField ShowDeleteButton="True" />
                </Columns>
                <RowStyle ForeColor="#000066" />
                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            </asp:GridView>
            &nbsp;
            <input class="BigButton" onclick="location='default.aspx'" title="撰写新的内部邮件" type="button"
                value="返回" /></div>
    </form>
</body>
</html>
