本文整理汇总了C#中MerchantTribe类的典型用法代码示例。如果您正苦于以下问题:C# MerchantTribe类的具体用法?C# MerchantTribe怎么用?C# MerchantTribe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MerchantTribe类属于命名空间,在下文中一共展示了MerchantTribe类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ProductNavigator_Clicked
protected void ProductNavigator_Clicked(object sender, MerchantTribe.Commerce.Content.NotifyClickControl.ClickedEventArgs e)
{
if (!this.Save())
{
e.ErrorOccurred = true;
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:7,代码来源:BaseProductAdminPage.cs
示例2: Process
public void Process(List<ITemplateAction> actions, MerchantTribe.Commerce.MerchantTribeApplication app, ITagProvider tagProvider, ParsedTag tag, string innerContents)
{
this.App = app;
this.Url = new System.Web.Mvc.UrlHelper(app.CurrentRequestContext.RoutingContext);
CurrentCategory = app.CurrentRequestContext.CurrentCategory;
if (CurrentCategory == null)
{
CurrentCategory = new Category();
CurrentCategory.Bvin = "0";
}
StringBuilder sb = new StringBuilder();
sb.Append("<div class=\"categorymenu\">");
sb.Append("<div class=\"decoratedblock\">");
string title = tag.GetSafeAttribute("title");
if (title.Trim().Length > 0)
{
sb.Append("<h4>" + title + "</h4>");
}
sb.Append("<ul>");
int maxDepth = 5;
string mode = tag.GetSafeAttribute("mode");
switch (mode.Trim().ToUpperInvariant())
{
case "ROOT":
case "ROOTS":
// Root Categories Only
LoadRoots(sb);
break;
case "ALL":
// All Categories
LoadAllCategories(sb, maxDepth);
break;
case "":
case "PEERS":
// Peers, Children and Parents
LoadPeersAndChildren(sb);
break;
case "ROOTPLUS":
// Show root and expanded children
LoadRootPlusExpandedChildren(sb);
break;
default:
// All Categories
LoadPeersAndChildren(sb);
break;
}
sb.Append("</ul>");
sb.Append("</div>");
sb.Append("</div>");
actions.Add(new Actions.LiteralText(sb.ToString()));
}
开发者ID:NightOwl888,项目名称:MerchantTribe,代码行数:60,代码来源:PageMenu.cs
示例3: Process
public void Process(List<ITemplateAction> actions, MerchantTribe.Commerce.MerchantTribeApplication app, ITagProvider tagProvider, ParsedTag tag, string innerContents)
{
StringBuilder sb = new StringBuilder();
sb.Append("<" + _tagName);
string pathToTemplate = app.ThemeManager().ThemeFileUrl("",app) + "templates/";
foreach (var att in tag.Attributes)
{
string name = att.Key;
string val = att.Value;
if (_attributesToFix.Contains(att.Key.ToLowerInvariant()))
{
val = FixUpValue(val, pathToTemplate);
}
sb.Append(" " + name + "=\"" + val + "\"");
}
if (tag.IsSelfClosed)
{
sb.Append("/>");
}
else
{
sb.Append(">" + innerContents + "</" + _tagName + ">");
}
actions.Add(new Actions.LiteralText(sb.ToString()));
}
开发者ID:NightOwl888,项目名称:MerchantTribe,代码行数:29,代码来源:UrlFixer.cs
示例4: RenderNode
private static void RenderNode(StringBuilder sb, MerchantTribe.Web.SiteMapNode node)
{
sb.Append("<li>");
if (node.Url.Trim().Length > 0)
{
sb.Append("<a href=\"" + node.Url + "\">" + node.DisplayName + "</a>");
}
else
{
sb.Append("<strong>" + node.DisplayName + "</strong>");
}
if (node.Children.Count > 0)
{
sb.Append(System.Environment.NewLine);
sb.Append("<ul>" + System.Environment.NewLine);
foreach (MerchantTribe.Web.SiteMapNode child in node.Children)
{
RenderNode(sb, child);
}
sb.Append("</ul>" + System.Environment.NewLine);
}
sb.Append("</li>" + System.Environment.NewLine);
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:28,代码来源:Html.cs
示例5: Process
public void Process(StringBuilder output,
MerchantTribe.Commerce.MerchantTribeApplication app,
dynamic viewBag,
ITagProvider tagProvider,
ParsedTag tag,
string innerContents)
{
bool isSecureRequest = app.IsCurrentRequestSecure();
bool textOnly = !app.CurrentStore.Settings.UseLogoImage;
string textOnlyTag = tag.GetSafeAttribute("textonly").Trim().ToLowerInvariant();
if (textOnlyTag == "1" || textOnlyTag == "y" || textOnlyTag == "yes" || textOnlyTag == "true") textOnly = true;
string storeRootUrl = app.CurrentStore.RootUrl();
string storeName = app.CurrentStore.Settings.FriendlyName;
string logoImage = app.CurrentStore.Settings.LogoImageFullUrl(app, isSecureRequest);
string logoText = app.CurrentStore.Settings.LogoText;
LogoViewModel model = new LogoViewModel();
model.InnerContent = innerContents.Trim();
model.LinkUrl = storeRootUrl;
model.LogoImageUrl = logoImage;
model.LogoText = logoText;
model.StoreName = storeName;
model.UseTextOnly = textOnly;
Render(output, model);
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:27,代码来源:Logo.cs
示例6: DomesticProvider
public DomesticProvider(USPostalServiceGlobalSettings globalSettings, MerchantTribe.Web.Logging.ILogger logger)
{
_Logger = logger;
this.GlobalSettings = globalSettings;
Settings = new USPostalServiceSettings();
InitializeCodes();
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:7,代码来源:DomesticProvider.cs
示例7: Render
public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
{
ImageRotatorViewModel model = new ImageRotatorViewModel();
if (block != null)
{
var imageList = block.Lists.FindList("Images");
foreach (var listItem in imageList)
{
ImageRotatorImageViewModel img = new ImageRotatorImageViewModel();
img.ImageUrl = ResolveUrl(listItem.Setting1, app);
img.Url = listItem.Setting2;
if (img.Url.StartsWith("~"))
{
img.Url = app.CurrentRequestContext.UrlHelper.Content(img.Url);
}
img.NewWindow = (listItem.Setting3 == "1");
img.Caption = listItem.Setting4;
model.Images.Add(img);
}
string cleanId = MerchantTribe.Web.Text.ForceAlphaNumericOnly(block.Bvin);
model.CssId = "rotator" + cleanId;
model.CssClass = block.BaseSettings.GetSettingOrEmpty("cssclass");
model.Height = block.BaseSettings.GetIntegerSetting("Height");
model.Width = block.BaseSettings.GetIntegerSetting("Width");
if (block.BaseSettings.GetBoolSetting("ShowInOrder") == false)
{
RandomizeList(model.Images);
}
}
return RenderModel(model);
}
开发者ID:mikeshane,项目名称:MerchantTribe,代码行数:35,代码来源:ImageRotatorRenderController.cs
示例8: Process
public void Process(StringBuilder output,
MerchantTribe.Commerce.MerchantTribeApplication app,
dynamic viewBag,
ITagProvider tagProvider,
ParsedTag tag,
string innerContents)
{
MiniPagerViewModel model = new MiniPagerViewModel();
model.TotalPages = tag.GetSafeAttributeAsInteger("totalpages");
if (model.TotalPages >= 1)
{
// manual load
model.CurrentPage = tag.GetSafeAttributeAsInteger("currentpage");
model.PagerUrlFormat = tag.GetSafeAttribute("urlformat");
model.PagerUrlFormatFirst = tag.GetSafeAttribute("urlformatfirst");
if (model.CurrentPage < 1) model.CurrentPage = GetPageFromRequest(app);
}
else
{
// find everything from current category
model = FindModelForCurrentCategory(app, viewBag, tag);
}
Render(output, model);
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:26,代码来源:MiniPager.cs
示例9: RatePackage
public static ShippingRate RatePackage(FedExGlobalServiceSettings globals,
MerchantTribe.Web.Logging.ILogger logger,
FedExServiceSettings settings,
IShipment package)
{
ShippingRate result = new ShippingRate();
// Get ServiceType
ServiceType currentServiceType = ServiceType.FEDEXGROUND;
currentServiceType = (ServiceType)settings.ServiceCode;
// Get PackageType
PackageType currentPackagingType = PackageType.YOURPACKAGING;
currentPackagingType = (PackageType)settings.Packaging;
// Set max weight by service
CarrierCodeType carCode = GetCarrierCode(currentServiceType);
result.EstimatedCost = RateSinglePackage(globals,
logger,
package,
currentServiceType,
currentPackagingType,
carCode);
return result;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:27,代码来源:RateService.cs
示例10: PopulateFromPaymentTransaction
public void PopulateFromPaymentTransaction(MerchantTribe.Payment.Transaction t)
{
if (t != null)
{
TimeStampUtc = DateTime.UtcNow;
Action = t.Action;
Amount = t.Amount;
if (t.Action == ActionType.CreditCardRefund)
{
Amount = (t.Amount * -1);
}
CreditCard = t.Card;
Success = t.Result.Succeeded;
Voided = false;
RefNum1 = t.Result.ReferenceNumber;
RefNum2 = t.Result.ReferenceNumber2;
Messages = string.Empty;
if (t.Result.Messages.Count > 0)
{
foreach (Message m in t.Result.Messages)
{
Messages += m.Code + "::" + m.Description;
}
}
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:26,代码来源:Transaction.cs
示例11: Render
public void Render(StringBuilder sb, MerchantTribe.Commerce.Catalog.Product p, MerchantTribeApplication app)
{
if (p == null) return;
if (p.Bvin == string.Empty) return;
var model = new SingleProductViewModel(p, app);
RenderModel(sb, model, app);
}
开发者ID:mikeshane,项目名称:MerchantTribe,代码行数:7,代码来源:SingleProduct.cs
示例12: PopulateFromPaymentTransaction
public void PopulateFromPaymentTransaction(MerchantTribe.Payment.Transaction t)
{
if (t != null)
{
TimeStampUtc = DateTime.UtcNow;
Action = t.Action;
Amount = t.Amount;
if (t.IsRefundTransaction)
{
Amount = (t.Amount * -1);
}
CreditCard = t.Card;
Success = t.Result.Succeeded;
Voided = false;
RefNum1 = t.Result.ReferenceNumber;
RefNum2 = t.Result.ReferenceNumber2;
Messages = string.Empty;
if (t.Result.Messages.Count > 0)
{
foreach (Message m in t.Result.Messages)
{
Messages += ":: " + m.Code + " - " + m.Description + " ";
}
}
this.CheckNumber = t.CheckNumber;
this.PurchaseOrderNumber = t.PurchaseOrderNumber;
this.GiftCardNumber = t.GiftCardNumber;
this.CompanyAccountNumber = t.CompanyAccountNumber;
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:30,代码来源:OrderTransaction.cs
示例13: ShowMessage
public void ShowMessage(string msg, MerchantTribe.Commerce.Content.DisplayMessageType msgType)
{
this.litMain.Text += "<div class=\"";
switch (msgType)
{
case DisplayMessageType.Error:
this.litMain.Text += "flash-message-error";
break;
case DisplayMessageType.Exception:
this.litMain.Text += "flash-message-exception";
break;
case DisplayMessageType.Information:
this.litMain.Text += "flash-message-info";
break;
case DisplayMessageType.Question:
this.litMain.Text += "flash-message-question";
break;
case DisplayMessageType.Success:
this.litMain.Text += "flash-message-success";
break;
case DisplayMessageType.Warning:
this.litMain.Text += "flash-message-warning";
break;
case DisplayMessageType.Minor:
this.litMain.Text += "flash-message-minor";
break;
}
this.litMain.Text += "\">" + msg + "</div>";
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:30,代码来源:MessageBox.ascx.cs
示例14: Process
public void Process(List<ITemplateAction> actions, MerchantTribe.Commerce.MerchantTribeApplication app, ITagProvider tagProvider, ParsedTag tag, string innerContents)
{
string fileUrl = string.Empty;
bool secure = app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection;
var tm = app.ThemeManager();
string mode = tag.GetSafeAttribute("mode");
if (mode == "legacy")
{
fileUrl = tm.CurrentStyleSheet(app, secure);
}
else if (mode == "system")
{
string cssFile = tag.GetSafeAttribute("file");
fileUrl = app.StoreUrl(secure, false) + cssFile.TrimStart('/');
}
else
{
string fileName = tag.GetSafeAttribute("file");
fileUrl = tm.ThemeFileUrl(fileName, app);
}
string result = string.Empty;
result = "<link href=\"" + fileUrl + "\" rel=\"stylesheet\" type=\"text/css\" />";
actions.Add(new Actions.LiteralText(result));
}
开发者ID:NightOwl888,项目名称:MerchantTribe,代码行数:27,代码来源:Css.cs
示例15: Process
public void Process(StringBuilder output,
MerchantTribe.Commerce.MerchantTribeApplication app,
dynamic viewBag,
ITagProvider tagProvider,
ParsedTag tag,
string innerContents)
{
output.Append("<" + _tagName);
string pathToTemplate = app.ThemeManager().ThemeFileUrl("",app) + "templates/";
if (pathToTemplate.StartsWith("http://"))
{
pathToTemplate = pathToTemplate.Replace("http://", "//");
}
foreach (var att in tag.Attributes)
{
string name = att.Key;
string val = att.Value;
if (_attributesToFix.Contains(att.Key.ToLowerInvariant()))
{
val = FixUpValue(val, pathToTemplate);
}
output.Append(" " + name + "=\"" + val + "\"");
}
if (tag.IsSelfClosed)
{
output.Append("/>");
}
else
{
output.Append(">" + innerContents + "</" + _tagName + ">");
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:35,代码来源:UrlFixer.cs
示例16: ShippingRateDisplay
public ShippingRateDisplay(MerchantTribe.Shipping.IShippingRate rate)
{
this._DisplayName = rate.DisplayName;
this._Rate = rate.EstimatedCost;
this._ProviderId = rate.ServiceId;
this._ProviderServiceCode = rate.ServiceCodes;
}
开发者ID:NightOwl888,项目名称:MerchantTribe,代码行数:7,代码来源:ShippingRateDisplay.cs
示例17: CallTasksOnStore
private static void CallTasksOnStore(MerchantTribe.Commerce.Accounts.StoreDomainSnapshot snap)
{
string storekey = System.Configuration.ConfigurationManager.AppSettings["storekey"];
string rootUrl = snap.RootUrl();
string destination = rootUrl + "scheduledtasks/" + storekey;
MerchantTribe.Commerce.Utilities.WebForms.SendRequestByPost(destination, string.Empty);
}
开发者ID:tony722,项目名称:MerchantTribe,代码行数:7,代码来源:Global.asax.cs
示例18: UPSService
public UPSService(UPSServiceGlobalSettings globalSettings, MerchantTribe.Web.Logging.ILogger logger)
{
_Logger = logger;
GlobalSettings = globalSettings;
Settings = new UPSServiceSettings();
InitializeCodes();
}
开发者ID:KimRossey,项目名称:MerchantTribe,代码行数:7,代码来源:UPSService.cs
示例19: Process
public void Process(StringBuilder output,
MerchantTribe.Commerce.MerchantTribeApplication app,
dynamic viewBag,
ITagProvider tagProvider,
ParsedTag tag,
string innerContents)
{
bool secure = app.IsCurrentRequestSecure();
string mode = tag.GetSafeAttribute("mode");
if (mode == "system")
{
string baseScriptFolder = app.CurrentStore.RootUrl();
if (secure) baseScriptFolder = app.CurrentStore.RootUrlSecure();
if (baseScriptFolder.EndsWith("/") == false)
{
baseScriptFolder += "/";
}
baseScriptFolder += "scripts/";
bool useCDN = false;
string cdn = tag.GetSafeAttribute("cdn");
if (cdn == "1" || cdn == "true" || cdn == "y" || cdn == "Y") useCDN = true;
if (useCDN)
{
// CDN JQuery
if (secure)
{
output.Append("<script src='https://ajax.microsoft.com/ajax/jQuery/jquery-1.5.1.min.js' type=\"text/javascript\"></script>");
}
else
{
output.Append("<script src='http://ajax.microsoft.com/ajax/jQuery/jquery-1.5.1.min.js' type=\"text/javascript\"></script>");
}
}
else
{
// Local JQuery
output.Append("<script src='" + baseScriptFolder + "jquery-1.5.1.min.js' type=\"text/javascript\"></script>");
}
output.Append(System.Environment.NewLine);
output.Append("<script src='" + baseScriptFolder + "jquery-ui-1.8.7.custom/js/jquery-ui-1.8.7.custom.min.js' type=\"text/javascript\"></script>");
output.Append("<script src='" + baseScriptFolder + "jquery.form.js' type=\"text/javascript\"></script>");
output.Append(System.Environment.NewLine);
}
else
{
string src = tag.GetSafeAttribute("src");
string fileName = tag.GetSafeAttribute("file");
if (fileName.Trim().Length > 0)
{
var tm = app.ThemeManager();
src = tm.ThemeFileUrl(fileName, app);
}
output.Append("<script src=\"" + src + "\" type=\"text/javascript\"></script>");
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:59,代码来源:JavaScript.cs
示例20: Render
public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
{
ProductListViewModel model = new ProductListViewModel();
model.Title = SiteTerms.GetTerm(SiteTermIds.RecentlyViewedItems);
model.Items = LoadItems(app);
return RenderModel(model, app);
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:8,代码来源:LastViewedProductsRenderController.cs
注:本文中的MerchantTribe类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论