public AjaxResult CreateResource(ResourceModel resource)
        {
            if (ModelState.IsValid)
            {
                _resourceManagementService.CreateResource(resource);
                return(new AjaxResult(AjaxResultState.OK));
            }

            return(new AjaxResult(AjaxResultState.Error));
        }
Ejemplo n.º 2
0
        public IActionResult CreateResource(ResourceManagementModel resource)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    _resourceManagementService.CreateResource(resource);
                }

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(RedirectToAction(nameof(CreateResource)));
            }
        }