Пример #1
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            if (!UserIsTenantAdminOfCampaign(id))
            {
                return(new HttpUnauthorizedResult());
            }

            await _dataAccess.DeleteCampaign(id);

            return(await Task.FromResult(RedirectToAction("Index", new { area = "Admin" })));
        }
Пример #2
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var currentUser = await _userManager.GetCurrentUser(Context);

            if (currentUser == null || !await UserIsTenantAdminOfCampaign(currentUser, id))
            {
                return(new HttpUnauthorizedResult());
            }

            await _dataAccess.DeleteCampaign(id);

            return(await Task.FromResult(RedirectToAction("Index", new { area = "Admin" })));
        }
Пример #3
0
 public void Delete(int id)
 {
     _dataAccess.DeleteCampaign(id);
 }