Example #1
0
        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"));
        }
Example #2
0
        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));
        }
Example #3
0
 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 }
         });
 }
Example #5
0
        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;
            }
        }
Example #6
0
        public string DeleteChannel([FromBody] JsonElement json)
        {
            var request = ToObject <RequestDeleteChannel>(json);

            return(PrepareResponse(_channelService.DeleteChannel(request)));
        }
Example #7
0
 public async Task DeleteChannel(int id)
 {
     await _channelService.DeleteChannel(id);
 }