<%@ Page Language="C#" AutoEventWireup="false" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Controls" Assembly="Hishop.Web.Controls" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Management" Assembly="Hishop.Web.Management" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Validator" Assembly="Hishop.Web.Validator" %>
<%@ Register TagPrefix="UI" Namespace="ASPNET.WebControls" Assembly="ASPNET.WebControls" %>
<%@ Import Namespace="Hishop.SystemServices" %>
<!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>
    <Hishop:HeadContainer ID="HeadContainer1" runat="server" />
    <Hishop:PageTitle ID="PageTitle1" runat="server" />
    <link rel="stylesheet" href="../../utility/validate/pagevalidator.css" type="text/css" />
    <link rel="stylesheet" href="../css/Hishopv5.css" type="text/css" />
    <script type="text/javascript" src="../../utility/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../../utility/validate/pagevalidator.js"></script>
    
    <script type="text/javascript" src="../js/Hishopv5.js"></script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <div class="PageTitleArea">
                <div class="PageTitle">
                    <asp:Literal ID="lblPageTitle" runat="server" Text="<%$ Resources:SendedMessages,IDS_PageTitle %>"></asp:Literal>
                </div>
                <div style="width: 80%;">
                    <asp:Literal ID="lblPageDesc" runat="server" Text="<%$ Resources:SendedMessages,IDS_PageDesc %>"></asp:Literal>
                </div>
            </div>
            <Hishop:SendedMessages ID="SendedMessages" runat="server">
            <SkinTemplate>
            
 <script type="text/javascript">         
      
    $(document).ready(function(){
        
        var $_txtMessageId=$('#SendedMessages_txtMessageId');
        var $_txtAddressee=$('#txtAddressee');
        var $_txtTitle=$('#txtTitle');
        var $_txtPublishContent=$('#txtPublishContent');
        var $_txtPublishDate=$('#txtPublishDate');
        
        jQuery.myfn={
           OpenWindow: function(messageId,addresee,title,publishDate,publishContent)
           {
             if (dialogMessage.get_isShowing()) {
                dialogMessage.Close();			
             }
             else {
                
                $_txtMessageId.attr({'value':messageId});
                $_txtAddressee.attr({'value':addresee});
                $_txtTitle.attr({'value':title});
                $_txtPublishDate.attr({'value':publishDate});
                $_txtPublishContent.attr({'value':publishContent.replace(/<br\/>/g,'\n')});
                dialogMessage.Show();
             }
           }
        };
    }
  );

	
</script>
            
        <div class="grdHeaderStyle">
            <ul>
                <li class="userGroupCheckAll">
                    <asp:LinkButton ID="Button2" runat="server" OnClientClick="CheckClickAll();return false;"
                        Text="<%$ Resources:ProductInStock, IDS_Button_CheckAll %>" />
                </li>
                <li class="spirtLines">|</li>
                <li class="userGroupReverseCheck">
                    <asp:LinkButton ID="CheckReverse" runat="server" OnClientClick="CheckReverse();return false;"
                        Text="<%$ Resources:ProductInStock, IDS_Button_CheckReverse %>" />
                </li>
                <li class="spirtLines">|</li>
                <li class="userGroupDelCheck">
                    <Hishop:DeleteImageLinkButton Id="btnDeleteSelect" runat="server"  Text="<%$ Resources:Resources, IDS_Button_Delete %>" />
                </li>
            </ul>
        </div>
            <div class="grdGroupListLi">
        <UI:Grid ID="messagesList" runat="server" AutoGenerateColumns="False" CssClass="GridViewStyle" DataKeyNames="SendMessageId"
                    CellPadding="4" ForeColor="#333333" GridLines="None" ShowHeader="true" AllowSorting="false" HeaderStyle-CssClass="GridViewHeaderStyle"
                    Width="100%" RunningMode="Server" >
                    <Columns>
                        <Hishop:CheckBoxColumn />
                        <asp:TemplateField HeaderText="编号" ItemStyle-Width="100">
                            <ItemTemplate>
                                <asp:Label runat="server" Id="lblMessage" Text='<%# Eval("SendMessageId") %>' Visible="false" ></asp:Label>
                                <asp:Label runat="server" Text='<%# Eval("Id")%>' />
                            </ItemTemplate>
                        </asp:TemplateField>                    
                        <asp:TemplateField HeaderText="标题">
                            <ItemTemplate>
                                <a href="#" onclick="$.myfn.OpenWindow('<%# Eval("SendMessageId")%>','<%# Eval("Addressee")%>','<%# Eval("Title")%>','<%# Eval("PublishDate")%>','<%# (Eval("PublishContent")).ToString().Replace("\r\n", "<br/>")%>');"><span style="color:Blue;"><asp:Label runat="server" Text='<%# Eval("Title")%>'></asp:Label></span></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="收件人">
                            <ItemTemplate>
                                <Hishop:Link_User runat="server" Text='<%# Eval("Addressee")%>' UserId='<%# Eval("AddresseeID") %>' Style=" color:Blue;" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="时间" SortExpression="PublishDate">
                            <ItemTemplate>
                                <%# Eval("PublishDate")%>'
                            </ItemTemplate>
                        </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources:Resources, IDS_Header_Options %>">
                                <ItemStyle/>
                                <ItemTemplate>
                                    <a href="#" class="SmallCommonTextButton" onclick="$.myfn.OpenWindow('<%# Eval("SendMessageId")%>','<%# Eval("Addressee")%>','<%# Eval("Title")%>','<%# Eval("PublishDate")%>','<%# (Eval("PublishContent")).ToString().Replace("\r\n", "<br/>")%>');" >查看</a>
                                    <Hishop:DeleteImageLinkButton ID="DeleteImageLinkButton1" CssClass="SmallCommonTextButton" runat="server"  Text="<%$ Resources:Resources, IDS_Button_Delete %>" CommandName="Delete"/>
                                </ItemTemplate>
                            </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="grdrow" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                    <HeaderStyle CssClass="GridViewHeaderStyle" Font-Bold="True" />
                    <AlternatingRowStyle BackColor="White" />
                </UI:Grid>
                </div>
        <div class="grdGroupTabhead">
            <UI:Pager runat="server" RunningMode="PostBack" ID="pager" />
        </div>
                
        <UI:Dialog AnimationType="Live" ShowTransition="Fade" AnimationSlide="ExponentialDecelerate"
            CloseTransition="Fade" AnimationDuration="600" Modal="true"
            AllowDrag="true" Alignment="MiddleCentre" Title="查看信息"
            ID="dialogMessage" runat="server" Width="500">
            <Content>
                <input type="text" id="txtMessageId" runat="server" style="display:none;" />
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="padding: 10px;">
                            <div style="width:450px; height:136px; border:solid 1px black;">
                                 <p><label>发件人：</label><input type="text" ID="txtAddressee" readonly="readonly"  style="border:0px 0px 0px 0px;width:370px; " /></p>
                                 <p><label>标题：</label><input type="text" readonly="readonly"  ID="txtTitle" style="border:0px 0px 0px 0px;width:370px;" /></p>
                                 <p><label>时间：</label><input type="text" readonly="readonly"  ID="txtPublishDate" style="border:0px 0px 0px 0px;width:370px;" /></p>
                                 <p><label>内容：</label><textarea rows="2" cols="20" id="txtPublishContent" readonly="readonly" style="height:40px;width:370px;"></textarea></p>
                            </div>                           
                        </td>
                    </tr>
                </table>
            </Content>
        </UI:Dialog>
                
            </SkinTemplate>
            </Hishop:SendedMessages>         
            
        </div>
        <br />
        <div style="text-align:center">
            <hr style="width:500px;" />
            <Hishop:SiteCopyright runat="server" />
        </div>
        <br />
        <Hishop:ValidatorContainer runat="server" ID="ValidatorContainer" />
    </form>
</body>
</html>
