コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            var psMetadata = _scriptRepository.GetScriptById(id);

            if (_scriptIO.Delete(psMetadata.Name))
            {
                _scriptRepository.DeleteScript(id);
                _scriptRepository.Save();
            }

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            var psMetadata = _scriptRepository.GetScriptById(id);

            if (psMetadata.Category != null && !UserHasAccessToCategory(psMetadata.Category.Id))
            {
                return(RedirectToAction("Index"));
            }

            if (_scriptIO.Delete(psMetadata.Name))
            {
                _scriptRepository.DeleteScript(id);
                _scriptRepository.Save();
            }

            return(RedirectToAction("Index"));
        }