本文整理汇总了C#中MerchantTribeApplication类的典型用法代码示例。如果您正苦于以下问题:C# MerchantTribeApplication类的具体用法?C# MerchantTribeApplication怎么用?C# MerchantTribeApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MerchantTribeApplication类属于命名空间,在下文中一共展示了MerchantTribeApplication类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TemplateProcessor
public TemplateProcessor(MerchantTribeApplication app, string template)
{
this.Handlers = new Dictionary<string, ITagHandler>();
InitializeTagHandlers();
this.MTApp = app;
this.Template = template;
}
开发者ID:tony722,项目名称:MerchantTribe,代码行数:7,代码来源:TemplateProcessor.cs
示例2: FriendlyDescription
public override string FriendlyDescription(MerchantTribeApplication app)
{
string result = "";
switch(HasMode)
{
case QualificationHasMode.HasAtLeast:
result += "When order has AT LEAST ";
break;
}
result += this.Quantity.ToString();
switch(SetMode)
{
case QualificationSetMode.AllOfTheseItems:
result += " of ALL of these products";
break;
case QualificationSetMode.AnyOfTheseItems:
result += " of ANY of these products";
break;
}
result += ":<ul>";
foreach (string bvin in this.CurrentProductIds())
{
Catalog.Product p = app.CatalogServices.Products.Find(bvin);
if (p != null)
{
result += "<li>[" + p.Sku + "] " + p.ProductName + "</li>";
}
}
result += "</ul>";
return result;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:33,代码来源:OrderHasProducts.cs
示例3: RedirectToMainStoreUrl
public static void RedirectToMainStoreUrl(long storeId, System.Uri requestedUrl, MerchantTribeApplication app)
{
Accounts.Store store = app.AccountServices.Stores.FindById(storeId);
if (store == null) return;
app.CurrentStore = store;
string host = requestedUrl.Authority;
string relativeRoot = "http://" + host;
bool secure = false;
if (requestedUrl.ToString().ToLowerInvariant().StartsWith("https://")) secure = true;
string destination = app.StoreUrl(secure, false);
string pathAndQuery = requestedUrl.PathAndQuery;
// Trim starting slash because root URL already has this
pathAndQuery = pathAndQuery.TrimStart('/');
destination = System.IO.Path.Combine(destination, pathAndQuery);
// 301 redirect to main url
if (System.Web.HttpContext.Current != null)
{
System.Web.HttpContext.Current.Response.RedirectPermanent(destination);
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:25,代码来源:UrlHelper.cs
示例4: ParseStoreFromUrl
// Primary Method to Detect Store from Uri
public static Accounts.Store ParseStoreFromUrl(System.Uri url, MerchantTribeApplication app)
{
var profiler = MvcMiniProfiler.MiniProfiler.Current;
using (profiler.Step("UrlHelper.ParseStoreFromUrl"))
{
// Individual Mode
if (WebAppSettings.IsIndividualMode)
{
return app.AccountServices.FindOrCreateIndividualStore();
}
// Multi Mode
Accounts.Store result = null;
long storeid;
using (profiler.Step("Parse Id"))
{
storeid = ParseStoreId(url, app);
}
using (profiler.Step("Load Store"))
{
if (storeid > 0)
{
result = app.AccountServices.Stores.FindById(storeid);
}
}
return result;
}
}
开发者ID:NightOwl888,项目名称:MerchantTribe,代码行数:30,代码来源:UrlHelper.cs
示例5: IsUrlInUse
public static bool IsUrlInUse(string requestedUrl, string thisCustomUrlBvin, RequestContext context, MerchantTribeApplication app)
{
bool result = false;
string working = requestedUrl.ToLowerInvariant();
// Check for Generic Page Use in a Flex Page
if (IsCategorySlugInUse(working, thisCustomUrlBvin, context)) return true;
// Check for Products
if (IsProductSlugInUse(working, thisCustomUrlBvin, app)) return true;
// Check Custom Urls
Content.CustomUrl url = app.ContentServices.CustomUrls.FindByRequestedUrl(requestedUrl);
if (url != null)
{
if (url.Bvin != string.Empty)
{
if (url.Bvin != thisCustomUrlBvin)
{
return true;
}
}
}
return result;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:25,代码来源:UrlRewriter.cs
示例6: CategoryIconUrl
public static string CategoryIconUrl(MerchantTribeApplication app, string categoryId, string imageName, bool isSecure)
{
string u = BaseUrlForSingleStore(app, isSecure);
u += "categoryicons/" + categoryId.ToString() + "/small/";
u += imageName;
return u;
}
开发者ID:NightOwl888,项目名称:MerchantTribe,代码行数:7,代码来源:DiskStorage.cs
示例7: CategoryBannerOriginalUrl
public static string CategoryBannerOriginalUrl(MerchantTribeApplication app, string categoryId, string imageName, bool isSecure)
{
string u = BaseUrlForSingleStore(app, isSecure);
u += "categorybanners/" + categoryId.ToString() + "/";
u += imageName;
return u;
}
开发者ID:NightOwl888,项目名称:MerchantTribe,代码行数:7,代码来源:DiskStorage.cs
示例8: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
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>");
return sb.ToString();
}
开发者ID:tony722,项目名称:MerchantTribe,代码行数:60,代码来源:PageMenu.cs
示例9: Logo
public static string Logo(MerchantTribeApplication app, bool isSecureRequest)
{
string storeRootUrl = app.StoreUrl(isSecureRequest, false);
string storeName = app.CurrentStore.Settings.FriendlyName;
string logoImage = app.CurrentStore.Settings.LogoImageFullUrl(app, isSecureRequest);
string logoText = app.CurrentStore.Settings.LogoText;
StringBuilder sb = new StringBuilder();
sb.Append("<a href=\"" + storeRootUrl + "\" title=\"" + storeName + "\"");
if (app.CurrentStore.Settings.UseLogoImage)
{
sb.Append("><img src=\"" + logoImage + "\" alt=\"" + storeName + "\" />");
}
else
{
sb.Append(" class=\"logo\">");
sb.Append(System.Web.HttpUtility.HtmlEncode(logoText));
}
sb.Append("</a>");
return sb.ToString();
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:26,代码来源:HtmlRendering.cs
示例10: CollectPaymentAndShipPendingOrders
public static void CollectPaymentAndShipPendingOrders(MerchantTribeApplication app)
{
OrderSearchCriteria criteria = new OrderSearchCriteria();
criteria.IsPlaced = true;
criteria.StatusCode = OrderStatusCode.ReadyForPayment;
int pageSize = 1000;
int totalCount = 0;
List<OrderSnapshot> orders = app.OrderServices.Orders.FindByCriteriaPaged(criteria, 1, pageSize, ref totalCount);
if (orders != null)
{
foreach (OrderSnapshot os in orders)
{
Order o = app.OrderServices.Orders.FindForCurrentStore(os.bvin);
OrderPaymentManager payManager = new OrderPaymentManager(o, app);
payManager.CreditCardCompleteAllCreditCards();
payManager.PayPalExpressCompleteAllPayments();
if (o.PaymentStatus == OrderPaymentStatus.Paid ||
o.PaymentStatus == OrderPaymentStatus.Overpaid)
{
if (o.ShippingStatus == OrderShippingStatus.FullyShipped)
{
o.StatusCode = OrderStatusCode.Completed;
o.StatusName = "Completed";
}
else
{
o.StatusCode = OrderStatusCode.ReadyForShipping;
o.StatusName = "Ready for Shipping";
}
app.OrderServices.Orders.Update(o);
}
}
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:35,代码来源:OrderBatchProcessor.cs
示例11: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
string fileUrl = string.Empty;
bool secure = app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection;
ThemeManager 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\" />";
return result;
}
开发者ID:KimRossey,项目名称:MerchantTribe,代码行数:27,代码来源:Css.cs
示例12: ReplaceContentTags
public static string ReplaceContentTags(string source, MerchantTribeApplication app, string itemCount, bool isSecureRequest)
{
Accounts.Store currentStore = app.CurrentStore;
string currentUserId = SessionManager.GetCurrentUserId(app.CurrentStore);
string output = source;
RouteCollection r = System.Web.Routing.RouteTable.Routes;
//VirtualPathData homeLink = r.GetVirtualPath(requestContext.RoutingContext, "homepage", new RouteValueDictionary());
output = output.Replace("{{homelink}}", app.StoreUrl(isSecureRequest, false));
output = output.Replace("{{logo}}", HtmlRendering.Logo(app, isSecureRequest));
output = output.Replace("{{logotext}}", HtmlRendering.LogoText(app));
output = output.Replace("{{headermenu}}", HtmlRendering.HeaderMenu(app.CurrentRequestContext.RoutingContext, app.CurrentRequestContext));
output = output.Replace("{{cartlink}}", HtmlRendering.CartLink(app, itemCount));
output = output.Replace("{{copyright}}", "<span class=\"copyright\">Copyright ©" + DateTime.Now.Year.ToString() + "</span>");
output = output.Replace("{{headerlinks}}", HtmlRendering.HeaderLinks(app, currentUserId));
output = output.Replace("{{searchform}}", HtmlRendering.SearchForm(app));
output = output.Replace("{{assets}}", MerchantTribe.Commerce.Storage.DiskStorage.BaseUrlForStoreTheme(app, currentStore.Settings.ThemeId, isSecureRequest) + "assets/");
output = output.Replace("{{img}}", MerchantTribe.Commerce.Storage.DiskStorage.StoreAssetUrl(app, string.Empty, isSecureRequest));
output = output.Replace("{{storeassets}}", MerchantTribe.Commerce.Storage.DiskStorage.StoreAssetUrl(app, string.Empty, isSecureRequest));
output = output.Replace("{{sitefiles}}", MerchantTribe.Commerce.Storage.DiskStorage.BaseUrlForSingleStore(app, isSecureRequest));
output = output.Replace("{{storeaddress}}", app.ContactServices.Addresses.FindStoreContactAddress().ToHtmlString());
return output;
}
开发者ID:tony722,项目名称:MerchantTribe,代码行数:27,代码来源:TagReplacer.cs
示例13: GetReplaceableTags
public List<Content.HtmlTemplateTag> GetReplaceableTags(MerchantTribeApplication app)
{
List<Content.HtmlTemplateTag> result = new List<Content.HtmlTemplateTag>();
result.Add(new Content.HtmlTemplateTag("[[VendorManufacturer.EmailAddress]]", this.EmailAddress));
result.Add(new Content.HtmlTemplateTag("[[VendorManufacturer.Name]]", this.DisplayName));
return result;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:7,代码来源:VendorManufacturer.cs
示例14: LoadInstalledTheme
public void LoadInstalledTheme(MerchantTribeApplication app, string themeId)
{
long storeId = app.CurrentStore.Id;
string themePhysicalRoot = Storage.DiskStorage.BaseStoreThemePhysicalPath(storeId, themeId);
if (!Directory.Exists(themePhysicalRoot))
{
return;
}
_Info = new ThemeInfo();
if (File.Exists(Path.Combine(themePhysicalRoot,"bvtheme.xml")) )
{
_Info.LoadFromString(File.ReadAllText(Path.Combine(themePhysicalRoot,"bvtheme.xml")));
}
if (File.Exists(Path.Combine(themePhysicalRoot,".customized")))
{
_IsCustomized = true;
}
else
{
_IsCustomized = false;
}
if (File.Exists(Path.Combine(themePhysicalRoot,"preview.png")))
{
_PreviewImageUrl = Storage.DiskStorage.BaseUrlForStoreTheme(app, themeId, true) + "preview.png";
}
else
{
_PreviewImageUrl = string.Empty;
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:34,代码来源:ThemeView.cs
示例15: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
StringBuilder sb = new StringBuilder();
bool isSecureRequest = app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection;
bool textOnly = false;
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;
sb.Append("<a href=\"" + storeRootUrl + "\" title=\"" + storeName + "\"");
if (contents.Trim().Length > 0)
{
sb.Append(">");
sb.Append(contents);
}
else if (app.CurrentStore.Settings.UseLogoImage && textOnly == false)
{
sb.Append("><img src=\"" + logoImage + "\" alt=\"" + storeName + "\" />");
}
else
{
sb.Append(" class=\"logo\">");
sb.Append(System.Web.HttpUtility.HtmlEncode(logoText));
}
sb.Append("</a>");
return sb.ToString();
}
开发者ID:KimRossey,项目名称:MerchantTribe,代码行数:34,代码来源:Logo.cs
示例16: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
string result = string.Empty;
Orders.Order o = new Orders.Order();
if (app.CurrentRequestContext.CurrentReceiptOrder != null)
{
o = app.CurrentRequestContext.CurrentReceiptOrder;
// Adwords Tracker at bottom if needed
if (app.CurrentStore.Settings.Analytics.UseGoogleAdWords)
{
result = MerchantTribe.Commerce.Metrics.GoogleAnalytics.RenderGoogleAdwordTracker(
o.TotalGrand,
app.CurrentStore.Settings.Analytics.GoogleAdWordsId,
app.CurrentStore.Settings.Analytics.GoogleAdWordsLabel,
app.CurrentStore.Settings.Analytics.GoogleAdWordsBgColor,
app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection);
}
// Add Yahoo Tracker to Bottom if Needed
if (app.CurrentStore.Settings.Analytics.UseYahooTracker)
{
result += MerchantTribe.Commerce.Metrics.YahooAnalytics.RenderYahooTracker(
o, app.CurrentStore.Settings.Analytics.YahooAccountId);
}
}
return result;
}
开发者ID:KimRossey,项目名称:MerchantTribe,代码行数:30,代码来源:AnalyticsBottom.cs
示例17: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
string areaName = tag.GetSafeAttribute("name");
string result = contents;
// Get area data from the category if it exists, otherwise use the default area content
if (app.CurrentRequestContext.CurrentCategory != null)
{
CategoryPageVersion v = app.CurrentRequestContext.CurrentCategory.GetCurrentVersion();
if (v != null)
{
string fromCat = v.Areas.GetAreaContent(areaName);
if (fromCat.Trim().Length > 0)
{
result = fromCat;
}
}
}
// do replacements for legacy tags here
result = MerchantTribe.Commerce.Utilities.TagReplacer.ReplaceContentTags(result,
app,
"",
app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection);
return result;
}
开发者ID:tony722,项目名称:MerchantTribe,代码行数:27,代码来源:Area.cs
示例18: CartLink
public static string CartLink(MerchantTribeApplication app, string itemCount)
{
string storeRootUrl = app.StoreUrl(false, true);
StringBuilder sb = new StringBuilder();
sb.Append("<a href=\"" + storeRootUrl + "cart/\"><span>View Cart: ");
sb.Append(itemCount);
sb.Append(" items</span></a>");
return sb.ToString();
}
开发者ID:tony722,项目名称:MerchantTribe,代码行数:9,代码来源:HtmlRendering.cs
示例19: HeaderLinks
public static string HeaderLinks(MerchantTribeApplication app, string currentUserId)
{
StringBuilder sb = new StringBuilder();
string rootUrl = app.StoreUrl(false, true);
string rootUrlSecure = app.StoreUrl(true, false);
sb.Append("<ul>");
sb.Append("<li><a class=\"myaccountlink\" href=\"" + rootUrlSecure + "account\"><span>");
sb.Append("My Account");
sb.Append("</span></a></li>");
sb.Append("<li><a class=\"signinlink\"");
if (currentUserId == string.Empty)
{
sb.Append(" href=\"" + rootUrlSecure + "SignIn\"><span>");
sb.Append("Sign In");
}
else
{
string name = string.Empty;
MerchantTribe.Commerce.Membership.CustomerAccount a = app.MembershipServices.Customers.Find(currentUserId);
if (a != null)
{
name = a.Email;
}
sb.Append(" href=\"" + rootUrlSecure + "SignOut\" title=\"" + System.Web.HttpUtility.HtmlEncode(name) + "\"><span>");
sb.Append("Sign Out");
}
sb.Append("</span></a></li>");
//sb.Append("<li><a class=\"orderstatuslink\" href=\"" + rootUrlSecure + "OrderStatus\"><span>");
//sb.Append("Order Status");
//sb.Append("</span></a></li>");
//sb.Append("<li><a class=\"emailsignuplink\" href=\"" + rootUrl + "EmailSignUp\"><span>");
//sb.Append("Email Sign Up");
//sb.Append("</span></a></li>");
//sb.Append("<li><a class=\"giftcardslink\" href=\"" + rootUrl + "GiftCards\"><span>");
//sb.Append("Gift Cards");
//sb.Append("</span></a></li>");
//sb.Append("<li><a class=\"contactlink\" href=\"" + rootUrl + "Contact\"><span>");
//sb.Append("Contact Us");
//sb.Append("</span></a></li>");
sb.Append("<li><a class=\"contactlink\" href=\"" + rootUrl + "Checkout\"><span>");
sb.Append("Checkout");
sb.Append("</span></a></li>");
sb.Append("</ul>");
return sb.ToString();
}
开发者ID:tony722,项目名称:MerchantTribe,代码行数:57,代码来源:HtmlRendering.cs
示例20: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
StringBuilder sb = new StringBuilder();
bool secure = app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection;
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)
{
sb.Append("<script src='https://ajax.microsoft.com/ajax/jQuery/jquery-1.5.1.min.js' type=\"text/javascript\"></script>");
}
else
{
sb.Append("<script src='http://ajax.microsoft.com/ajax/jQuery/jquery-1.5.1.min.js' type=\"text/javascript\"></script>");
}
}
else
{
// Local JQuery
sb.Append("<script src='" + baseScriptFolder + "jquery-1.5.1.min.js' type=\"text/javascript\"></script>");
}
sb.Append(System.Environment.NewLine);
sb.Append("<script src='" + baseScriptFolder + "jquery-ui-1.8.7.custom/js/jquery-ui-1.8.7.custom.min.js' type=\"text/javascript\"></script>");
sb.Append("<script src='" + baseScriptFolder + "jquery.form.js' type=\"text/javascript\"></script>");
sb.Append(System.Environment.NewLine);
}
else
{
string src = tag.GetSafeAttribute("src");
string fileName = tag.GetSafeAttribute("file");
if (fileName.Trim().Length > 0)
{
ThemeManager tm = app.ThemeManager();
src = tm.ThemeFileUrl(fileName, app);
}
sb.Append("<script src=\"" + src + "\" type=\"text/javascript\"></script>");
}
return sb.ToString();
}
开发者ID:tony722,项目名称:MerchantTribe,代码行数:57,代码来源:JavaScript.cs
注:本文中的MerchantTribeApplication类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论