protected void RepKeyWords_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { KeywordInfo dataItem = (KeywordInfo)e.Item.DataItem; this.allKeyword = this.allKeyword + " " + dataItem.KeywordText; ExtendedLiteral literal = e.Item.FindControl("LitKeyword") as ExtendedLiteral; string format = "<a href=\"#\" onclick=\"add('{0}')\" title='{1}'>{2}</a>"; literal.HtmlEncode = false; literal.Text = string.Format(format, DataSecurity.HtmlEncode(DataSecurity.ConvertToJavaScript(dataItem.KeywordText)), DataSecurity.HtmlEncode(dataItem.KeywordText), (dataItem.KeywordText.Length < 6) ? DataSecurity.HtmlEncode(dataItem.KeywordText) : (DataSecurity.HtmlEncode(dataItem.KeywordText.Substring(0, 6)) + "...")); } }
protected void EgvIncludeFileList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { IncludeFileInfo dataItem = (IncludeFileInfo)e.Row.DataItem; TextBox box = (TextBox)e.Row.FindControl("TxtIncludeCode"); ExtendedLiteral literal = (ExtendedLiteral)e.Row.FindControl("LitFileName"); HyperLink link = (HyperLink)e.Row.FindControl("HlnkPreview"); string includeFilePath = SiteConfig.SiteOption.IncludeFilePath; includeFilePath = "~/" + includeFilePath + "/" + dataItem.FileName; FileInfo info2 = new FileInfo(HttpContext.Current.Request.MapPath(includeFilePath)); if (!info2.Exists) { ((LinkButton)e.Row.FindControl("LnkCreateIncludeFile")).Text = "生成"; literal.BeginTag = "<span style='color:red'>"; literal.Text = dataItem.FileName; literal.EndTag = "</span>"; link.Enabled = false; } else { literal.Text = dataItem.FileName; } switch (dataItem.IncludeType) { case IncludeType.JSWriteHtml: case IncludeType.JS: box.Text = "<script type=\"text/javascript\" src=\"{PE.SiteConfig.ApplicationPath /}{PE.SiteConfig.includefilepath /}/" + dataItem.FileName + "\"></script>"; return; case IncludeType.Html: box.Text = "<!--#include File=\"{PE.SiteConfig.ApplicationPath /}{PE.SiteConfig.includefilepath /}/" + dataItem.FileName + "\"-->"; return; default: return; } } }
protected void RptCommentManage_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { ExtendedLiteral literal = e.Item.FindControl("LblCommentHead") as ExtendedLiteral; Label label = e.Item.FindControl("LblStatus") as Label; Label label2 = e.Item.FindControl("LblManage") as Label; ExtendedLiteral literal2 = e.Item.FindControl("LblRestore") as ExtendedLiteral; Label label3 = e.Item.FindControl("LblRestoreBottom") as Label; ExtendedLiteral literal3 = e.Item.FindControl("LblContent") as ExtendedLiteral; ExtendedLiteral literal4 = e.Item.FindControl("LblContentTitle") as ExtendedLiteral; ExtendedLiteral literal5 = e.Item.FindControl("LblRestoreTitle") as ExtendedLiteral; CommentInfo dataItem = (CommentInfo)e.Item.DataItem; string nodeIds = dataItem.NodeId.ToString(); if (!this.m_Administrator) { NodeInfo cacheNodeById = Nodes.GetCacheNodeById(dataItem.NodeId); if (cacheNodeById.ParentId > 0) { nodeIds = cacheNodeById.ParentPath + "," + nodeIds; } } string title = ContentManage.GetCommonModelInfoById(dataItem.GeneralId).Title; string str3 = "CommentID=" + dataItem.CommentId.ToString() + "&GeneralID=" + dataItem.GeneralId.ToString() + "&NodeID=" + BasePage.RequestInt32("NodeID").ToString() + "&Title=" + base.Server.UrlEncode(title) + "&UserId=" + dataItem.UserId.ToString(); if ((this.m_PrevId != dataItem.GeneralId) && (this.m_PrevId != 0)) { label3.Visible = true; label3.Text = "</table></td></tr></table><br/>"; } if ((this.m_PrevId != dataItem.GeneralId) || (this.m_PrevId == 0)) { StringBuilder builder = new StringBuilder(); builder.Append("<table class='border' width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>"); builder.Append("<tr class='title'>"); builder.Append("<td width='80%' height='22'>"); builder.Append(" <a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='ContentView.aspx?GeneralID=" + dataItem.GeneralId.ToString() + "'") + " >"); StringBuilder builder2 = new StringBuilder(); builder2.Append("</a> 总评分:" + Comment.ScoreCount(dataItem.GeneralId).ToString() + "</td>"); builder2.Append("<td width='20%' align='right'>"); builder2.Append("<a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentManage.aspx?Action=DelAll&" + str3 + "' onclick=\"return confirm('确定要删除此项目下的所有评论吗?');\"") + ">删除此项目下的所有评论</a> </td>"); builder2.Append("</tr><tr><td colspan='2'>"); builder2.Append("<table border='0' cellspacing='1' width='100%' cellpadding='0' style='word-break:break-all'>"); builder2.Append("</td>"); builder2.Append("</tr>"); literal.Visible = true; literal.BeginTag = builder.ToString(); literal.Text = title; literal.EndTag = builder2.ToString(); } this.m_PrevId = dataItem.GeneralId; StringBuilder builder3 = new StringBuilder(); string replyUserName = ""; if (dataItem.UserName == "游客") { builder3.Append("[游客] "); replyUserName = dataItem.ReplyUserName; } else { builder3.Append("[会员] "); replyUserName = dataItem.UserName; } StringBuilder builder4 = new StringBuilder(); builder4.Append(" 于 " + dataItem.UpdateDateTime.ToString("yyyy年MM月dd日 HH时mm分ss秒") + " 发表如下评论内容,同时评分:" + dataItem.Score.ToString() + "分"); builder4.Append("<br/>"); literal4.BeginTag = builder3.ToString(); literal4.Text = replyUserName; literal4.EndTag = builder4.ToString(); literal3.BeginTag = " <span >"; if (dataItem.Content.Length > 120) { literal3.Text = dataItem.Content.Substring(0, 120) + "..."; } else { literal3.Text = dataItem.Content; } literal3.EndTag = "</span>"; if (!dataItem.Status) { label.Text = "<span style='color:red'>\x00d7</span>"; } else { label.Text = "√"; } StringBuilder builder5 = new StringBuilder(); builder5.Append("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr>"); builder5.Append("<td align='center' style='width:30px;'>"); if (string.IsNullOrEmpty(dataItem.Reply)) { builder5.Append("<a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentReply, "href='CommentRestore.aspx?" + str3 + "'") + ">回复</a>"); } builder5.Append("</td>"); builder5.Append("<td align='center' style='width:35px;'><a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentModify.aspx?Action=Modify&" + str3 + "'") + " >修改</a></td>"); builder5.Append("<td align='center' style='width:35px;'><a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentManage.aspx?Action=Del&" + str3 + "' onclick=\"return confirm('确定要删除此评论吗?');\"") + " >删除</a></td>"); builder5.Append("<td align='center' style='width:50px;'>"); if (!dataItem.Status) { builder5.Append("<a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentCheck, "href='CommentManage.aspx?Action=SetPassed&" + str3 + "'") + " onclick=\"if(!confirm('确定要通过此评论吗?')){return false;}\" >通过审核</a>"); } else { builder5.Append("<a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentCheck, "href='CommentManage.aspx?Action=CancelPassed&" + str3 + "'") + " onclick=\"if(!confirm('确定要取消此评论吗?')){return false;}\" >取消审核</a>"); } builder5.Append("</td>"); builder5.Append("</tr></table>"); label2.Text = builder5.ToString(); if (!string.IsNullOrEmpty(dataItem.Reply)) { string reply = dataItem.Reply; if (dataItem.Reply.Length > 20) { reply = reply.Substring(0, 20) + ".."; } StringBuilder builder6 = new StringBuilder(); builder6.Append("<tr class='tdbg' onmouseout=\"this.className='tdbg'\" onmouseover=\"this.className='tdbgmouseover'\">"); builder6.Append("<td align='center'> </td>"); builder6.Append(" <td colspan='2' align='left'>[管理员] "); literal5.BeginTag = builder6.ToString(); literal5.Text = dataItem.ReplyAdmin; literal5.EndTag = " 于 " + dataItem.ReplyDateTime.ToString("yyyy年MM月dd日 HH时mm分ss秒"); literal2.BeginTag = " 回复:<br/>"; literal2.Text = dataItem.Reply; StringBuilder builder7 = new StringBuilder(); builder7.Append("<td align='center'>"); builder7.Append("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' style='width:30px;'></td>"); builder7.Append("<td align='center' style='width:35px;'><a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentReplyModify.aspx?Action=Reply&" + str3 + "'") + " >修改</a></td>"); builder7.Append("<td align='center' style='width:35px;'><a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentManage.aspx?Action=DelReply&" + str3 + "' onclick=\"return confirm('确定要删除此评论的管理员回复吗?');\" ") + " >删除</a></td>"); builder7.Append("<td align='center' style='width:50px;'></td></tr></table></td>"); builder7.Append("</tr>"); literal2.EndTag = builder7.ToString(); literal2.Visible = true; literal5.Visible = true; } } }
protected void RptContent_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item)) { Literal literal2; StringBuilder builder; FieldInfo dataItem = e.Item.DataItem as FieldInfo; this.InitTabByFieldType(e, dataItem); ExtendedLiteral literal = e.Item.FindControl("LitContentText") as ExtendedLiteral; Panel panel = e.Item.FindControl("PnlContent") as Panel; string status = this.contentDataTable.Rows[0][dataItem.FieldName].ToString(); if (dataItem.FieldType == FieldType.KeywordType) { status = StringHelper.ReplaceChar(this.contentDataTable.Rows[0][dataItem.FieldName].ToString(), '|', ' '); } switch (dataItem.FieldType) { case FieldType.SpecialType: literal2 = new Literal(); builder = new StringBuilder(); if (this.m_GeneralId > 0) { string[] strArray = Special.GetSpecialInfoIds(this.m_GeneralId).Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < strArray.Length; i++) { SpecialInfo specialInfoById = Special.GetSpecialInfoById(DataConverter.CLng(strArray[i])); SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialInfoById.SpecialCategoryId); builder.Append("\n<span>"); builder.Append(DataSecurity.HtmlEncode(specialCategoryInfoById.SpecialCategoryName) + ">>" + DataSecurity.HtmlEncode(specialInfoById.SpecialName)); builder.Append("<br /></span>"); } } break; case FieldType.StatusType: literal.Text = this.GetStatusShow(status); return; case FieldType.ContentType: literal.BeginTag = "<iframe marginwidth='0' marginheight='0' frameborder='0' name='ContentPreview' width='650px' height='500px' src='ContentPreview.aspx?GeneralID=" + this.m_GeneralId.ToString() + "&fieldName=" + base.Server.UrlEncode(dataItem.FieldName) + "'></iframe>"; return; case FieldType.NodeType: literal.BeginTag = EasyOne.Contents.Nodes.ShowNodeNavigation(DataConverter.CLng(status)); return; case FieldType.InfoType: { Literal child = new Literal(); StringBuilder builder2 = new StringBuilder(); if (this.m_GeneralId > 0) { foreach (CommonModelInfo info4 in ContentManage.GetInfoList(this.m_GeneralId)) { builder2.Append("<span>"); builder2.Append(EasyOne.Contents.Nodes.ShowNodesAndRootNavigation(info4.NodeId)); builder2.Append("<br /></span>"); } } if (builder2.Length <= 0) { builder2.Append("<span>无其它节点<br /></span>"); } literal.BeginTag = "<div style=\"margin: 0; padding: 0; float: left;\">" + builder2.ToString() + "</div>"; panel.Controls.Add(child); return; } case FieldType.MultipleHtmlTextType: literal.BeginTag = status; return; default: literal.Text = status; return; } if (builder.Length <= 0) { builder.Append("<span id='SpecialSpanId0'>无专题<br /></span>"); } literal.BeginTag = "<div style=\"margin: 0; padding: 0; float: left;\">" + builder.ToString() + "</div>"; panel.Controls.Add(literal2); } }
protected void RptShoppingCart_ItemDataBound(object sender, RepeaterItemEventArgs e) { ShopConfig shopConfig = SiteConfig.ShopConfig; bool isPaymentShowProducdtThumb = true; int paymentThumbsWidth = 0; int paymentThumbsHeight = 0; bool isShowPaymentProductType = true; bool isShowPaymentSaleType = true; bool isShowPaymentMarkPrice = true; if (this.IsPreview == 0) { isPaymentShowProducdtThumb = shopConfig.IsPaymentShowProducdtThumb; isShowPaymentProductType = shopConfig.IsShowPaymentProductType; isShowPaymentSaleType = shopConfig.IsShowPaymentSaleType; isShowPaymentMarkPrice = shopConfig.IsShowPaymentMarkPrice; paymentThumbsWidth = shopConfig.PaymentThumbsWidth; paymentThumbsHeight = shopConfig.PaymentThumbsHeight; } else if (this.IsPreview == 1) { isPaymentShowProducdtThumb = shopConfig.IsPreviewShowProducdtThumb; isShowPaymentProductType = shopConfig.IsShowPreviewProductType; isShowPaymentSaleType = shopConfig.IsShowPreviewSaleType; isShowPaymentMarkPrice = shopConfig.IsShowPreviewMarkPrice; paymentThumbsWidth = shopConfig.PreviewThumbsWidth; paymentThumbsHeight = shopConfig.PreviewThumbsHeight; } if ((e.Item.ItemType != ListItemType.Item) && (e.Item.ItemType != ListItemType.AlternatingItem)) { if (e.Item.ItemType == ListItemType.Footer) { PresentProjectInfo presentProInfo = new PresentProjectInfo(true); if (this.m_IsPreview != 3) { presentProInfo = PresentProject.GetPresentProjectByTotalMoney(this.total); this.presentExpInfomation = this.ShowPresentExp(presentProInfo).ToString(); } if (this.m_IsPreview == 1) { int presentId = DataConverter.CLng(this.PresentId); PlaceHolder holder = (PlaceHolder)e.Item.FindControl("PlhPresentInfo"); holder.Visible = false; if (((presentId > 0) && !presentProInfo.IsNull) && (presentProInfo.PresentContent.Contains("1") && (presentId > 0))) { holder.Visible = true; AbstractItemInfo info7 = new ConcretePresentProject(presentId, presentProInfo); info7.GetItemInfo(); Label label2 = (Label)e.Item.FindControl("LblProductName"); Label label3 = (Label)e.Item.FindControl("LblUnit"); Label label4 = (Label)e.Item.FindControl("LblPresentPriceMarket"); Label label5 = (Label)e.Item.FindControl("LblPresentPrice"); Label label6 = (Label)e.Item.FindControl("LblPresentPrice1"); label2.Text = info7.ProductName; label3.Text = info7.Unit; label4.Text = info7.PriceMarket.ToString("0.00"); label5.Text = info7.Price.ToString("0.00"); label6.Text = info7.Price.ToString("0.00"); this.weight += info7.TotalWeight; this.total += info7.Price; } ((PlaceHolder)e.Item.FindControl("PlhMoneyInfo")).Visible = true; Label label7 = (Label)e.Item.FindControl("LblDeliverCharge"); Label label8 = (Label)e.Item.FindControl("LblTaxRate"); Label label9 = (Label)e.Item.FindControl("LblIncludeTax"); Label label10 = (Label)e.Item.FindControl("LblCoupon"); Label label11 = (Label)e.Item.FindControl("LblTotalMoney"); Label label12 = (Label)e.Item.FindControl("LblTrueTotalMoney"); PackageInfo packageByGoodsWeight = Package.GetPackageByGoodsWeight(this.weight); if (!packageByGoodsWeight.IsNull) { this.weight += packageByGoodsWeight.PackageWeight; } decimal num7 = DeliverCharge.GetDeliverCharge(this.m_DeliverType, this.weight, this.m_ZipCode, this.total, this.m_NeedInvoice); DeliverTypeInfo deliverTypeById = EasyOne.Shop.DeliverType.GetDeliverTypeById(this.m_DeliverType); label7.Text = num7.ToString("0.00"); label8.Text = deliverTypeById.TaxRate.ToString(); if ((deliverTypeById.IncludeTax == TaxRateType.IncludeTaxNoInvoiceFavourable) || (deliverTypeById.IncludeTax == TaxRateType.IncludeTaxNoInvoiceNoFavourable)) { label9.Text = "是"; } else { label9.Text = "否"; } decimal num8 = this.total + num7; if (this.m_CouponMoney > 0M) { label10.Visible = true; decimal num9 = this.total - this.m_CouponMoney; if (num9 < 0M) { num9 = 0M; } num8 = num9 + num7; label10.Text = "使用优惠券,面值为:" + this.m_CouponMoney.ToString("0.00") + "元,商品实际价格为:" + num9.ToString("0.00") + "元 <br>"; label11.Text = num9.ToString("0.00") + "+" + num7.ToString("0.00") + "=" + num8.ToString("0.00") + "元"; label12.Text = num8.ToString("0.00"); } else { label10.Visible = false; label11.Text = this.total.ToString("0.00") + "+" + num7.ToString("0.00") + "=" + num8.ToString("0.00") + "元"; label12.Text = num8.ToString("0.00"); } this.ViewState["TrueTotalMoney"] = num8; } else { ((PlaceHolder)e.Item.FindControl("PlhMoneyInfo")).Visible = false; } ExtendedImage image3 = (ExtendedImage)e.Item.FindControl("presentImage"); Control control9 = e.Item.FindControl("footerPresentImage"); Control control10 = e.Item.FindControl("footerTdThemeImage"); Control control11 = e.Item.FindControl("footerTdProductType"); Control control12 = e.Item.FindControl("footerTdSaleType"); Control control13 = e.Item.FindControl("footerTdMarkPrice"); Control control14 = e.Item.FindControl("footerTdThemeImage"); Control control15 = e.Item.FindControl("footerTdMoneyInfoSaleType"); Control control16 = e.Item.FindControl("footerTdMoneyInfoMarkPrice"); Control control17 = e.Item.FindControl("footerPresentType"); Control control18 = e.Item.FindControl("footerPresentSaleType"); Control control19 = e.Item.FindControl("footerPresentMarkPrice"); if (!isPaymentShowProducdtThumb) { control10.Visible = false; control9.Visible = false; } else { PresentInfo presentById = Present.GetPresentById(DataConverter.CLng(this.PresentId)); if (!string.IsNullOrEmpty(presentById.PresentThumb)) { image3.Src = presentById.PresentThumb; } else { image3.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } image3.Width = paymentThumbsWidth; image3.Height = paymentThumbsHeight; } if (!isShowPaymentProductType) { control11.Visible = false; control14.Visible = false; control17.Visible = false; } if (!isShowPaymentSaleType) { control12.Visible = false; control15.Visible = false; control18.Visible = false; } if (!isShowPaymentMarkPrice) { control13.Visible = false; control16.Visible = false; control19.Visible = false; return; } } else if (e.Item.ItemType == ListItemType.Header) { Control control20 = e.Item.FindControl("ProductImageTitle"); Control control21 = e.Item.FindControl("tdProductTypeTitle"); Control control22 = e.Item.FindControl("tdSaleTypeTitle"); Control control23 = e.Item.FindControl("tdMarkPriceTitle"); if (!isPaymentShowProducdtThumb) { control20.Visible = false; } if (!isShowPaymentProductType) { control21.Visible = false; } if (!isShowPaymentSaleType) { control22.Visible = false; } if (!isShowPaymentMarkPrice) { control23.Visible = false; } } return; } int productNum = 0; string str = ""; string str2 = ""; decimal subTotal = 0M; ShoppingCartInfo dataItem = (ShoppingCartInfo)e.Item.DataItem; if (dataItem == null) { return; } productNum = dataItem.Quantity; bool haveWholesalePurview = Convert.ToBoolean(this.ViewState["HaveWholesalePurview"]); str2 = ShoppingCart.GetSaleType(dataItem.ProductInfomation, productNum, haveWholesalePurview); str = ShoppingCart.GetProductType(dataItem.ProductInfomation, productNum, haveWholesalePurview); AbstractItemInfo info2 = new ConcreteProductInfo(productNum, dataItem.Property, dataItem.ProductInfomation, this.m_UserInfo, false, false, haveWholesalePurview); info2.GetItemInfo(); subTotal = info2.SubTotal; this.total += subTotal; this.totalExp += dataItem.ProductInfomation.PresentExp * productNum; this.totalMoney += dataItem.ProductInfomation.PresentMoney * productNum; this.totalPoint += dataItem.ProductInfomation.PresentPoint * productNum; this.weight += info2.TotalWeight; if (!string.IsNullOrEmpty(dataItem.Property)) { ((Literal)e.Item.FindControl("LitProperty")).Text = "(" + info2.Property + ")"; } InsideStaticLabel label = new InsideStaticLabel(); string str3 = "<a href='"; str3 = (str3 + label.GetInfoPath(info2.ProductId.ToString())) + "' Target='_blank'>" + info2.ProductName + "</a>"; ((Literal)e.Item.FindControl("LitProductName")).Text = str3; ((Literal)e.Item.FindControl("LitProductUnit")).Text = info2.Unit; ((Literal)e.Item.FindControl("LitTruePrice")).Text = info2.Price.ToString("0.00"); ((Literal)e.Item.FindControl("LitSubTotal")).Text = subTotal.ToString("0.00"); ExtendedImage image = (ExtendedImage)e.Item.FindControl("extendedImage"); ExtendedImage image2 = (ExtendedImage)e.Item.FindControl("extendedPresentImage"); Control control = e.Item.FindControl("ProductImage"); Control control2 = e.Item.FindControl("presentImage"); if (!isPaymentShowProducdtThumb) { image.Visible = false; control.Visible = false; control2.Visible = false; } else { if (!string.IsNullOrEmpty(dataItem.ProductInfomation.ProductThumb)) { image.Src = dataItem.ProductInfomation.ProductThumb; } else { image.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } image.ImageHeight = paymentThumbsHeight; image.ImageWidth = paymentThumbsWidth; if (dataItem.ProductInfomation.PresentId > 0) { PresentInfo info3 = Present.GetPresentById(dataItem.ProductInfomation.PresentId); if (!string.IsNullOrEmpty(info3.PresentThumb)) { image2.Src = info3.PresentThumb; } else { image2.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } image2.ImageHeight = paymentThumbsHeight; image2.ImageWidth = paymentThumbsWidth; } } if (!isShowPaymentProductType) { e.Item.FindControl("tdProductType").Visible = false; } else { ((Literal)e.Item.FindControl("LitProductType")).Text = str; } if (!isShowPaymentSaleType) { e.Item.FindControl("tdSaleType").Visible = false; } else { ((Literal)e.Item.FindControl("LitSaleType")).Text = str2; } if (!isShowPaymentMarkPrice) { e.Item.FindControl("tdMarkPrice").Visible = false; } else { ((Literal)e.Item.FindControl("LitPriceMarket")).Text = info2.PriceMarket.ToString("0.00"); } int num5 = Order.CountBuyNum(PEContext.Current.User.UserName, dataItem.ProductId); ProductInfo productById = Product.GetProductById(dataItem.ProductId); if ((productById.LimitNum > 0) && ((dataItem.Quantity + num5) > productById.LimitNum)) { BaseUserControl.WriteErrMsg(string.Concat(new object[] { "您订购了", num5, productById.Unit, productById.ProductName, ",曾经购买了", num5, productById.Unit, ",而此商品每人限购数量为", productById.LimitNum, productById.Unit, ",请重新调整您的购物车!" }), "ShoppingCart.aspx"); } if ((dataItem.ProductInfomation.SalePromotionType <= 0) || (productNum < dataItem.ProductInfomation.MinNumber)) { return; } e.Item.FindControl("PresentInfomation").Visible = true; string str4 = ""; string str5 = ""; string str6 = ""; AbstractItemInfo info5 = new ConcreteSalePromotionType(productNum, dataItem.ProductInfomation, false, null); info5.GetItemInfo(); switch (dataItem.ProductInfomation.SalePromotionType) { case 1: case 3: str5 = "<font color=red>(赠品)</font>"; str4 = "赠送礼品"; str6 = "赠送"; goto Label_06A1; case 2: case 4: if (info5.Price <= 0M) { str5 = "<font color=red>(赠送赠品)</font>"; str6 = "赠送"; break; } str5 = "<font color=red>(换购赠品)</font>"; str6 = "换购"; break; default: goto Label_06A1; } str4 = "促销礼品"; Label_06A1: if (this.PresentExist(this.m_CartId, info5.Id)) { ((HiddenField)e.Item.FindControl("HdnPresentId")).Value = info5.Id.ToString(); ExtendedLiteral literal = (ExtendedLiteral)e.Item.FindControl("LitPresentName"); literal.Text = info5.ProductName; literal.EndTag = str5; ((Literal)e.Item.FindControl("LitPresentUnit")).Text = info5.Unit; ((Literal)e.Item.FindControl("LitPresentNum")).Text = info5.Amount.ToString(); ((Literal)e.Item.FindControl("LitPresentTruePrice")).Text = info5.Price.ToString("0.00"); ((Literal)e.Item.FindControl("LitPresentSubtotal")).Text = info5.SubTotal.ToString("0.00"); this.total += info5.SubTotal; this.weight += info5.TotalWeight; } if (!isShowPaymentProductType) { e.Item.FindControl("tdPresentType").Visible = false; } else { ((Literal)e.Item.FindControl("LitPresentType")).Text = str4; } if (!isShowPaymentSaleType) { e.Item.FindControl("tdPresentSaleType").Visible = false; } else { ((Literal)e.Item.FindControl("LitPresentSaleType")).Text = str6; } if (!isShowPaymentMarkPrice) { e.Item.FindControl("tdPresentMarkPrice").Visible = false; } else { ((Literal)e.Item.FindControl("LitPresentPriceOriginal")).Text = info5.PriceMarket.ToString("0.00"); } }
protected void RptCommentManage_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { ExtendedLiteral literal = e.Item.FindControl("LblCommentHead") as ExtendedLiteral; Label label = e.Item.FindControl("LblStatus") as Label; Label label2 = e.Item.FindControl("LblManage") as Label; ExtendedLabel label3 = e.Item.FindControl("LblRestore") as ExtendedLabel; Label label4 = e.Item.FindControl("LblRestoreBottom") as Label; ExtendedLabel label5 = e.Item.FindControl("LblContent") as ExtendedLabel; Label label6 = e.Item.FindControl("LblUserRegTime") as Label; CommentInfo dataItem = (CommentInfo)e.Item.DataItem; string str = "CommentID=" + dataItem.CommentId.ToString() + "&GeneralID=" + dataItem.GeneralId.ToString() + "&NodeID=" + BasePage.RequestInt32("NodeID").ToString(); if ((this.m_PrevId != dataItem.GeneralId) && (this.m_PrevId != 0)) { label4.Visible = true; label4.Text = "</table></td></tr></table><br/>"; } if ((this.m_PrevId != dataItem.GeneralId) || (this.m_PrevId == 0)) { string title = ContentManage.GetCommonModelInfoById(dataItem.GeneralId).Title; StringBuilder builder = new StringBuilder(); builder.Append("<table class='border' width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>"); builder.Append("<tr class='title'>"); builder.Append("<td width='80%' height='22'>"); builder.Append(" "); if (!string.IsNullOrEmpty(title) && (title.Length > 20)) { title = title.Substring(0, 20) + ".."; } StringBuilder builder2 = new StringBuilder(); builder2.Append(" 总评分:" + Comment.ScoreCount(dataItem.GeneralId).ToString() + "</td>"); builder2.Append("<td width='20%' align='right'></td>"); builder2.Append("</tr><tr><td colspan='2'>"); builder2.Append("<table border='0' cellspacing='1' width='100%' cellpadding='0' style='word-break:break-all'>"); builder2.Append("<tr class='tdbg'>"); builder2.Append(" <td style='width:30px;' align='center'>ID</td>"); builder2.Append(" <td align='center'>评论内容</td>"); builder2.Append(" <td style='width:70px;' align='center'>评分</td>"); builder2.Append(" <td style='width:120px;' align='center'>发表日期</td>"); builder2.Append(" <td style='width:60px;' align='center'>审核状态</td>"); builder2.Append(" <td style='width:150px;' align='center'>评论操作</td>"); builder2.Append("</tr>"); builder2.Append("</td>"); builder2.Append("</tr>"); literal.Visible = true; literal.BeginTag = builder.ToString(); literal.Text = title; literal.EndTag = builder2.ToString(); } this.m_PrevId = dataItem.GeneralId; if (dataItem.Content.Length > 20) { label5.BeginTag = "<span title='" + dataItem.Content + "'>"; label5.Text = dataItem.Content.Substring(0, 20); label5.EndTag = "..</span>"; } else { label5.Text = dataItem.Content; } label6.Text = dataItem.UpdateDateTime.ToString("yyyy年MM月dd日 HH时mm分ss秒"); if (!dataItem.Status) { label.Text = "<span style='color:red'>\x00d7</span>"; } else { label.Text = "√"; } if (dataItem.Status) { label2.Text = ""; } else { StringBuilder builder3 = new StringBuilder(); builder3.Append("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr>"); builder3.Append("<td align='center' style='width:30px;'>"); builder3.Append("</td>"); builder3.Append("<td align='center' style='width:35px;'><a href='CommentModify.aspx?Action=Modify&" + str + "'>修改</a></td>"); builder3.Append("<td align='center' style='width:35px;'><a href='CommentManage.aspx?Action=Del&" + str + "' onclick=\"return confirm('确定要删除此评论吗?');\">删除</a></td>"); builder3.Append("<td align='center' style='width:50px;'>"); builder3.Append("</td>"); builder3.Append("</tr></table>"); label2.Text = builder3.ToString(); } if (!string.IsNullOrEmpty(dataItem.Reply)) { string reply = dataItem.Reply; if (dataItem.Reply.Length > 20) { reply = reply.Substring(0, 20) + ".."; } StringBuilder builder4 = new StringBuilder(); builder4.Append("<tr class='tdbg' onmouseout=\"this.className='tdbg'\" onmouseover=\"this.className='tdbgmouseover'\">"); builder4.Append("<td align='center'> </td>"); builder4.Append("<td colspan='2'> 回复:"); StringBuilder builder5 = new StringBuilder(); builder5.Append("<BR> </td>"); builder5.Append("<td width='200px' align='center'>" + dataItem.ReplyDateTime.ToString("yyyy年MM月dd日 HH时mm分ss秒") + "</td>"); builder5.Append("<td width='30px' align='center'> </td>"); builder5.Append("<td align='center'>"); builder5.Append("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' style='width:30px;'></td>"); builder5.Append("<td align='center' style='width:35px;'></td>"); builder5.Append("<td align='center' style='width:35px;'></td>"); builder5.Append("<td align='center' style='width:50px;'></td></tr></table></td>"); builder5.Append("</tr>"); label3.Visible = true; label3.BeginTag = builder4.ToString(); label3.Text = reply; label3.EndTag = builder5.ToString(); } } }