<%@ Page Language="C#" MasterPageFile="~/Member/UserManage.master" EnableEventValidation="false"
    AutoEventWireup="true" CodeFile="ReceiveMessage.aspx.cs" Inherits="member_Message_ReceiveMessage" Title="我收到的留言"  %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="Server">

    <script type="text/ecmascript">
    
        function SelectAll()
        {
            // 找到所有的 input 元素
            var ctllist = window.document.form1.getElementsByTagName("input");
            var objcheckbox= document.form1.CheckBox2;
               
                for( var i = 0; i< ctllist.length; i++)
                {
                    if( ctllist[i].type == "checkbox")
                    {
                        if( ctllist[i].name.indexOf( "CheckBox1") >=0 )
                        {   
                            if(objcheckbox.checked==true)
                            {      
                                 ctllist[i].checked = true;
                            }
                            else
                            {
                                 ctllist[i].checked = false;
                            }
                        }
                    }
                
                 }
        
             
         }
    </script>

    <form id="form1">
        <div id="sub_content">
            <div class="pagetitle">
                我收到的留言</div>
			<div class="tishi">
            <span>重要提示：</span>·留言的有效期为1年，系统将自动删除超出有效期的留言。请注意保存重要留言！
			</div>
            <div class="main_Supply_nav">
                <ul>
                    <li class="Check">所有留言</li></ul>
            </div>
			<div class="clr"></div>
            <table border="0" cellpadding="0" cellspacing="0" width="795">
                <tr>
                    <td height="35">
                        <asp:TextBox ID="txtMessage" runat="server" ToolTip="请输入留言" Width="100px"></asp:TextBox>
                        <asp:DropDownList ID="dropMessageState" runat="server">
                            <asp:ListItem Selected="True" Value="">留言状态</asp:ListItem>
                            <asp:ListItem Value="0">新留言</asp:ListItem>
                            <asp:ListItem Value="1">已阅读</asp:ListItem>
                            <asp:ListItem Value="2">已回复</asp:ListItem>
                        </asp:DropDownList>
                        <asp:DropDownList ID="dropMessageDate" runat="server">
                            <asp:ListItem Value="七天内的留言">七天内的留言</asp:ListItem>
                            <asp:ListItem Value="一个月内的留言">一个月内的留言</asp:ListItem>
                            <asp:ListItem Selected="True" Value="三个月内的留言">三个月内的留言</asp:ListItem>
                            <asp:ListItem Value="三个月以上留言">三个月以上留言</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Button ID="btnSelect" runat="server" Text="立即查询" OnClick="btnSelect_Click" CssClass="i_button" /></td>
                </tr>
            </table>
                        <asp:GridView ID="grdMessage" runat="server" AutoGenerateColumns="False" CellPadding="0" GridLines="None" DataKeyNames="ID" Width="795px" CssClass="table_main1">
                            <Columns>
                                <asp:TemplateField HeaderText="选项">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBox1" runat="server" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="状态">
                                    <ItemTemplate>
                                        <%#  GetCharacter(Eval("Restore").ToString())%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="留言标题">
                                    <ItemTemplate>
                                        <a href='MessageAdd.aspx?uid=<%# DataBinder.Eval(Container.DataItem,"ReceiveUserID") %>&ID=<%#Eval("ID")%>'>
                                            <%# DataBinder.Eval(Container.DataItem,"Title") %>
                                        </a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="来自">
                                    <ItemTemplate>
                                        <%#  GetMessagePeople(Eval("LoginName").ToString())%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="留言日期">
                                    <ItemTemplate>
                                        <%# GetShortDate(DataBinder.Eval(Container.DataItem, "Date").ToString())%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#EEEEEE" Font-Bold="True" ForeColor="Black" BorderColor="#DDDDDD" Height="30" />
                        </asp:GridView>
                <div class="paging">
                    <p>
                        总记录数：<asp:Label ID="txt_pageCount" runat="server"></asp:Label>
                        页码：<asp:Label ID="txt_begin" runat="server"></asp:Label>/<asp:Label ID="txt_pageAll"
                            runat="server"></asp:Label>
                        <asp:LinkButton ID="txt_pageFirst" runat="server" OnClick="txt_pageFirst_Click">首页</asp:LinkButton>
                        <asp:LinkButton ID="txt_pageLast" runat="server" OnClick="txt_pageLast_Click">上一页</asp:LinkButton>
                        <asp:LinkButton ID="txt_pageNext" runat="server" OnClick="txt_pageNext_Click">下一页</asp:LinkButton>
                        <asp:LinkButton ID="txt_pageFoot" runat="server" OnClick="txt_pageFoot_Click">末页</asp:LinkButton>
                        <asp:TextBox ID="txt_PageNum" runat="server" Width="30px"></asp:TextBox>
                        <asp:LinkButton ID="Lk_go" runat="server" OnClick="Lk_go_Click">GO</asp:LinkButton></p>
                    <input id="CheckBox2" name="CheckBox2" type="checkbox" onclick="SelectAll();" />全选
                    <asp:Button ID="btnDelete" runat="server" Text="批量删除" OnClick="btnDelete_Click" CssClass="i_button" />
                </div>
        </div>
    </form>
</asp:Content>
