Esempio n. 1
0
        public virtual IActionResult TopicTemplateDelete(int id)
        {
            //try to get a topic template with the specified id
            TopicTemplate template = _topicTemplateService.GetTopicTemplateById(id)
                                     ?? throw new ArgumentException("No template found with the specified id");

            _topicTemplateService.DeleteTopicTemplate(template);

            return(new NullJsonResult());
        }
Esempio n. 2
0
        public virtual IActionResult TopicTemplateDelete(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance))
            {
                return(AccessDeniedView());
            }

            //try to get a topic template with the specified id
            var template = _topicTemplateService.GetTopicTemplateById(id)
                           ?? throw new ArgumentException("No template found with the specified id");

            _topicTemplateService.DeleteTopicTemplate(template);

            return(new NullJsonResult());
        }
        public IActionResult TopicTemplateDelete(string id)
        {
            var template = _topicTemplateService.GetTopicTemplateById(id);

            if (template == null)
            {
                throw new ArgumentException("No template found with the specified id");
            }
            if (ModelState.IsValid)
            {
                _topicTemplateService.DeleteTopicTemplate(template);
                return(new NullJsonResult());
            }
            return(ErrorForKendoGridJson(ModelState));
        }
Esempio n. 4
0
        public IActionResult TopicTemplateDelete(string id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance))
            {
                return(AccessDeniedView());
            }

            var template = _topicTemplateService.GetTopicTemplateById(id);

            if (template == null)
            {
                throw new ArgumentException("No template found with the specified id");
            }

            _topicTemplateService.DeleteTopicTemplate(template);

            return(new NullJsonResult());
        }
Esempio n. 5
0
 /// <summary>
 /// Delete topic template
 /// </summary>
 /// <param name="topicTemplate">Topic template</param>
 public void DeleteTopicTemplate([FromBody] TopicTemplate topicTemplate)
 {
     _topicTemplateService.DeleteTopicTemplate(topicTemplate);
 }