Пример #1
0
        public ActionResult Index()
        {
            HttpContext.Session.SetBoolean("IndexStudent", false);
            HttpContext.Session.SetBoolean("IndexUser", false);
            Lecturer lecturer = _lecturerctx.GetLecturer(User.Identity.Name.ToString().Substring(1, User.Identity.Name.ToString().Length - 1));
            int      courseId = HttpContext.Session.GetInt32(CID) ?? default(int);

            if (User.IsInRole("Admin"))
            {
                IEnumerable <ProposalViewModel> proposals = _proposalctx.Get(lecturer);
                HttpContext.Session.SetBoolean("IndexExternal", true);
                return(View("~/Views/_Admin/Proposal/Index.cshtml", proposals));
            }
            else
            {
                Debug.WriteLine(lecturer.lecturer_id);
                IEnumerable <ProposalViewModel> proposals = _proposalctx.GetForLecturer(lecturer);

                return(View("~/Views/_Lecturer/Proposal/Index.cshtml", proposals));
            }
        }