本文整理汇总了C#中IMerchelloContext类的典型用法代码示例。如果您正苦于以下问题:C# IMerchelloContext类的具体用法?C# IMerchelloContext怎么用?C# IMerchelloContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IMerchelloContext类属于命名空间,在下文中一共展示了IMerchelloContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckoutRenderControllerBase
/// <summary>
/// Initializes a new instance of the <see cref="CheckoutRenderControllerBase"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
protected CheckoutRenderControllerBase(IMerchelloContext merchelloContext)
{
Mandate.ParameterNotNull(merchelloContext, "merchelloContext");
_storeSettingService = merchelloContext.Services.StoreSettingService;
_gatewayContext = merchelloContext.Gateways;
this.Initialize();
}
示例2: OrderApiController
/// <summary>
/// Initializes a new instance of the <see cref="OrderApiController"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
/// <param name="umbracoContext">
/// The umbraco context.
/// </param>
internal OrderApiController(IMerchelloContext merchelloContext, UmbracoContext umbracoContext)
: base(merchelloContext, umbracoContext)
{
_orderService = merchelloContext.Services.OrderService;
_invoiceService = merchelloContext.Services.InvoiceService;
_merchello = new MerchelloHelper(merchelloContext.Services);
}
示例3: ExportOrdersReportApiController
/// <summary>
/// Initializes a new instance of the <see cref="ExportOrdersReportApiController"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
public ExportOrdersReportApiController(IMerchelloContext merchelloContext)
: base(merchelloContext)
{
_invoiceService = merchelloContext.Services.InvoiceService;
_merchello = new MerchelloHelper(merchelloContext.Services);
}
示例4: NoteApiController
/// <summary>
/// Initializes a new instance of the <see cref="NoteApiController"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
public NoteApiController(IMerchelloContext merchelloContext)
: base(merchelloContext)
{
Mandate.ParameterNotNull(merchelloContext, "merchelloContext");
_noteService = merchelloContext.Services.NoteService;
_merchelloHelper = new MerchelloHelper(merchelloContext.Services);
}
示例5: ShippingGatewayApiController
/// <summary>
/// Initializes a new instance of the <see cref="ShippingGatewayApiController"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
public ShippingGatewayApiController(IMerchelloContext merchelloContext)
: base(merchelloContext)
{
_shippingContext = MerchelloContext.Gateways.Shipping;
_shipCountryService = ((ServiceContext)MerchelloContext.Services).ShipCountryService;
}
示例6: RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask
/// <summary>
/// Initializes a new instance of the <see cref="RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
/// <param name="order">
/// The order.
/// </param>
/// <param name="keysToShip">
/// The keys to ship.
/// </param>
public RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask(IMerchelloContext merchelloContext, IOrder order, IEnumerable<Guid> keysToShip)
: base(merchelloContext, order, keysToShip)
{
_productVariantService = MerchelloContext.Services.ProductVariantService;
_shipmentService = MerchelloContext.Services.ShipmentService;
_orderService = MerchelloContext.Services.OrderService;
}
开发者ID:drpeck,项目名称:Merchello,代码行数:19,代码来源:RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask.cs
示例7: BraintreePaymentMethodApiService
/// <summary>
/// Initializes a new instance of the <see cref="BraintreePaymentMethodApiService"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
/// <param name="settings">
/// The settings.
/// </param>
/// <param name="customerApiService">
/// The customer api provider.
/// </param>
internal BraintreePaymentMethodApiService(IMerchelloContext merchelloContext, BraintreeProviderSettings settings, IBraintreeCustomerApiService customerApiService)
: base(merchelloContext, settings)
{
Mandate.ParameterNotNull(customerApiService, "customerApiProvider");
_braintreeCustomerApiService = customerApiService;
}
示例8: ProductFilterGroupQuery
/// <summary>
/// Initializes a new instance of the <see cref="ProductFilterGroupQuery"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello Context.
/// </param>
/// <param name="resolver">
/// The resolver.
/// </param>
internal ProductFilterGroupQuery(IMerchelloContext merchelloContext, EntityCollectionProviderResolver resolver)
: base(merchelloContext.Services.EntityCollectionService, merchelloContext.Cache.RequestCache)
{
Ensure.ParameterNotNull(merchelloContext, "merchelloContext");
Ensure.ParameterNotNull(resolver, "resolver");
this.Initialize(merchelloContext, resolver);
}
示例9: Text
/// <summary>
/// The text.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
/// <param name="area">
/// The area.
/// </param>
/// <param name="key">
/// The key.
/// </param>
/// <returns>
/// The <see cref="string"/>.
/// </returns>
internal static string Text(IMerchelloContext merchelloContext, string area, string key)
{
Mandate.ParameterNotNull(merchelloContext, "MerchelloContext");
if (string.IsNullOrEmpty(area) || string.IsNullOrEmpty(key)) return string.Empty;
var lang = "en";
try
{
lang = MerchelloConfiguration.Current.Section.LogLocalization;
}
catch (Exception)
{
lang = "en";
}
var cacheKey = CacheKeys.GetLocalizationCacheKey(lang);
var xdoc = XDocument.Parse((string)merchelloContext.Cache.RuntimeCache.GetCacheItem(cacheKey, () => ui.getLanguageFile(lang).InnerXml), LoadOptions.None);
var xArea = xdoc.Descendants("area").FirstOrDefault(x => x.Attribute("alias").Value == area);
if (xArea == null) return string.Empty;
var xKey = xArea.Descendants("key").FirstOrDefault(x => x.Attribute("alias").Value == key);
return xKey == null ? string.Empty : xKey.Value;
}
示例10: UnfulfilledItems
/// <summary>
/// Gets a collection of unfulfilled (unshipped) line items
/// </summary>
/// <param name="order">The <see cref="IOrder"/></param>
/// <param name="merchelloContext">The <see cref="IMerchelloContext"/></param>
/// <param name="items">A collection of <see cref="IOrderLineItem"/></param>
/// <returns>The collection of <see cref="IOrderLineItem"/></returns>
public static IEnumerable<IOrderLineItem> UnfulfilledItems(this IOrder order, IMerchelloContext merchelloContext, IEnumerable<IOrderLineItem> items)
{
if (Constants.DefaultKeys.OrderStatus.Fulfilled == order.OrderStatus.Key) return new List<IOrderLineItem>();
var shippableItems = items.Where(x => x.IsShippable() && x.ShipmentKey == null).ToArray();
var inventoryItems = shippableItems.Where(x => x.ExtendedData.GetTrackInventoryValue()).ToArray();
// get the variants to check the inventory
var variants = merchelloContext.Services.ProductVariantService.GetByKeys(inventoryItems.Select(x => x.ExtendedData.GetProductVariantKey())).ToArray();
foreach (var item in inventoryItems)
{
var variant = variants.FirstOrDefault(x => x.Key == item.ExtendedData.GetProductVariantKey());
if (variant == null) continue;
// TODO refactor back ordering.
//// check inventory
//var inventory = variant.CatalogInventories.FirstOrDefault(x => x.CatalogKey == item.ExtendedData.GetWarehouseCatalogKey());
//if (inventory != null)
// item.BackOrder = inventory.Count < item.Quantity;
}
return shippableItems;
}
示例11: AuditLogApiController
/// <summary>
/// Initializes a new instance of the <see cref="AuditLogApiController"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
public AuditLogApiController(IMerchelloContext merchelloContext)
: base(merchelloContext)
{
Mandate.ParameterNotNull(merchelloContext, "merchelloContext");
_auditLogService = merchelloContext.Services.AuditLogService;
_merchelloHelper = new MerchelloHelper(merchelloContext.Services);
}
示例12: ProductDataService
public ProductDataService(IMerchelloContext merchelloContext)
{
//TODO Figure out how to get MerchelloContext instantiated before ExamineManager
// attempts to interact with the index
//Mandate.ParameterNotNull(merchelloContext, "MerchelloContext");
_merchelloContext = merchelloContext;
}
示例13: Currency
/// <summary>
/// The currency.
/// </summary>
/// <param name="invoice">
/// The invoice.
/// </param>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
/// <returns>
/// The <see cref="ICurrency"/>.
/// </returns>
internal static ICurrency Currency(this IInvoice invoice, IMerchelloContext merchelloContext)
{
var currencyCode = invoice.CurrencyCode();
return !string.IsNullOrEmpty(currencyCode)
? merchelloContext.Services.StoreSettingService.GetCurrencyByCode(currencyCode)
: null;
}
示例14: ProductOptionApiController
/// <summary>
/// Initializes a new instance of the <see cref="ProductOptionApiController"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
/// <param name="contentTypeService">
/// Umbraco's <see cref="IContentTypeService"/>
/// </param>
public ProductOptionApiController(IMerchelloContext merchelloContext, IContentTypeService contentTypeService)
: base(merchelloContext)
{
Mandate.ParameterNotNull(contentTypeService, "contentTypeService");
_contentTypeService = contentTypeService;
_productOptionService = merchelloContext.Services.ProductOptionService;
}
示例15: InvoiceApiController
/// <summary>
/// Initializes a new instance of the <see cref="InvoiceApiController"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
public InvoiceApiController(IMerchelloContext merchelloContext)
: base(merchelloContext)
{
_storeSettingService = MerchelloContext.Services.StoreSettingService as StoreSettingService;
_invoiceService = merchelloContext.Services.InvoiceService;
_noteService = merchelloContext.Services.NoteService;
_merchello = new MerchelloHelper(merchelloContext, false);
}