Ejemplo n.º 1
0
        public ActionResult DeleteBrand(Brand brandToDelete, FormCollection form)
        {
            int substitutingBrandId;
            var substituteSelected = int.TryParse(form["SubstitutingBrandId"], out substitutingBrandId);

            _brandApplicationService.DeleteBrand(brandToDelete.Id, substituteSelected ? substitutingBrandId : (int?)null);
            return(RedirectToAction("BrandIndex"));
        }
        protected override void Before_each_spec()
        {
            var brands = _brandApplicationService.GetAllBrands();

            foreach (var brand in brands)
            {
                _brandApplicationService.DeleteBrand(brand.Id);
            }
            base.Before_each_spec();
        }