Exemplo n.º 1
0
        public ActionResult Delete(Project project)
        {
            // Make sure the user is logged in and that they have permission
            if (!IsUserLoggedIn)
            {
                return(RedirectToLogin());
            }
            if (!UserHasPermission(PermissionName.Project))
            {
                return(RedirectToPermissionDenied());
            }

            // Delete the project from the database
            try
            {
                ProjectProcessor.DeleteProject(project.ProjectId);
                TempData[LabelSuccess] = "Deleted project: " + project.Name;
                return(RedirectToIndex());
            }
            catch (Exception e)
            {
                return(RedirectToIndex(e));
            }
        }