<%@ page language="C#" validaterequest="false" masterpagefile="MyShop.master" enableeventvalidation="false" autoeventwireup="true" inherits="Shop_Manage_shop_leave_message, WebApp_deploy" title="店铺留言" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<!--删除部分还没完成-->
<asp:PlaceHolder ID="PlaceHolder2" runat="server" Visible="true">
    <div  class="pageTitle">店铺留言管理 &nbsp;<asp:LinkButton ID="LinkAddMessage" runat="server" OnClick="LinkAddMessage_Click1" Text="发表留言" /></div>
    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" DataSourceID="MessageDataSource"  CssClass="tableHead" 
        AllowPaging="True" GridLines="Horizontal" DataKeyNames="M_ID" OnDataBound="GridView3_DataBound">
          <Columns>           
            <asp:TemplateField HeaderText="发言人及时间">
                <ItemTemplate>
                       <b><asp:Literal ID="LabUserName" runat="server" Text='<%# Eval("M_SenderName") %>' /></b><br />
                      <asp:Literal ID="LabM_DateTime" runat="server" Text='<%# Eval("M_DateTime") %>' /><br />
                      <span><asp:Literal ID="LabReceiverName" runat="server" Text='<%# (Convert.ToString(Eval("M_ReceiverName"))!="")?"店长回复":"尚未回复" %>' /></span> <br />
                      <asp:Literal ID="LiReplayTime" runat="server" Text='<%# Eval("R_DateTime") %>' />   
                      <asp:HiddenField ID="R_ID" runat="server" Value='<%# Eval("R_ID") %>' />             
                </ItemTemplate>
                <ItemStyle Width="130px" HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="留言内容">
                <ItemTemplate>
                    <asp:Literal ID="SenderContent" Text='<%# Eval("M_CONTENT") %>' runat="server" />
                    <div style="width:100%;  background:#EEEEEE; height:1px; line-height:1px">&nbsp;</div>
                    <span><asp:Literal ID="ReplayContent" Text='<%# Eval("R_Content") %>' runat="server" /></span>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>            
              <asp:TemplateField HeaderText="删除" ShowHeader="False">
                  <ControlStyle Width="40px" />
                  <ItemTemplate>
                      <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                    OnClientClick="return confirm('确定要删除此条留言?');"       Text="删除"></asp:LinkButton>
                  </ItemTemplate>
              </asp:TemplateField>
            <asp:TemplateField >
                <ItemTemplate>
                  <div style="width:100px; text-align:center;">
                      <asp:HyperLink ID="Replay" Text="回复" runat="server" NavigateUrl='<%#"replay_shop_message.aspx?messageID="+Eval("M_ID")+"&ShopID="+ShopID %>' />
                  </div>                  
                </ItemTemplate>
                <ItemStyle Width="100px" />
            </asp:TemplateField>
          </Columns>
          <EmptyDataTemplate>
             <table class="tableHead">
                <tr>
                   <th>发言人及时间</th>
                   <th>内容</th>
                   <th>操作</th>
                   <th>回复</th>                  
                </tr>
                <tr>
                   <td colspan="4">没有留言</td>
                </tr>
             </table>
          </EmptyDataTemplate>  
      </asp:GridView>
       
    </asp:PlaceHolder>
<asp:PlaceHolder ID="PlaceHolder1" runat="server" Visible="false">    
    <div class="pageTitle">请店长留言&nbsp<a href="shop_leave_message.aspx">返回</a></div>
        <table class="SearchTableStyle">
           <tr>
              <td width="150px">留言内容：</td>
              <td><asp:TextBox ID="TxtMessage" runat="server" Height="100px" TextMode="MultiLine" Width="300px"/></td>
           </tr>
           <tr>
              <td colspan="2">
                 <asp:Button ID="ButAdd" runat="server" Text="添加" OnClick="ButAdd_Click" />
                 <asp:Button ID="ButCancel" runat="server" Text="取消" CausesValidation="false"  OnClick="ButCancel_Click" />                
              </td>
           </tr>
        </table>  
    </asp:PlaceHolder>
<asp:ObjectDataSource ID="MessageDataSource" runat="server" SelectMethod="GetMessageByShopIDLately"   TypeName="HoWave.Web.Shop_Message" DeleteMethod="DeleteMessage"   >
      <SelectParameters>
      <asp:Parameter  DefaultValue="0" Name="ShopID"    Type="Int32" />
   <asp:Parameter DefaultValue="all" Name="MessageType" Type="String" />
        </SelectParameters>
    <DeleteParameters>
        <asp:Parameter Name="M_ID" Type="Int32" />
    </DeleteParameters>
</asp:ObjectDataSource>
</asp:Content>

