Skip to content

Commit fe1117b

Browse files
committed
_commonServices becomes _services
1 parent f8c5d8b commit fe1117b

19 files changed

Lines changed: 216 additions & 216 deletions

File tree

src/Libraries/SmartStore.Services/Catalog/PriceCalculationService.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public partial class PriceCalculationService : IPriceCalculationService
2626
private readonly CatalogSettings _catalogSettings;
2727
private readonly IProductAttributeService _productAttributeService;
2828
private readonly IDownloadService _downloadService;
29-
private readonly ICommonServices _commonServices;
29+
private readonly ICommonServices _services;
3030
private readonly HttpRequestBase _httpRequestBase;
3131
private readonly ITaxService _taxService;
3232

@@ -39,7 +39,7 @@ public PriceCalculationService(
3939
CatalogSettings catalogSettings,
4040
IProductAttributeService productAttributeService,
4141
IDownloadService downloadService,
42-
ICommonServices commonServices,
42+
ICommonServices services,
4343
HttpRequestBase httpRequestBase,
4444
ITaxService taxService)
4545
{
@@ -51,7 +51,7 @@ public PriceCalculationService(
5151
this._catalogSettings = catalogSettings;
5252
this._productAttributeService = productAttributeService;
5353
this._downloadService = downloadService;
54-
this._commonServices = commonServices;
54+
this._services = services;
5555
this._httpRequestBase = httpRequestBase;
5656
this._taxService = taxService;
5757
}
@@ -129,7 +129,7 @@ protected virtual IList<Discount> GetAllowedDiscounts(Product product, Customer
129129

130130
var tierPrices = product.TierPrices
131131
.OrderBy(tp => tp.Quantity)
132-
.FilterByStore(_commonServices.StoreContext.CurrentStore.Id)
132+
.FilterByStore(_services.StoreContext.CurrentStore.Id)
133133
.FilterForCustomer(customer)
134134
.ToList()
135135
.RemoveDuplicatedQuantities();
@@ -212,7 +212,7 @@ protected virtual decimal GetPreselectedPrice(Product product, ProductBundleItem
212212

213213
if (!isBundle && selectedAttributes.Count > 0)
214214
{
215-
string attributeXml = selectedAttributes.CreateSelectedAttributesXml(product.Id, attributes, _productAttributeParser, _commonServices.Localization,
215+
string attributeXml = selectedAttributes.CreateSelectedAttributesXml(product.Id, attributes, _productAttributeParser, _services.Localization,
216216
_downloadService, _catalogSettings, _httpRequestBase, new List<string>(), true, bundleItemId);
217217

218218
selectedAttributeValues = _productAttributeParser.ParseProductVariantAttributeValues(attributeXml).ToList();
@@ -242,7 +242,7 @@ protected virtual decimal GetPreselectedPrice(Product product, ProductBundleItem
242242
bundleItem.AdditionalCharge = attributesTotalPriceBase;
243243
}
244244

245-
var result = GetFinalPrice(product, bundleItems, _commonServices.WorkContext.CurrentCustomer, attributesTotalPriceBase, true, 1, bundleItem);
245+
var result = GetFinalPrice(product, bundleItems, _services.WorkContext.CurrentCustomer, attributesTotalPriceBase, true, 1, bundleItem);
246246
return result;
247247
}
248248

@@ -290,7 +290,7 @@ protected virtual decimal GetPreselectedPrice(Product product, ProductBundleItem
290290
public virtual decimal GetFinalPrice(Product product,
291291
bool includeDiscounts)
292292
{
293-
var customer = _commonServices.WorkContext.CurrentCustomer;
293+
var customer = _services.WorkContext.CurrentCustomer;
294294
return GetFinalPrice(product, customer, includeDiscounts);
295295
}
296296

@@ -456,7 +456,7 @@ public virtual decimal GetLowestPrice(Product product, out bool displayFromMessa
456456
}
457457
}
458458

459-
decimal lowestPrice = GetFinalPrice(product, bundleItems, _commonServices.WorkContext.CurrentCustomer, decimal.Zero, true, int.MaxValue);
459+
decimal lowestPrice = GetFinalPrice(product, bundleItems, _services.WorkContext.CurrentCustomer, decimal.Zero, true, int.MaxValue);
460460

461461
if (product.LowestAttributeCombinationPrice.HasValue && product.LowestAttributeCombinationPrice.Value < lowestPrice)
462462
{
@@ -502,7 +502,7 @@ public virtual decimal GetLowestPrice(Product product, out bool displayFromMessa
502502

503503
foreach (var associatedProduct in associatedProducts)
504504
{
505-
var tmpPrice = GetFinalPrice(associatedProduct, _commonServices.WorkContext.CurrentCustomer, decimal.Zero, true, int.MaxValue);
505+
var tmpPrice = GetFinalPrice(associatedProduct, _services.WorkContext.CurrentCustomer, decimal.Zero, true, int.MaxValue);
506506

507507
if (associatedProduct.LowestAttributeCombinationPrice.HasValue && associatedProduct.LowestAttributeCombinationPrice.Value < tmpPrice)
508508
{
@@ -583,7 +583,7 @@ public virtual decimal GetProductCost(Product product, string attributesXml)
583583
/// <returns>Discount amount</returns>
584584
public virtual decimal GetDiscountAmount(Product product)
585585
{
586-
var customer = _commonServices.WorkContext.CurrentCustomer;
586+
var customer = _services.WorkContext.CurrentCustomer;
587587
return GetDiscountAmount(product, customer, decimal.Zero);
588588
}
589589

src/Libraries/SmartStore.Services/ExportImport/ExportManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public partial class ExportManager : IExportManager
4343
private readonly INewsLetterSubscriptionService _newsLetterSubscriptionService;
4444
private readonly ILanguageService _languageService;
4545
private readonly MediaSettings _mediaSettings;
46-
private readonly ICommonServices _commonServices;
46+
private readonly ICommonServices _services;
4747
private readonly IStoreMappingService _storeMappingService;
4848

4949
#endregion
@@ -58,7 +58,7 @@ public ExportManager(ICategoryService categoryService,
5858
INewsLetterSubscriptionService newsLetterSubscriptionService,
5959
ILanguageService languageService,
6060
MediaSettings mediaSettings,
61-
ICommonServices commonServices,
61+
ICommonServices services,
6262
IStoreMappingService storeMappingService)
6363
{
6464
this._categoryService = categoryService;
@@ -69,7 +69,7 @@ public ExportManager(ICategoryService categoryService,
6969
this._newsLetterSubscriptionService = newsLetterSubscriptionService;
7070
this._languageService = languageService;
7171
this._mediaSettings = mediaSettings;
72-
this._commonServices = commonServices;
72+
this._services = services;
7373
this._storeMappingService = storeMappingService;
7474

7575
Logger = NullLogger.Instance;
@@ -728,7 +728,7 @@ public virtual void ExportProductsToXml(Stream stream, ProductSearchContext sear
728728
{
729729
ProductTemplates = _productTemplateService.GetAllProductTemplates(),
730730
Languages = _languageService.GetAllLanguages(true),
731-
Store = _commonServices.StoreContext.CurrentStore
731+
Store = _services.StoreContext.CurrentStore
732732
};
733733

734734
using (var writer = XmlWriter.Create(stream, settings))

src/Libraries/SmartStore.Services/Filter/FilterService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public partial class FilterService : IFilterService
2424
private readonly IRepository<Product> _productRepository;
2525
private readonly IRepository<ProductCategory> _productCategoryRepository;
2626
private readonly ILocalizedEntityService _localizedEntityService;
27-
private readonly ICommonServices _commonServices;
27+
private readonly ICommonServices _services;
2828

2929
private IQueryable<Product> _products;
3030

@@ -34,15 +34,15 @@ public FilterService(IProductService productService,
3434
IRepository<Product> productRepository,
3535
IRepository<ProductCategory> productCategoryRepository,
3636
ILocalizedEntityService localizedEntityService,
37-
ICommonServices commonServices)
37+
ICommonServices services)
3838
{
3939
_productService = productService;
4040
_categoryService = categoryService;
4141
_catalogSettings = catalogSettings;
4242
_productRepository = productRepository;
4343
_productCategoryRepository = productCategoryRepository;
4444
_localizedEntityService = localizedEntityService;
45-
_commonServices = commonServices;
45+
_services = services;
4646
}
4747

4848
public static string ShortcutPrice { get { return "_Price"; } }
@@ -166,7 +166,7 @@ private IQueryable<Product> AllProducts(List<int> categoryIds)
166166
var searchContext = new ProductSearchContext()
167167
{
168168
FeaturedProducts = (_catalogSettings.IncludeFeaturedProductsInNormalLists ? null : (bool?)false),
169-
StoreId = _commonServices.StoreContext.CurrentStoreIdIfMultiStoreMode,
169+
StoreId = _services.StoreContext.CurrentStoreIdIfMultiStoreMode,
170170
VisibleIndividuallyOnly = true
171171
};
172172

@@ -316,7 +316,7 @@ from a in attributes
316316

317317

318318
var lst = grouped.OrderByDescending(a => a.MatchCount).ToList();
319-
int languageId = _commonServices.WorkContext.WorkingLanguage.Id;
319+
int languageId = _services.WorkContext.WorkingLanguage.Id;
320320

321321
lst.ForEach(c =>
322322
{

src/Libraries/SmartStore.Services/Payments/PaymentService.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public partial class PaymentService : IPaymentService
3535
private readonly ShoppingCartSettings _shoppingCartSettings;
3636
private readonly IProviderManager _providerManager;
3737
private readonly ICurrencyService _currencyService;
38-
private readonly ICommonServices _commonServices;
38+
private readonly ICommonServices _services;
3939
private readonly IOrderTotalCalculationService _orderTotalCalculationService;
4040

4141
#endregion
@@ -56,7 +56,7 @@ public PaymentService(
5656
ShoppingCartSettings shoppingCartSettings,
5757
IProviderManager providerManager,
5858
ICurrencyService currencyService,
59-
ICommonServices commonServices,
59+
ICommonServices services,
6060
IOrderTotalCalculationService orderTotalCalculationService)
6161
{
6262
this._paymentMethodRepository = paymentMethodRepository;
@@ -65,7 +65,7 @@ public PaymentService(
6565
this._shoppingCartSettings = shoppingCartSettings;
6666
this._providerManager = providerManager;
6767
this._currencyService = currencyService;
68-
this._commonServices = commonServices;
68+
this._services = services;
6969
this._orderTotalCalculationService = orderTotalCalculationService;
7070
}
7171

@@ -171,7 +171,7 @@ public virtual IEnumerable<Provider<IPaymentMethod>> LoadActivePaymentMethods(
171171
_orderTotalCalculationService.GetShoppingCartSubTotal(cart, out orderSubTotalDiscountAmountBase, out orderSubTotalAppliedDiscount,
172172
out subTotalWithoutDiscountBase, out subTotalWithDiscountBase);
173173

174-
orderSubTotal = _currencyService.ConvertFromPrimaryStoreCurrency(subTotalWithoutDiscountBase, _commonServices.WorkContext.WorkingCurrency);
174+
orderSubTotal = _currencyService.ConvertFromPrimaryStoreCurrency(subTotalWithoutDiscountBase, _services.WorkContext.WorkingCurrency);
175175
}
176176

177177
compareAmount = orderSubTotal.Value;
@@ -182,7 +182,7 @@ public virtual IEnumerable<Provider<IPaymentMethod>> LoadActivePaymentMethods(
182182
{
183183
orderTotal = _orderTotalCalculationService.GetShoppingCartTotal(cart) ?? decimal.Zero;
184184

185-
orderTotal = _currencyService.ConvertFromPrimaryStoreCurrency(orderTotal.Value, _commonServices.WorkContext.WorkingCurrency);
185+
orderTotal = _currencyService.ConvertFromPrimaryStoreCurrency(orderTotal.Value, _services.WorkContext.WorkingCurrency);
186186
}
187187

188188
compareAmount = orderTotal.Value;
@@ -261,7 +261,7 @@ public virtual IEnumerable<Provider<IPaymentMethod>> LoadAllPaymentMethods(int s
261261
/// <returns>List of payment method objects</returns>
262262
public virtual IList<PaymentMethod> GetAllPaymentMethods()
263263
{
264-
var paymentMethods = _commonServices.Cache.Get(PAYMENTMETHOD_ALL_KEY, () =>
264+
var paymentMethods = _services.Cache.Get(PAYMENTMETHOD_ALL_KEY, () =>
265265
{
266266
var methods = _paymentMethodRepository.TableUntracked.ToList();
267267

@@ -298,9 +298,9 @@ public virtual void InsertPaymentMethod(PaymentMethod paymentMethod)
298298

299299
_paymentMethodRepository.Insert(paymentMethod);
300300

301-
_commonServices.Cache.RemoveByPattern(PAYMENTMETHOD_ALL_KEY);
301+
_services.Cache.RemoveByPattern(PAYMENTMETHOD_ALL_KEY);
302302

303-
_commonServices.EventPublisher.EntityInserted(paymentMethod);
303+
_services.EventPublisher.EntityInserted(paymentMethod);
304304
}
305305

306306
/// <summary>
@@ -314,9 +314,9 @@ public virtual void UpdatePaymentMethod(PaymentMethod paymentMethod)
314314

315315
_paymentMethodRepository.Update(paymentMethod);
316316

317-
_commonServices.Cache.RemoveByPattern(PAYMENTMETHOD_ALL_KEY);
317+
_services.Cache.RemoveByPattern(PAYMENTMETHOD_ALL_KEY);
318318

319-
_commonServices.EventPublisher.EntityUpdated(paymentMethod);
319+
_services.EventPublisher.EntityUpdated(paymentMethod);
320320
}
321321

322322
/// <summary>
@@ -330,9 +330,9 @@ public virtual void DeletePaymentMethod(PaymentMethod paymentMethod)
330330

331331
_paymentMethodRepository.Delete(paymentMethod);
332332

333-
_commonServices.Cache.RemoveByPattern(PAYMENTMETHOD_ALL_KEY);
333+
_services.Cache.RemoveByPattern(PAYMENTMETHOD_ALL_KEY);
334334

335-
_commonServices.EventPublisher.EntityDeleted(paymentMethod);
335+
_services.EventPublisher.EntityDeleted(paymentMethod);
336336
}
337337

338338

@@ -481,7 +481,7 @@ public virtual CapturePaymentResult Capture(CapturePaymentRequest capturePayment
481481
catch (NotSupportedException)
482482
{
483483
var result = new CapturePaymentResult();
484-
result.AddError(_commonServices.Localization.GetResource("Common.Payment.NoCaptureSupport"));
484+
result.AddError(_services.Localization.GetResource("Common.Payment.NoCaptureSupport"));
485485
return result;
486486
}
487487
catch
@@ -536,7 +536,7 @@ public virtual RefundPaymentResult Refund(RefundPaymentRequest refundPaymentRequ
536536
catch (NotSupportedException)
537537
{
538538
var result = new RefundPaymentResult();
539-
result.AddError(_commonServices.Localization.GetResource("Common.Payment.NoRefundSupport"));
539+
result.AddError(_services.Localization.GetResource("Common.Payment.NoRefundSupport"));
540540
return result;
541541
}
542542
catch
@@ -578,7 +578,7 @@ public virtual VoidPaymentResult Void(VoidPaymentRequest voidPaymentRequest)
578578
catch (NotSupportedException)
579579
{
580580
var result = new VoidPaymentResult();
581-
result.AddError(_commonServices.Localization.GetResource("Common.Payment.NoVoidSupport"));
581+
result.AddError(_services.Localization.GetResource("Common.Payment.NoVoidSupport"));
582582
return result;
583583
}
584584
catch
@@ -630,7 +630,7 @@ public virtual ProcessPaymentResult ProcessRecurringPayment(ProcessPaymentReques
630630
catch (NotSupportedException)
631631
{
632632
var result = new ProcessPaymentResult();
633-
result.AddError(_commonServices.Localization.GetResource("Common.Payment.NoRecurringPaymentSupport"));
633+
result.AddError(_services.Localization.GetResource("Common.Payment.NoRecurringPaymentSupport"));
634634
return result;
635635
}
636636
catch
@@ -661,7 +661,7 @@ public virtual CancelRecurringPaymentResult CancelRecurringPayment(CancelRecurri
661661
catch (NotSupportedException)
662662
{
663663
var result = new CancelRecurringPaymentResult();
664-
result.AddError(_commonServices.Localization.GetResource("Common.Payment.NoRecurringPaymentSupport"));
664+
result.AddError(_services.Localization.GetResource("Common.Payment.NoRecurringPaymentSupport"));
665665
return result;
666666
}
667667
catch

src/Plugins/SmartStore.FacebookAuth/Controllers/ExternalAuthFacebookController.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ public class ExternalAuthFacebookController : PluginControllerBase
1717
private readonly IOAuthProviderFacebookAuthorizer _oAuthProviderFacebookAuthorizer;
1818
private readonly IOpenAuthenticationService _openAuthenticationService;
1919
private readonly ExternalAuthenticationSettings _externalAuthenticationSettings;
20-
private readonly ICommonServices _commonServices;
20+
private readonly ICommonServices _services;
2121

2222
public ExternalAuthFacebookController(
2323
IOAuthProviderFacebookAuthorizer oAuthProviderFacebookAuthorizer,
2424
IOpenAuthenticationService openAuthenticationService,
2525
ExternalAuthenticationSettings externalAuthenticationSettings,
26-
ICommonServices commonServices)
26+
ICommonServices services)
2727
{
2828
this._oAuthProviderFacebookAuthorizer = oAuthProviderFacebookAuthorizer;
2929
this._openAuthenticationService = openAuthenticationService;
3030
this._externalAuthenticationSettings = externalAuthenticationSettings;
31-
this._commonServices = commonServices;
31+
this._services = services;
3232
}
3333

3434
private bool HasPermission(bool notify = true)
3535
{
36-
bool hasPermission = _commonServices.Permissions.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods);
36+
bool hasPermission = _services.Permissions.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods);
3737

3838
if (notify && !hasPermission)
39-
NotifyError(_commonServices.Localization.GetResource("Admin.AccessDenied.Description"));
39+
NotifyError(_services.Localization.GetResource("Admin.AccessDenied.Description"));
4040

4141
return hasPermission;
4242
}
@@ -48,14 +48,14 @@ public ActionResult Configure()
4848
return AccessDeniedPartialView();
4949

5050
var model = new ConfigurationModel();
51-
int storeScope = this.GetActiveStoreScopeConfiguration(_commonServices.StoreService, _commonServices.WorkContext);
52-
var settings = _commonServices.Settings.LoadSetting<FacebookExternalAuthSettings>(storeScope);
51+
int storeScope = this.GetActiveStoreScopeConfiguration(_services.StoreService, _services.WorkContext);
52+
var settings = _services.Settings.LoadSetting<FacebookExternalAuthSettings>(storeScope);
5353

5454
model.ClientKeyIdentifier = settings.ClientKeyIdentifier;
5555
model.ClientSecret = settings.ClientSecret;
5656

5757
var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData);
58-
storeDependingSettingHelper.GetOverrideKeys(settings, model, storeScope, _commonServices.Settings);
58+
storeDependingSettingHelper.GetOverrideKeys(settings, model, storeScope, _services.Settings);
5959

6060
return View(model);
6161
}
@@ -70,16 +70,16 @@ public ActionResult Configure(ConfigurationModel model, FormCollection form)
7070
return Configure();
7171

7272
var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData);
73-
int storeScope = this.GetActiveStoreScopeConfiguration(_commonServices.StoreService, _commonServices.WorkContext);
74-
var settings = _commonServices.Settings.LoadSetting<FacebookExternalAuthSettings>(storeScope);
73+
int storeScope = this.GetActiveStoreScopeConfiguration(_services.StoreService, _services.WorkContext);
74+
var settings = _services.Settings.LoadSetting<FacebookExternalAuthSettings>(storeScope);
7575

7676
settings.ClientKeyIdentifier = model.ClientKeyIdentifier;
7777
settings.ClientSecret = model.ClientSecret;
7878

79-
storeDependingSettingHelper.UpdateSettings(settings, form, storeScope, _commonServices.Settings);
80-
_commonServices.Settings.ClearCache();
79+
storeDependingSettingHelper.UpdateSettings(settings, form, storeScope, _services.Settings);
80+
_services.Settings.ClearCache();
8181

82-
NotifySuccess(_commonServices.Localization.GetResource("Admin.Common.DataSuccessfullySaved"));
82+
NotifySuccess(_services.Localization.GetResource("Admin.Common.DataSuccessfullySaved"));
8383

8484
return Configure();
8585
}
@@ -93,7 +93,7 @@ public ActionResult PublicInfo()
9393
[NonAction]
9494
private ActionResult LoginInternal(string returnUrl, bool verifyResponse)
9595
{
96-
var processor = _openAuthenticationService.LoadExternalAuthenticationMethodBySystemName(Provider.SystemName, _commonServices.StoreContext.CurrentStore.Id);
96+
var processor = _openAuthenticationService.LoadExternalAuthenticationMethodBySystemName(Provider.SystemName, _services.StoreContext.CurrentStore.Id);
9797
if (processor == null || !processor.IsMethodActive(_externalAuthenticationSettings))
9898
{
9999
throw new SmartException("Facebook module cannot be loaded");

0 commit comments

Comments
 (0)