<%@ Page language="c#" AutoEventWireup="false" EnableViewState="false" Inherits="SocoShop.Page.ProductCommentAjax" %>
<%@ Import namespace="SocoShop.Entity" %>
<%@ Import namespace="SocoShop.Business" %>
<%@ Import namespace="SocoShop.Common" %>
<%@ Import namespace="SkyCES.EntLib" %>
<%@ Import namespace="System.Diagnostics" %>
<script runat="server">
protected override void OnInit(EventArgs e)
{
	/* 
		本页面代码由天易模板生成于 2011/3/6 19:11:39.
	*/
	Stopwatch sw = new Stopwatch();
	sw.Start();
	base.OnInit(e);
	sw.Stop();
	 decimal processTime=Convert.ToDecimal(sw.ElapsedMilliseconds) / 1000;
	StringBuilder document = new StringBuilder();
	document.Append("<div class=\"height10\"></div>\r\n");
	foreach(ProductCommentInfo productComment in productCommentList)
{
	document.Append("<div class=\"productComment\">\r\n");
	document.Append("    <ul class=\"userInfo\">\r\n");
	if(productComment.UserID>0)
{
	
            UserInfo tempUser=UserBLL.ReadUserByUserList(userList,productComment.UserID);
            string userPhoto = tempUser.Photo;
            if (userPhoto == string.Empty)
            {
                userPhoto = "/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/Style/Images/NoImage.gif";
            }
            else
            {
                userPhoto = userPhoto.Replace("Original", "70-70");
            }
        
	document.Append("        <li class=\"photo\"><img src=\""+userPhoto+"\"  onload=\"photoLoad(this,70,70)\"/></li>\r\n");
	document.Append("        <li class=\"name\">"+productComment.UserName+"</li>\r\n");
	document.Append("        <li><a href=\"javascript:addFriend("+productComment.UserID+")\"><img src=\"/Plugins/Template/Red/style/images/addFriend.gif\" /> 加为好友</a></li>\r\n");
	}
else
{
	document.Append("        <li class=\"photo\"><img src=\"/Plugins/Template/Red/Style/Images/NoImage.gif\" onload=\"photoLoad(this,70,70)\" /></li>\r\n");
	document.Append("        <li class=\"name\">匿名用户</li>\r\n");
	 }
	document.Append("    </ul>\r\n");
	document.Append("    <ul class=\"commentContent\">\r\n");
	document.Append("        <li class=\"name\">"+productComment.Title+" <span><a href=\"/ProductReply-C"+productComment.ID+".aspx\">回复(<strong>"+productComment.ReplyCount+"</strong>)</a>　<a href=\"javascript:support("+productComment.ID+")\">有用(<strong id=\"Support"+productComment.ID+"\">"+productComment.Support+"</strong>)</a>　<a href=\"javascript:against("+productComment.ID+")\">没用(<strong  id=\"Against"+productComment.ID+"\">"+productComment.Against+"</strong>)</a></span></li>\r\n");
	document.Append("        <li class=\"border1\"></li>\r\n");
	document.Append("        <li>评分：\r\n");
	for(int k=1;k<=productComment.Rank;k++)
{
	document.Append("<img src=\"/Plugins/Template/Red/Style/Images/s1.gif\" />\r\n");
	}
	for(int m=productComment.Rank+1;m<=5;m++)
{
	document.Append("<img src=\"/Plugins/Template/Red/Style/Images/s0.gif\" />\r\n");
	}
	document.Append("</li>\r\n");
	document.Append("        <li>"+productComment.Content+"</li>\r\n");
	if(productComment.AdminReplyContent!=string.Empty)
{
	document.Append("        <li class=\"adminReplyContent\">管理员回复："+productComment.AdminReplyContent+"</li>\r\n");
	 }
	document.Append("    </ul>\r\n");
	document.Append("</div>\r\n");
	document.Append("<div class=\"height10\"></div>\r\n");
	}
	document.Append(""+ajaxPagerClass.ShowPage()+"\r\n");
	document.Append("<div class=\"height10\"></div>\r\n");
	Response.Write(document.ToString());
}
</script>