本文整理汇总了C#中Catalog.DisplayPrice方法的典型用法代码示例。如果您正苦于以下问题:C# Catalog.DisplayPrice方法的具体用法?C# Catalog.DisplayPrice怎么用?C# Catalog.DisplayPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog.DisplayPrice方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UserSpecificPriceForDisplay
public static string UserSpecificPriceForDisplay(Catalog.UserSpecificPrice price)
{
StringBuilder sb = new StringBuilder();
if (price.ListPriceGreaterThanCurrentPrice)
{
sb.Append("<label>" + Content.SiteTerms.GetTerm(Content.SiteTermIds.ListPrice) + "</label>");
sb.Append("<span class=\"choice\"><strike>");
sb.Append(price.ListPrice.ToString("C"));
sb.Append("</strike></span>");
}
sb.Append("<label>" + Content.SiteTerms.GetTerm(Content.SiteTermIds.SitePrice) + "</label>");
sb.Append("<span class=\"choice\">");
sb.Append(price.DisplayPrice());
sb.Append("</span>");
if ((price.BasePrice < price.ListPrice) && (price.OverrideText.Trim().Length < 1))
{
sb.Append("<label>" + Content.SiteTerms.GetTerm(Content.SiteTermIds.YouSave) + "</label>");
sb.Append("<span class=\"choice\">");
sb.Append(price.Savings.ToString("c")
+ " - "
+ price.SavingsPercent
+ System.Threading.Thread.CurrentThread.CurrentUICulture.NumberFormat.PercentSymbol);
sb.Append("</span>");
}
sb.Append("<div class=\"clear\"></div>");
return sb.ToString();
}
示例2: RenderSingleProduct
public static void RenderSingleProduct(ref StringBuilder sb,
Catalog.Product p,
bool isLastInRow,
bool isFirstInRow,
System.Web.UI.Page page,
Catalog.UserSpecificPrice price)
{
string destinationLink = Utilities.UrlRewriter.BuildUrlForProduct(p, page);
string imageUrl
= MerchantTribe.Commerce.Storage.DiskStorage.ProductImageUrlSmall(
((IMultiStorePage)page).MTApp,
p.Bvin,
p.ImageFileSmall,
page.Request.IsSecureConnection);
if (isLastInRow)
{
sb.Append("<div class=\"record lastrecord\">");
}
else if (isFirstInRow)
{
sb.Append("<div class=\"record firstrecord\">");
}
else
{
sb.Append("<div class=\"record\">");
}
sb.Append("<div class=\"recordimage\">");
sb.Append("<a href=\"" + destinationLink + "\">");
sb.Append("<img src=\"" + imageUrl + "\" border=\"0\" alt=\"" + p.ImageFileSmallAlternateText + "\" /></a>");
sb.Append("</div>");
sb.Append("<div class=\"recordname\">");
sb.Append("<a href=\"" + destinationLink + "\">" + p.ProductName + "</a>");
sb.Append("</div>");
sb.Append("<div class=\"recordsku\">");
sb.Append("<a href=\"" + destinationLink + "\">" + p.Sku + "</a>");
sb.Append("</div>");
sb.Append("<div class=\"recordprice\">");
sb.Append("<a href=\"" + destinationLink + "\">" + price.DisplayPrice(true) + "</a>");
sb.Append("</div>");
sb.Append("</div>");
}