コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            if (!coursesRepository.IsTeacherInCourse(id, User.Identity.GetUserId(), User.IsInRole("Administrator")) && !User.IsInRole("Administrator"))
            {
                throw new HttpException((int)HttpStatusCode.Forbidden, "Forbidden!");
            }

            projectTasksRepository.RemoveProjectTask(projectTasksRepository.GetProjectTaskById(id));
            return(RedirectToAction("Index"));
        }