コード例 #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"));
        }
コード例 #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));
        }
コード例 #3
0
ファイル: Session.cs プロジェクト: uponatime2019/Quarrel
 public static void DeleteChannel(string chnid)
 {
     try
     {
         IChannelService channelservice = AuthenticatedRestFactory.GetChannelService();
         channelservice.DeleteChannel(chnid).Wait();
     }
     catch (Exception exception)
     {
         App.NavigateToBugReport(exception);
     }
 }
コード例 #4
0
 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 }
         });
 }
コード例 #5
0
ファイル: MainWindow.xaml.cs プロジェクト: z3ut/rss-reader
        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;
            }
        }
コード例 #6
0
        public string DeleteChannel([FromBody] JsonElement json)
        {
            var request = ToObject <RequestDeleteChannel>(json);

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