<%@ Page language="c#" Codebehind="Review.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.Review" validateRequest=false %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
	    <!--#include file="inc/head.inc"-->
		<title>Review</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
			<script language="javascript">
			function CheckDelBox(box)    
			{
					for (var i=0;i<document.Form1.elements.length;i++)
				{
					var e = document.Form1.elements[i];
					if ( (e.type=='checkbox') )
					{
			            
							var o=e.name.lastIndexOf('deleteCheckbox');
			                
							if(o!=-1)
							{
								e.checked = box.checked;
							}
			        
					}
				}
			}
			</script>
	</HEAD>
	<body>
		<div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />留言评论管理</div>
		<div class="sub_container_content">
		    <form id="Form1" method="post" runat="server">
		        <div class="frame">
		            <div class="frame_title"><asp:Label ID="lbTitle" Runat="server" CssClass="tableHeaderText">商品评论管理</asp:Label></div>
		            <div class="frame_content">
			            <table class="tableBorder" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
				            <tr>
					            <td height="23" class="forumRowHighlight">
						            <asp:Button id="btnDelete" OnClick="btnDelete_Click" runat="server" Text="删除留言"></asp:Button>
						            <asp:datagrid id="dgReviews" runat="server" AllowPaging="True" PagerStyle-Mode="NumericPages"
							            AutoGenerateColumns="False" DataKeyField="ReviewID" Width="100%" HorizontalAlign="Center"
							            HeaderStyle-CssClass="summary-title">
							            <HeaderStyle Font-Bold="True" CssClass="summary-title"></HeaderStyle>
							            <Columns>
								            <asp:TemplateColumn>
									            <HeaderTemplate>
										            <input type="checkbox" id="checkDel" onclick="CheckDelBox(this)" />
									            </HeaderTemplate>
									            <ItemTemplate>
										            <asp:CheckBox id="deleteCheckbox" runat="server" AutoPostBack="False"></asp:CheckBox>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="对应商品">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center" Width="70px"></ItemStyle>
									            <ItemTemplate>
										            <a href='../products/Product_<%# DataBinder.Eval(Container.DataItem, "ProductID") %>.html' target=_blank>
											            <%# GetProductName(DataBinder.Eval(Container.DataItem, "ProductID").ToString()) %>
										            </a>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="确定" HeaderText="回复" CancelText="取消" EditText="点击回复">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center" Width="55px"></ItemStyle>
								            </asp:EditCommandColumn>
								            <asp:TemplateColumn HeaderText="评论内容">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Left"></ItemStyle>
									            <ItemTemplate>
										            <b>内容</b>：<%# DataBinder.Eval(Container.DataItem, "Body") %><br>
										            <b>回复</b>：<%# DataBinder.Eval(Container.DataItem, "Reply") %>
									            </ItemTemplate>
									            <EditItemTemplate>
										            <b>内容</b>：<br>
										            <asp:TextBox ID="txtBody" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Body") %>' TextMode="MultiLine" Width="290px">
										            </asp:TextBox><br>
										            <b>回复</b>：<br>
										            <asp:TextBox ID="txtReply" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Reply") %>' TextMode="MultiLine" Width="290px" Height="80px">
										            </asp:TextBox><br>
										            <asp:CheckBox ID="cbxSendEmail" Runat="server" Text='将回复结果发送到顾客的邮箱' Checked="True"></asp:CheckBox>
										            <asp:CheckBox ID="cbxActive" Runat="server" Text='审批通过'></asp:CheckBox>
									            </EditItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="用户名">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Left" Width="180px"></ItemStyle>
									            <ItemTemplate>
										            使用名字：<%# DataBinder.Eval(Container.DataItem, "UserName") %><br>
										            对应会员：<%# GetMemberName(DataBinder.Eval(Container.DataItem, "MemberID").ToString()) %><br>
										            Email：<%# DataBinder.Eval(Container.DataItem, "Email") %>
										            <%# GetScore(DataBinder.Eval(Container.DataItem, "Score").ToString()) %>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="其它信息">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Left" Width="120px"></ItemStyle>
									            <ItemTemplate>
										            时间：<%# DateTime.Parse(DataBinder.Eval(Container.DataItem, "AddTime").ToString()).ToString("yyyy-MM-dd") %><br>
										            IP地址：<%# DataBinder.Eval(Container.DataItem, "IP") %>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="状态">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
									            <ItemTemplate>
										            <img src='images/<%# (DataBinder.Eval(Container.DataItem, "Reply").ToString()) == "" ? "replyno.gif" : "replyyes.gif"%>' alt='<%# (DataBinder.Eval(Container.DataItem, "Reply").ToString()) == "" ? "未回复" : "已回复"%>'>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:ButtonColumn Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
									            CommandName="Delete">
									            <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
								            </asp:ButtonColumn>
							            </Columns>
							            <PagerStyle Mode="NumericPages"></PagerStyle>
						            </asp:datagrid>
					            </td>
				            </tr>
			            </table>
    		        
		            </div>
	            </div>
	        </form>
		</div>
		</div>
		</div>
	</body>
</HTML>
