Exemplo n.º 1
0
        public virtual IActionResult ProductTemplateDelete(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance))
            {
                return(AccessDeniedView());
            }

            //try to get a product template with the specified id
            var template = _productTemplateService.GetProductTemplateById(id)
                           ?? throw new ArgumentException("No template found with the specified id");

            _productTemplateService.DeleteProductTemplate(template);

            return(new NullJsonResult());
        }
        public IActionResult ProductTemplateDelete(string id)
        {
            var template = _productTemplateService.GetProductTemplateById(id);

            if (template == null)
            {
                throw new ArgumentException("No template found with the specified id");
            }
            if (ModelState.IsValid)
            {
                _productTemplateService.DeleteProductTemplate(template);
                return(new NullJsonResult());
            }
            return(ErrorForKendoGridJson(ModelState));
        }
Exemplo n.º 3
0
        public IActionResult ProductTemplateDelete(string id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance))
            {
                return(AccessDeniedView());
            }

            var template = _productTemplateService.GetProductTemplateById(id);

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

            _productTemplateService.DeleteProductTemplate(template);

            return(new NullJsonResult());
        }