Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Remove unused method
KrzysztofPajak66b05f23f71c
diff --git a/src/Business/Grand.Business.Customers/Interfaces/ICustomerService.cs b/src/Business/Grand.Business.Customers/Interfaces/ICustomerService.csindex b2a21b994..2836afd90 100644--- a/src/Business/Grand.Business.Customers/Interfaces/ICustomerService.cs+++ b/src/Business/Grand.Business.Customers/Interfaces/ICustomerService.cs@@ -50,13 +50,7 @@ namespace Grand.Business.Customers.Interfacesbool loadOnlyWithShoppingCart = false, ShoppingCartType? sct = null,int pageIndex = 0, int pageSize = int.MaxValue, Expression<Func<Customer, object>> orderBySelector = null);- /// <summary>- /// Gets all customers by customer format (including deleted ones)- /// </summary>- /// <param name="passwordFormat">Password format</param>- /// <returns>Customers</returns>- Task<IList<Customer>> GetAllCustomersByPasswordFormat(PasswordFormat passwordFormat);-+/// <summary>/// Gets online customers/// </summary>@@ -224,7 +218,6 @@ namespace Grand.Business.Customers.InterfacesTask UpdateAddress(Address address, string customerId);Task UpdateBillingAddress(Address address, string customerId);Task UpdateShippingAddress(Address address, string customerId);- Task RemoveShippingAddress(string customerId);#endregiondiff --git a/src/Business/Grand.Business.Customers/Services/CustomerService.cs b/src/Business/Grand.Business.Customers/Services/CustomerService.csindex 59c99c294..9782a5f04 100644--- a/src/Business/Grand.Business.Customers/Services/CustomerService.cs+++ b/src/Business/Grand.Business.Customers/Services/CustomerService.cs@@ -46,8 +46,6 @@ namespace Grand.Business.Customers.Services#endregion- #region Methods-#region Customers/// <summary>@@ -108,22 +106,7 @@ namespace Grand.Business.Customers.Services};var query = await _mediator.Send(querymodel);return await PagedList<Customer>.Create(query, pageIndex, pageSize);- }-- /// <summary>- /// Gets all customers by customer format (including deleted ones)- /// </summary>- /// <param name="passwordFormat">Password format</param>- /// <returns>Customers</returns>- public virtual async Task<IList<Customer>> GetAllCustomersByPasswordFormat(PasswordFormat passwordFormat)- {- var query = from p in _customerRepository.Table- select p;-- query = query.Where(c => c.PasswordFormatId == passwordFormat);- query = query.OrderByDescending(c => c.CreatedOnUtc);- return await Task.FromResult(query.ToList());- }+ }/// <summary>/// Gets online customers@@ -683,11 +666,6 @@ namespace Grand.Business.Customers.Servicesawait _customerRepository.UpdateField(customerId, x => x.ShippingAddress, address);}- public virtual async Task RemoveShippingAddress(string customerId)- {- await _customerRepository.UpdateField(customerId, x => x.ShippingAddress, null);- }-#endregion#region Customer Shopping Cart Item@@ -745,9 +723,6 @@ namespace Grand.Business.Customers.Servicesawait UpdateCustomerField(customerId, x => x.LastUpdateWishListDateUtc, DateTime.UtcNow);}-- #endregion-#endregion}}\ No newline at end of filediff --git a/src/Web/Grand.Web/Controllers/CheckoutController.cs b/src/Web/Grand.Web/Controllers/CheckoutController.csindex abc997062..894c13d8f 100644--- a/src/Web/Grand.Web/Controllers/CheckoutController.cs+++ b/src/Web/Grand.Web/Controllers/CheckoutController.cs@@ -580,7 +580,8 @@ namespace Grand.Web.Controllers{//shipping is not required_workContext.CurrentCustomer.ShippingAddress = null;- await _customerService.RemoveShippingAddress(_workContext.CurrentCustomer.Id);+ await _customerService.UpdateCustomerField(_workContext.CurrentCustomer, x => x.ShippingAddress, null);+await _userFieldService.SaveField<ShippingOption>(_workContext.CurrentCustomer, SystemCustomerFieldNames.SelectedShippingOption, null, _workContext.CurrentStore.Id);//load next stepreturn await LoadStepAfterShippingMethod(cart);@@ -615,7 +616,7 @@ namespace Grand.Web.Controllers//customer decided to pick up in store//no shipping address selected_workContext.CurrentCustomer.ShippingAddress = null;- await _customerService.RemoveShippingAddress(_workContext.CurrentCustomer.Id);+ await _customerService.UpdateCustomerField(_workContext.CurrentCustomer, x => x.ShippingAddress, null);//clear shipping option XML/Descriptionawait _userFieldService.SaveField(_workContext.CurrentCustomer, SystemCustomerFieldNames.ShippingOptionAttribute, "", _workContext.CurrentStore.Id);