public async Task TearDown() { await _affiliateService.DeleteAffiliateAsync(_activeAffiliate1); await _affiliateService.DeleteAffiliateAsync(_notActiveAffiliate); await _affiliateService.DeleteAffiliateAsync(_activeDeletedAffiliate); await _affiliateService.DeleteAffiliateAsync(_notActiveDeletedAffiliate); }
public virtual async Task <IActionResult> Delete(int id) { if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageAffiliates)) { return(AccessDeniedView()); } //try to get an affiliate with the specified id var affiliate = await _affiliateService.GetAffiliateByIdAsync(id); if (affiliate == null) { return(RedirectToAction("List")); } await _affiliateService.DeleteAffiliateAsync(affiliate); //activity log await _customerActivityService.InsertActivityAsync("DeleteAffiliate", string.Format(await _localizationService.GetResourceAsync("ActivityLog.DeleteAffiliate"), affiliate.Id), affiliate); _notificationService.SuccessNotification(await _localizationService.GetResourceAsync("Admin.Affiliates.Deleted")); return(RedirectToAction("List")); }