Пример #1
0
        public virtual IActionResult CustomerSubscriptionsPOST(IFormCollection formCollection)
        {
            foreach (var key in formCollection.Keys)
            {
                var value = formCollection[key];

                if (value.Equals("on") && key.StartsWith("biss", StringComparison.OrdinalIgnoreCase))
                {
                    var id           = key.Replace("biss", "").Trim();
                    var subscription = _backInStockSubscriptionService.GetSubscriptionById(id);
                    if (subscription != null && subscription.CustomerId == _workContext.CurrentCustomer.Id)
                    {
                        _backInStockSubscriptionService.DeleteSubscription(subscription);
                    }
                }
            }

            return(RedirectToRoute("CustomerBackInStockSubscriptions"));
        }