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

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!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 runat="server">
    <title></title>
      <style type="text/css">
        body
        {
            margin: 0px;
            padding: 0px;
            font-size: 12px;
        }
        .table
        {
            border-collapse: collapse;
            height: 24px;
            line-height: 24px;
            text-align: center;
        }
        .table tr
        {
            border-right: solid 1px #FFF;
            border-left: solid 1px #000000;
        }
        .table tr td
        {
            border: solid 1px #000000;
        }
        .classtd
        {
            background-image: url(Image/tab/tab_14.gif);
            height: 26px;
            background-repeat: repeat-x;
            text-align: center;
        }
    </style>
    <script src="My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
        function checkall() {
            var objmail = document.getElementById("mail");
            var obj = objmail.getElementsByTagName("input");
            var check = document.getElementById("ck_all");
            if (check.checked) {
                for (var i = 0; i < obj.length; i++) 
                {
                    if (obj[i].type == "checkbox") 
                    {
                        obj[i].checked = true;
                    }
                }
            }
            else 
            {
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].type == "checkbox") {
                        obj[i].checked = false;
                    }
                }
            }
            document.getElementById("ck_rechoice").checked=false;
        }
        function rechoice()
        {
            var objmail = document.getElementById("mail");
            var obj = objmail.getElementsByTagName("input");
            for (var i = 0; i < obj.length; i++) 
            {
                if (obj[i].type == "checkbox")
                    {
                        obj[i].checked = !obj[i].checked;
                    }
            }
                document.getElementById("ck_all").checked = false;
        }
        function checkdel() {
            var bool=false;
            var objmail = document.getElementById("mail");
            var obj = objmail.getElementsByTagName("input");
            for (var i = 0; i < obj.length; i++) {
                if (obj[i].type == "checkbox") {
                    if (obj[i].checked) {
                        bool = true;
                        break;
                    }
                  }
                }
            if(!bool)
            {
               alert('请选择删除项！')
            }
            return bool;
        }
    </script>
    </head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
     <div>
     <div style="background-image: url(Image/tab/tab_05.gif); height: 25px; background-repeat: repeat-x">
                    <img src="Image/tab/311.gif" alt="" /><span style="font-size: 12px; color: #1F4A65;
                        font-weight: bold;">收件箱</span>
     </div>
     <div>
     <table class="table">
     <tr>
     <td>请选择查询条件:</td>
     <td>发件人:<asp:TextBox ID="Tb_Senduser" runat="server"></asp:TextBox>
         <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" ServicePath="~/FindUser.asmx" ServiceMethod="Users" TargetControlID="Tb_Senduser" MinimumPrefixLength="1">
         </asp:AutoCompleteExtender>
     </td>
     <td>发件时间：<asp:TextBox ID="Tb_SendTime" runat="server"></asp:TextBox></td>
     <td>
         <asp:ImageButton ID="Tbt_Select" runat="server" 
             ImageUrl="~/Image/Bt_Select.gif" onclick="Tbt_Select_Click" /></td>
     </tr>
     </table>
     </div>
     <div>
     <asp:Repeater ID="Rp_mail" runat="server">
                    <HeaderTemplate>
                        <table id="mail" class="table" cellpadding="0px" cellspacing="0px" width="90%" style="margin-top: 10px"
                            align="center">
                            <tr>
                                <td class="classtd">
                                    选择
                                </td>
                                <td class="classtd">
                                    状态
                                </td>
                                <td class="classtd">
                                    主题
                                </td>
                                <td class="classtd">
                                    发件人
                                </td>
                                <td class="classtd">
                                    邮件内容
                                </td>
                                <td class="classtd">
                                    发件时间
                                </td>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <asp:CheckBox ID="Ck_Check" runat="server" />
                            </td>
                            <td style=" display:none">
                                <asp:Label ID="Lb_User" runat="server" Text='<%#Eval("ID") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("State").ToString()=="False"?"mail/unread.gif":"mail/read.gif" %>' />
                            </td>
                            <td>
                              <a href='usermail.aspx?type=in&&ID=<%#Eval("ID") %>' target="I2"><%#Eval("Theme")%></a>
                            </td>
                            <td>
                                <%#Eval("Senduser")%>
                            </td>
                            <td>
                                <%#Eval("MailContents")%>
                            </td>
                            <td>
                              <%#Eval("SendTime")%>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                        <asp:Label ID="Label1" runat="server" Visible='<%#Rp_mail.Items.Count>0?false:true%>'
                            Text="温馨提示:没有符合条件的数据！"></asp:Label>
                    </FooterTemplate>
                </asp:Repeater>
                <div id="div" runat="server" style="width:90%; display:none; margin:0px auto;">
                        <div style=" width:150px; float:left; ">
                        <input id="ck_all" type="checkbox" onclick="checkall()"/>全选
                        <input id="ck_rechoice" type="checkbox" onclick="rechoice()" />反选
                         <asp:LinkButton ID="Lb_Del" runat="server" OnClientClick="return checkdel()" 
                                onclick="Lb_Del_Click">删除</asp:LinkButton>
                        </div>
                        <div style="float:right">
                           <table>
                    <tr>
                        <td>
                            总共<asp:Label ID="Lb_Total" runat="server" Text=""></asp:Label>页
                        </td>
                        <td>
                            当前第<asp:Label ID="Lb_Now" runat="server" Text=""></asp:Label>页
                        </td>
                        <td>
                            <asp:ImageButton ID="Ibt_Firsr" runat="server" ImageUrl="~/Image/tab/first.gif" 
                                onclick="Ibt_Firsr_Click" />
                        </td>
                        <td>
                            <asp:ImageButton ID="Ibt_Pre" runat="server" ImageUrl="~/Image/tab/back.gif" 
                                onclick="Ibt_Pre_Click"/>
                        </td>
                        <td>
                            <asp:ImageButton ID="Ibt_Next" runat="server" ImageUrl="~/Image/tab/next.gif" 
                                onclick="Ibt_Next_Click"  />
                        </td>
                        <td>
                            <asp:ImageButton ID="Ibt_Last" runat="server" ImageUrl="~/Image/tab/last.gif" 
                                onclick="Ibt_Last_Click" />
                        </td>
                        <td>
                            <asp:TextBox ID="Tb_goto" runat="server" Height="12px" Width="15px"></asp:TextBox>
                            <asp:ImageButton ID="Ibt_goto" runat="server" ImageUrl="~/Image/tab/go.gif" 
                                onclick="Ibt_goto_Click" />
                        </td>
                    </tr>
                </table>
                      
                         </div>
                      
                </div>
                </div>
    </div>
    </form>
</body>
</html>
