<%@ page language="C#" validaterequest="false" masterpagefile="PassportMasterPage.master" autoeventwireup="true" inherits="Passport_ManageSiteMessage, HoWaveVGO" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style="text-align:center; margin:0 auto; padding:10px 300px;">
       
       <div style="float:left; margin:20px;">
          <asp:ImageButton ID="Button1" runat="server"  AlternateText="新增短信息"   ImageUrl="Images/messge_new.gif" OnClick="Button1_Click" CausesValidation="False" /><br />
           新增短信息
       </div>
       <div style="float:left; margin:20px;">
          <asp:ImageButton ID="Button2" runat="server" AlternateText="我收到的短信息" ImageUrl="Images/message_receive.gif" OnClick="Button2_Click" CausesValidation="False" /><br />
         收件箱
       </div>
        <div style="float:left; margin:20px;">
           <asp:ImageButton ID="Button3" runat="server" AlternateText="我发送的短信息" ImageUrl="Images/message_send.gif" OnClick="Button3_Click" CausesValidation="False" /><br />
          发送箱
       </div>
        <div style="float:left; margin:20px;">
           <asp:ImageButton ID="ImageButton1" runat="server" AlternateText="返回" ImageUrl="~/IMS_Img/Manage/restore_f2.png"   CausesValidation="False" OnClick="ImageButton1_Click" Width="42px" /><br />
          返回
       </div>
    </div>
    <div style="margin-left:100px; margin-right:0; width:98%;clear:both;">   
        <asp:GridView ID="GridView1" runat="server" DataSourceID="MessageS" AllowPaging="True" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PageSize="20" Width="600px" Visible="False" OnRowDataBound="GridView1_RowDataBound" >
            <Columns>
                <asp:BoundField DataField="MessageID" HeaderText="消息编号" />
                <asp:TemplateField HeaderText="接受者">             
                    <ItemTemplate>
                        &nbsp;<asp:HyperLink ID="HyperLink1" runat="server" Target="_blank"  NavigateUrl='<%#"../Shop/Shop1/Shop_ShopIntro.aspx?UserID="+ Eval("UserID")%>' Text='<%# Bind("UserName") %>'/>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Title" HeaderText="主题" />
                <asp:BoundField DataField="SendTime" HeaderText="发送日期" />
                <asp:BoundField DataField="IsRead" HeaderText="状态" />
                 <asp:HyperLinkField DataNavigateUrlFields="MessageID" DataNavigateUrlFormatString="?MessageID={0}&amp;tageS=S" HeaderText="查看" Text="查看" />
                <asp:CommandField HeaderText="删除" SelectText="删除" ShowSelectButton="True" />
            </Columns>
            <EmptyDataTemplate>暂无发送短信</EmptyDataTemplate>
        </asp:GridView>
    
        <asp:GridView ID="GridView2" runat="server" DataSourceID="MessageR" AllowPaging="True" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged1" PageSize="20"  OnDataBound="GridView2_DataBound" Width="600px">
            <Columns>
                <asp:BoundField DataField="MessageID" HeaderText="消息编号" />
                <asp:TemplateField HeaderText="发送者">                
                    <ItemTemplate>
                        &nbsp;<asp:HyperLink ID="HyperLink2" runat="server" Target="_blank"  NavigateUrl='<%#"../Shop/Shop1/Shop_ShopIntro.aspx?UserID="+ Eval("UserID")%>' Text='<%# Bind("UserName") %>'/> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Title" HeaderText="主题" />
                <asp:BoundField DataField="SendTime" HeaderText="发送日期" />
                <asp:BoundField DataField="IsRead" HeaderText="状态" />
                <asp:HyperLinkField DataNavigateUrlFields="MessageID" DataNavigateUrlFormatString="?MessageID={0}&amp;tageR=R"
                     HeaderText="查看" Text="查看" />
                <asp:CommandField HeaderText="删除" SelectText="删除" ShowSelectButton="True" />
            </Columns>
            <EmptyDataTemplate>暂无已接收短信</EmptyDataTemplate>
         </asp:GridView>
   
         <asp:Panel ID="Panel1" runat="server" Width="500px" HorizontalAlign="Center" Visible="False">
            <div style="border-right: gray 1px solid;  border-top: gray 1px solid;
                padding-bottom: 10px; border-left: gray 1px solid; padding-top: 10px;
                border-bottom: gray 1px solid; text-align: center">
                <div style="font-weight: bold">发送站内短信</div>
                <br />
                <br />
                <div style="width: 100%">
                    <div class="message_left">
                        收件人：</div>
                    <div class="message_right">
                        <asp:TextBox ID="TxtReceiver" runat="server" Width="300px"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtReceiver"
                            ErrorMessage="收件人不能空"/>
                    </div>
                </div>
                <div style="width: 100%">
                    <div class="message_left">
                        主题：</div>
                    <div class="message_right">
                        <asp:TextBox ID="TxtTitle" runat="server" Width="300px"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtTitle"
                            ErrorMessage="主题不能空"/>
                    </div>
                </div>
                <div style="width: 100%">
                    <div class="message_left">
                        内容：</div>
                    <div class="message_right">
                        <asp:TextBox ID="TxtContent" runat="server" Height="100px" TextMode="MultiLine" Width="300px"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TxtContent"
                            ErrorMessage="内容不能空"/>
                    </div>
                    <div style="width: 100%">
                        <asp:CheckBox ID="CheckBox1" runat="server" Text="发送同时并存档" />
                        <asp:Button ID="ButdSave" runat="server" OnClick="ButdSave_Click" Text="发送" />
                        <asp:Button ID="ButCancel" runat="server" CausesValidation="False" OnClick="ButCancel_Click"
                            Text="取消" />
                      
                    </div>
                </div>
            </div>
        </asp:Panel>      
  </div>      
  <asp:ObjectDataSource ID="MessageS" runat="server" SelectMethod="GetSenderMessage"
            TypeName="MessageBLL" UpdateMethod="SetMessageDelS" >
            <UpdateParameters>
                <asp:Parameter Name="MessageID" Type="Int32" />
            </UpdateParameters>
            <SelectParameters>
                <asp:CookieParameter CookieName="Howave_UserName" Name="Sender" Type="String" />
            </SelectParameters>
 </asp:ObjectDataSource>  
 <asp:ObjectDataSource ID="MessageR" runat="server" SelectMethod="GetReceiverMessage" TypeName="MessageBLL" UpdateMethod="SetMessageDelR">
            <UpdateParameters>
                <asp:Parameter Name="MessageID" Type="Int32" />
            </UpdateParameters>
            <SelectParameters>
                <asp:CookieParameter CookieName="Howave_UserName" Name="Receiver" Type="String" />
            </SelectParameters>
</asp:ObjectDataSource>
</asp:Content>

  