Пример #1
0
        public ActionResult Content(int id)
        {
            if (Session[UserType.LoggedInUser.ToString()] == null)
            {
                ViewData["LogInFirst"] = true;
                return(RedirectToAction("LogIn", "Authedication"));
            }

            ViewData["LogInFirst"] = false;

            if (TempData["Comment"] != null || TempData["Rating"] != null)
            {
                ViewBag.Comment = (bool)TempData["Comment"];
                ViewBag.Rating  = (bool)TempData["Rating"];
            }


            Course result = ElearnerDataLayoutActions.GetContent(id);

            var contentVM = new ContentViewModel
            {
                Course       = result,
                Content      = result.Content,
                Subscription = new Subscription()
            };

            return(View(contentVM));
        }