Esempio n. 1
0
        public ActionResult AddLevelInCourse(int id)//id e kursit
        {
            string uid = User.Identity.GetUserId();

            if (!courseService.CanUserModifyCourseLevelsAndTypes(uid, id))
            {
                this.AddNotification("Ju nuk mund te shtoni nivele ne kursin me id:" + id.ToString(), NotificationType.ERROR);
                return(RedirectToAction("CourseLevels", "Course", new { @id = id }));
            }
            var course = courseService.GetCourseById(id);

            if (course == null)
            {
                return(new HttpNotFoundResult());
            }
            var availableLevels = levelService.GetAvailableLevelsForCourse(id);

            ViewBag.CourseId        = id;
            ViewBag.AvaliableLevels = new SelectList(availableLevels, "Id", "Emri");
            ViewBag.Course          = course.Emri;
            TempData["Course"]      = course.Emri;
            return(View());
        }