<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_ShopMessage, mallz" title="留言管理" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:PlaceHolder runat="server" ID="ListPanel" >

<table class="nick">
        <tr>
            <td colspan="4" class="tit"><b>留言管理</b></td>
        </tr>
     <tr>
        <td class="ltd">状态：</td>
        <td class="rtd" style="width:35%">
        <asp:DropDownList ID="DroStatus" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DownList_OnChange">
              <asp:ListItem Value="">全部</asp:ListItem>
              <asp:ListItem Value="0">未读</asp:ListItem>
              <asp:ListItem Value="1">已读</asp:ListItem>
        </asp:DropDownList>
        </td>
         <td class="ltd">类型：</td>
         <td class="rtd" style="width:35%"><asp:DropDownList ID="DroType" runat="server"  AutoPostBack="true" OnSelectedIndexChanged="TypeDownList_OnChange">
             <asp:ListItem Value="">全部留言</asp:ListItem>
             <asp:ListItem Value="0">商品留言</asp:ListItem>
             <asp:ListItem Value="1">店铺留言</asp:ListItem>
             <asp:ListItem Value="2" Enabled="false">求购留言</asp:ListItem>
          </asp:DropDownList></td>
      </tr>
      <tr>
        <td class="ltd">发送人：</td><td class="rtd" style="width:35%"><asp:TextBox ID="TxtSender" runat="server" /></td>
        <td class="ltd">接收人：</td><td class="rtd" style="width:35%"><asp:TextBox ID="TxtReceiver" runat="server" /></td>
     </tr>
      <tr>
        <td class="ltd">开始日期：</td><td class="rtd" style="width:35%"><asp:TextBox ID="TxtBeginDate" runat="server" /></td>
        <td class="ltd">终止日期：</td><td class="rtd" style="width:35%"><asp:TextBox ID="TxtEndDate" runat="server" /></td>
        </tr><tr><td class="btm" colspan="4">
         <asp:Button ID="ImgButSearch" runat="server" Text="搜 索" OnClick="ImgButSearch_Click" />
        </td>
     </tr>
  </table>
       <asp:GridView CssClass="adminlist" ID="GVReviewMan" runat="server" AutoGenerateColumns="False" DataKeyNames="M_ID" OnRowDataBound="GridView1_RowDataBound">
             <Columns>
               <asp:BoundField DataField="M_ID" HeaderText="编号" ItemStyle-Width="4%" />
                <asp:HyperLinkField DataTextField="M_SenderName" DataNavigateUrlFields="M_UserID" DataNavigateUrlFormatString="Admin_UserDetail.aspx?userid={0}" HeaderText="发送人" ItemStyle-Width="15%" />
                <asp:HyperLinkField  DataTextField="M_ReceiverName" DataNavigateUrlFields="M_ReceiverID" DataNavigateUrlFormatString="Admin_UserDetail.aspx?userid={0}" HeaderText="接收人" ItemStyle-Width="15%"/>
                <asp:TemplateField HeaderText="类型" ItemStyle-Width="10%">
                    <ItemTemplate>
                        <asp:Literal runat="server" ID="litType" Text='<%# GetType(Eval("M_Type").ToString()) %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="M_DateTime" HeaderText="日期" ItemStyle-Width="13%"  />
                <asp:TemplateField HeaderText="状态" ItemStyle-Width="8%">
                    <ItemTemplate>
                        <asp:Literal runat="server" ID="litStatus" Text='<%# GetStatus(Eval("M_Status").ToString()) %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作" HeaderStyle-Width="10%">
                  <ItemTemplate>
                    <asp:HyperLink ID="LinkButton1" runat="server" Text="详细" NavigateUrl='<%# "?id=" + Eval("M_ID") %>' />
                    <asp:LinkButton ID="cl" runat="server" Text="删除" OnCommand="GVReviewMan_Delete" CommandArgument='<%# Eval("M_ID") %>' OnClientClick="if(confirm('确定删除吗？'))return true;return false;" />
                  </ItemTemplate>
                </asp:TemplateField>
             </Columns>
             <EmptyDataTemplate>
                    <tr>
                       <th>编号</th>
                       <th>发送人</th>
                       <th>接收人</th>
                       <th>类型</th>
                       <th>日期</th>
                       <th>状态</th>
                       <th>操作</th>
                    </tr>
                    <tr><td colspan="7">暂无留言！</td></tr>
             </EmptyDataTemplate>                 
     </asp:GridView>  
     
     <div class="page">
       <asp:Label ID="PagePanel" runat="server" />
     </div>

</asp:PlaceHolder>

<asp:PlaceHolder runat="server" ID="ViewPanel" Visible="false" >
    <asp:FormView ID="FormView1" runat="server" Width="100%">
        <ItemTemplate>
            <table class="nick" >
                <tr>
                    <td class="tit" colspan="2">留言内容</td>
                </tr>
                <tr>
                    <td class="ltd">发送人：</td>
                    <td class="rtd"><asp:Literal ID="Literal1" runat="server" Text='<%# Eval("M_SenderName") %>'/></td>
                </tr>
                <tr>
                    <td class="ltd">接收人：</td>
                    <td class="rtd"><asp:Literal ID="Literal2" runat="server" Text='<%# Eval("M_ReceiverName") %>'/></td>
                </tr>
                <tr>
                    <td class="ltd">类型：</td>
                    <td class="rtd"><asp:Literal ID="Literal3" runat="server" Text='<%# GetType(Eval("M_Type").ToString()) %>'/></td>
                </tr>
                <tr>
                    <td class="ltd">产品名称：</td>
                    <td class="rtd"><asp:HyperLink ID="Literal4" runat="server" NavigateUrl='<%# "Admin_ShopProductEdit.aspx?id=" + Eval("M_ProductID") %>' Text='<%# db_Product.GetProductNameByProductID(MallZ.Common.Text.ToInt32(Eval("M_ProductID"))) %>'/></td>
                </tr>
                <tr>
                    <td class="ltd">回复留言ID：</td>
                    <td class="rtd"><asp:HyperLink ID="Literal5" runat="server" NavigateUrl='<%# "?id=" + Eval("M_ReplayID") %>' Text='<%# Eval("M_ReplayID") %>'/></td>
                </tr>
                <tr>
                    <td class="ltd">店铺名称：</td>
                    <td class="rtd"><asp:HyperLink ID="Literal6" runat="server" NavigateUrl='<%# "Admin_UpdateShop.aspx?ShopID=" + Eval("M_ShopID") %>' Text='<%# db_Shop.GetShopNameByShopID(MallZ.Common.Text.ToInt32(Eval("M_ShopID"))) %>'/></td>
                </tr>
                <tr style="display:none;">
                    <td class="ltd">求购商品：</td>
                    <td class="rtd"><asp:Literal ID="Literal9" runat="server" Text='<%# Eval("M_RequestID") %>'/></td>
                </tr>
                <tr>
                    <td class="ltd">发表时间：</td>
                    <td class="rtd"><asp:Literal ID="Literal7" runat="server" Text='<%#Eval("M_DateTime") %>'/></td>
                </tr>
                <tr>
                    <td class="ltd">阅读状态：</td>
                    <td class="rtd"><asp:Literal ID="Literal8" runat="server" Text='<%# GetStatus(Eval("M_Status").ToString()) %>'/></td>
                </tr>
                <tr>
                    <td class="ltd">留言内容：</td>
                    <td class="rtd"><asp:TextBox TextMode="MultiLine" ID="Literal10" Height="80" Width="500" runat="server" Text='<%# Eval("M_Content") %>'/></td>
                </tr>
            </table>
            <div><input type="button" onclick="history.back()" value="返 回" /></div>
        </ItemTemplate>
    </asp:FormView>
</asp:PlaceHolder>
</asp:Content>

