当前位置: 首页>>代码示例>>C#>>正文


C# IMerchelloContext类代码示例

本文整理汇总了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();
 }
开发者ID:ProNotion,项目名称:Merchello,代码行数:13,代码来源:CheckoutRenderControllerBase.cs

示例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);
 }
开发者ID:ProNotion,项目名称:Merchello,代码行数:16,代码来源:OrderApiController.cs

示例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);
        }
开发者ID:GaryLProthero,项目名称:Merchello,代码行数:13,代码来源:ExportOrdersReportApiController.cs

示例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);
 }
开发者ID:drpeck,项目名称:Merchello,代码行数:13,代码来源:NoteApiController.cs

示例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;
        }
开发者ID:arknu,项目名称:Merchello,代码行数:13,代码来源:ShippingGatewayApiController.cs

示例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;
        }
开发者ID:GaryLProthero,项目名称:Merchello,代码行数:19,代码来源:BraintreePaymentMethodApiService.cs

示例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);
 }
开发者ID:rustyswayne,项目名称:Merchello,代码行数:16,代码来源:ProductFilterGroupQuery.cs

示例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;
        }
开发者ID:arknu,项目名称:Merchello,代码行数:43,代码来源:Localize.cs

示例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;
        }
开发者ID:arknu,项目名称:Merchello,代码行数:33,代码来源:OrderExtensions.cs

示例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);
 }
开发者ID:ProNotion,项目名称:Merchello,代码行数:13,代码来源:AuditLogApiController.cs

示例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;
 }
开发者ID:arknu,项目名称:Merchello,代码行数:7,代码来源:ProductDataService.cs

示例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;
 }
开发者ID:drpeck,项目名称:Merchello,代码行数:19,代码来源:InvoiceExtensions.cs

示例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;
 }
开发者ID:jlarc,项目名称:Merchello,代码行数:16,代码来源:ProductOptionApiController.cs

示例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);
 }
开发者ID:jlarc,项目名称:Merchello,代码行数:14,代码来源:InvoiceApiController.cs


注:本文中的IMerchelloContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。