<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master/User.Master" CodeBehind="MessageList.aspx.vb" Inherits="Dingtai.Website.MessageList" 
    title="无标题页" %>
<%@ Register src="/App_Data/Controls/PageControl.ascx" tagname="PageControl" tagprefix="uc1" %>
    
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<script language="javascript">
function DelMsgs() {
    
    if (document.getElementsByName("checkboxid") == undefined ||document.getElementsByName("checkboxid").length == 0){
        return;
    }
    
    var ids = "";
    for (var i=0;i<document.getElementsByName("checkboxid").length;i++) {
        var e=document.getElementsByName("checkboxid")(i);
         if ( e.checked) {
            ids = ids + e.value + ","
        } 
    }    
    if (ids == ""){
        alert("请选择需要删除的信息!");
        return;
    }    
    if (confirm("确认删除这些信息?") == false)
    {
        return;
    }
    if (ids != "" && ids.lastIndexOf(",") == ids.length -1 ){
        ids = ids.substring(0,ids.length - 1)
    }
    
    ids = ids.split(",");
//        alert(ids);
    var ret = MessageList.DelMsgs(ids).value;
    if (ret == true)
    {
        alert("删除成功!");            
        refreshPage(0);  
    }
    else{
        alert("删除失败!");
    }        
}
</script>

<div id="body_left">
    <div class="body_left_top"></div>
    <div id="body_left_conter">
    <div id="upload_title" style="color:#FFF;">站内短信(共<% =count %>封)
      <div class="back"><a href="javascript:history.back(-1)">返回上页</a></div>
    </div>

<div class="info">
    <asp:Repeater ID="Repeater1" runat="server">
        <HeaderTemplate>
            <div class="info_box">
                <div class="info_title">
                    <ul>
                        <li class="info_title01" style="border-left:none;"><input name="" type="checkbox" value="" onclick="ClickAll(this);"></li>
                        <li class="info_title02"></li>
                        <li class="info_title03">发信人</li>
                        <li class="info_title04">标题</li>
                        <li class="info_title05" style="border-right:none;">时间↓</li>  
                    </ul>
                <div class="clear"></div>
            </div>
            <div class="info_line">
                <ul>
        </HeaderTemplate>
        <ItemTemplate>
                <li>
                    <span class="fxk"><input type="checkbox" name="checkboxid" id="checkboxid" value="<%#Eval("ID") %>" /></span>
                    <span id="icon" runat="server"></span>
                    <span class="fxr"><%#Eval("SendUserName")%></span>
                    <span class="nr"><a href='Message.aspx?id=<%# Eval("ID") %>'><%#Eval("Title")%></a></span>
                    <span class="sj"><%#CType(Eval("CreationDate"), DateTime).ToString("MM-dd hh:mm:ss")%></span>
                </li>
        </ItemTemplate>
        <FooterTemplate>                
                </ul>                    
        </FooterTemplate>
    </asp:Repeater>
    <div class="info_page">
                <input name="" type="button" value="删除" onclick="DelMsgs();"><input name="" type="button" value="写短信"  onclick="location.href = 'Addmessage.aspx';">
                <uc1:PageControl ID="Page2" runat="server" ShowFirstLast="true" ShowPrevNext="true"       FirstPageText="首 页" LastPageText="末 页" PrevPageText="上一页" NextPageText="下一页" AlwaysShow="true"  ShowCustomInfoSec="left" NumericButtonCount="15" PagingButtonSpacing="10px" CustomInfoHTML="当前 %CurrentPageIndex% 页 共 %PageCount% 页" CustomInfoClass="" InputBoxHeight="" SubmitButtonClass="" ShowInputBoxB="0" />
                <%--<input name="" type="button" value="删除"><input name="" type="button" value="写短信">
                <ul class="page" style="margin-top:0px; float:left; display:block">
                <li class="on"><span>上一页</span></li>
                <li><span>1</span></li>
                <li><a href="#">2</a></li>
                <li class="next" style="margin:0px;"><a href="#">下一页</a></li>
                </ul>--%>
            </div>
        </div>
    </div>    
</div>

</div>
<div class="body_left_bottom"></div>
</asp:Content>
