Exemple #1
0
        public virtual IActionResult ManufacturerTemplateDelete(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance))
            {
                return(AccessDeniedView());
            }

            //try to get a manufacturer template with the specified id
            var template = _manufacturerTemplateService.GetManufacturerTemplateById(id)
                           ?? throw new ArgumentException("No template found with the specified id");

            _manufacturerTemplateService.DeleteManufacturerTemplate(template);

            return(new NullJsonResult());
        }
        public IActionResult ManufacturerTemplateDelete(string id)
        {
            var template = _manufacturerTemplateService.GetManufacturerTemplateById(id);

            if (template == null)
            {
                throw new ArgumentException("No template found with the specified id");
            }
            if (ModelState.IsValid)
            {
                _manufacturerTemplateService.DeleteManufacturerTemplate(template);
                return(new NullJsonResult());
            }
            return(ErrorForKendoGridJson(ModelState));
        }
        public IActionResult ManufacturerTemplateDelete(string id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance))
            {
                return(AccessDeniedView());
            }

            var template = _manufacturerTemplateService.GetManufacturerTemplateById(id);

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

            _manufacturerTemplateService.DeleteManufacturerTemplate(template);

            return(new NullJsonResult());
        }