<%@ page language="C#" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" inherits="Member_Shop_Buyer_Message, WebApp_deploy" title="买家留言" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        function encode(textname) {
            var temp = encodeURL(textname);
            document.write(temp);

        }

    </script>
    <asp:Panel ID="PnlGvList" runat="server">
        <div class="pageTitle">
            查看买家留言</div>
        <div style="text-align: center; clear: both;">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="tableHead"
                AllowPaging="True" DataSourceID="ObjectDataSource1" OnRowDataBound="GridView1_RowDataBound">
                <Columns>
                    <asp:TemplateField HeaderText="商品名称">
                        <ItemTemplate>
                            <%--<asp:HyperLink Target="_blank" ID="ProductName" runat="server" Text='<%# Eval("ProductName") %>'
                                NavigateUrl='<%# "../ShowProduct.aspx?ProductID="+Eval("M_ProductID") %>' />--%>
                            <asp:HyperLink Target="_blank" ID="ProductName" runat="server" Text='<%#Eval("ProductName").ToString().Length > 40 ? Eval("ProductName").ToString().Substring(0, 38)+"..." : Eval("ProductName")%>'
                                NavigateUrl='<%# "../ShowProduct.aspx?ProductID="+Eval("M_ProductID") %>' />
                            <asp:HiddenField ID="HiddenID" runat="server" Value='<%#Eval("M_ID")%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="买家名称">
                        <ItemTemplate>
                            <asp:HyperLink ID="SalerName" runat="server" Text='<%# Eval("M_SenderName") %>' Target="_blank" /><br />
                            <asp:HyperLink ID="QQLink" runat="server" NavigateUrl='<%# "http://wpa.qq.com/msgrd?V=1&Uin="+Eval("OICQ")+"&amp;Site="+Eval("M_SenderName")+"&amp;Menu=yes" %>'
                                Target="_blank">
                                <asp:Image ID="QQImage" ImageUrl='<%# Eval("OICQ")%>' runat="server" />
                            </asp:HyperLink>
                            <asp:HyperLink ID="TaobaoLink" runat="server" NavigateUrl='<%# Eval("Taobaowangwang") %>'
                                Target="_blank">
                                <asp:Image ID="TaobaoImage" ImageUrl='<%# Eval("Taobaowangwang") %>' runat="server"
                                    AlternateText="点击此可以直接和对方交流" />
                            </asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="M_DateTime" HeaderText="留言日期" />
                    <asp:TemplateField HeaderText="留言状态">
                        <ItemTemplate>
                            <asp:HyperLink ID="Status" runat="server" Text='<%#Eval("M_Status").ToString()=="True" ? "已经回复":"等待回复"%>'
                                NavigateUrl='<%# "?action=read&MessageID="+Eval("M_ID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="选择">
                        <ItemTemplate>
                            <asp:CheckBox ID="MessageSelect" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <table style="width: 98%">
                        <tr>
                            <th>
                                商品名称
                            </th>
                            <th>
                                买家名称
                            </th>
                            <th>
                                留言日期
                            </th>
                            <th>
                                留言状态
                            </th>
                            <th>
                                选择
                            </th>
                        </tr>
                        <tr>
                            <td colspan="5">
                                暂无任何留言
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:GridView>
            <asp:Button ID="DelMessage" runat="server" Text="批量删除" OnClick="DelMessage_Click" />
        </div>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetMessageByTypeUserIDSalerID"
            TypeName="HoWave.Web.Shop_Message" OldValuesParameterFormatString="original_{0}">
            <SelectParameters>
                <asp:Parameter DefaultValue="0" Name="mType" Type="Int32" />
                <asp:Parameter DefaultValue="" Name="UserID" Type="Int32" />
                <asp:Parameter DefaultValue="buyer" Name="UserType" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </asp:Panel>
    <asp:Panel ID="pnlRendMessage" runat="server" Width="100%" HorizontalAlign="Center">
        <div style="clear: both; width: 98%; padding: 5px 0 5px 0; margin: 0 auto">
            <asp:PlaceHolder ID="SendPanel" runat="server">
                <table class="ShopOrderStyle" style="width: 100%">
                    <caption>
                        <asp:Literal ID="MessageTitle" runat="server" Text="回复买家留言信息" /></caption>
                    <tr>
                        <td class="OrderTitle">
                            买家名称：
                        </td>
                        <td>
                            <asp:Literal ID="ltrSendName" runat="server" />
                            <%--<asp:TextBox ID="TxtSendName" runat="server" Width="300px"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtSendName"
                            ErrorMessage="收件人不能空"/>--%>
                        </td>
                    </tr>
                    <tr>
                        <td class="OrderTitle">
                            内容：
                        </td>
                        <td>
                            <asp:TextBox ID="txtContent" runat="server" Height="300px" TextMode="MultiLine" Width="400px" /><asp:Label
                                ID="LbComtentError" runat="server" Text="" ForeColor="Red"></asp:Label>
                            <span style="color: Black">(注：内容长度不能超过1500个字符)</span>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtContent"
                                ErrorMessage="内容不能空" Display="Dynamic" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:CheckBox ID="CheckBox1" runat="server" Text="发送同时保存副本" Checked="true" />
                            <asp:Button ID="ButdSend" runat="server" Text="发 送" OnClick="ButdSend_Click" />
                            <input type="button" id="btnBack0" onclick="location.href='Shop_Buyer_Message.aspx'"
                                value="返 回" />
                        </td>
                    </tr>
                </table>
            </asp:PlaceHolder>
            <asp:PlaceHolder ID="readPanel" runat="server">
                <table class="ShopOrderStyle" style="width: 100%">
                    <caption>
                        <asp:Literal ID="Literal1" runat="server" Text="查看买家留言" /></caption>
                    <tr>
                        <td class="OrderTitle">
                            <asp:Literal ID="LiSender" Text="买家名称：" runat="server" />
                        </td>
                        <td>
                            <asp:Literal ID="ltrReadSenderName" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td class="OrderTitle">
                            内容：
                        </td>
                        <td>
                            <asp:Literal ID="ltrReadContent" runat="server" />
                            <%-- <asp:TextBox ID="TxtReadContent" ReadOnly="true" runat="server" Height="300px" TextMode="MultiLine" Width="400px"/>--%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="btnReply" runat="server" Text="回 复" OnClick="btnReply_Click" />
                            <%-- <asp:Button ID="btnBack" runat="server"  Text="返 回" />--%>
                            <input type="button" id="btnBack" onclick="location.href='Shop_Buyer_Message.aspx'"
                                value="返 回" />
                        </td>
                    </tr>
                </table>
            </asp:PlaceHolder>
        </div>
    </asp:Panel>
</asp:Content>
