public ActionResult DeleteConfirmed(int id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageChannel)) { return(AccessDeniedView()); } var channel = _channelService.GetChannelById(id); if (channel == null) { //No channel found with the specified id return(RedirectToAction("List")); } _channelService.DeleteChannel(channel); NotifySuccess(_localizationService.GetResource("Admin.ContentManagement.Topics.Deleted")); return(RedirectToAction("List")); }
public async Task <IActionResult> Delete(int id) { if (!User.Identity.IsAuthenticated) { throw new AuthenticationException(); } var result = await _channelService.DeleteChannel(id); var response = new ApiResponse <bool>(result); return(Ok(response)); }
public static void DeleteChannel(string chnid) { try { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); channelservice.DeleteChannel(chnid).Wait(); } catch (Exception exception) { App.NavigateToBugReport(exception); } }
public IServiceResultWrap ArchiveEntity([FromBody] VmEntityBasic model) { return serviceManager.CallService( () => new ServiceLocalizedResultWrap(model) { Data = model.Id.HasValue ? channelService.DeleteChannel(model.Id) : null }, new Dictionary<Type, string>() { { typeof(string), EntityMessageArchived }, { typeof(LockException), MessageLockedChannel }, { typeof(RoleActionException), MessageDeleteChannelRole } }); }
private void FeedCategoryTree_DeleteItem(TreeComponent item) { switch (item.TreeComponentType) { case TreeComponentType.Category: var category = item.Item as Category; var deleteCategoryResult = MessageBox.Show( $"Are you sure you want to delete category {category.Title}?", "Delete category", MessageBoxButton.YesNo); if (deleteCategoryResult == MessageBoxResult.No) { return; } _categoryService.DeleteCategory(category.CategoryId); RemoveSubcomponentWithItem(_subscriptionsComponent, category); _feedComponent.NewFeedItemsCountManual = _feedService.GetNewFeedItemsCount(); break; case TreeComponentType.Channel: var channel = item.Item as Channel; var deleteChannelResult = MessageBox.Show( $"Are you sure you want to delete channel {channel.Title}?", "Delete channel", MessageBoxButton.YesNo); if (deleteChannelResult == MessageBoxResult.No) { return; } _channelService.DeleteChannel(channel.ChannelId); RemoveSubcomponentWithItem(_subscriptionsComponent, channel); _feedComponent.NewFeedItemsCountManual = _feedService.GetNewFeedItemsCount(); break; default: break; } }
public string DeleteChannel([FromBody] JsonElement json) { var request = ToObject <RequestDeleteChannel>(json); return(PrepareResponse(_channelService.DeleteChannel(request))); }
public async Task DeleteChannel(int id) { await _channelService.DeleteChannel(id); }