Esempio n. 1
0
        public ActionResult Index()
        {
            if (User.Identity.IsAuthenticated)
            {
                if (User.IsInRole("Teacher"))
                {
                    return RedirectToAction("Index", "Teacher");
                }
                if (User.IsInRole("Student"))
                {
                    return RedirectToAction("Index", "Student");
                }
                if (User.IsInRole("Parent"))
                {
                    return RedirectToAction("Index", "Parent");
                }
                if (User.IsInRole("Admin"))
                {
                    return RedirectToAction("Index", "Admin");
                }

                return RedirectToAction("NotApprovedYet", "Home");
            }

            var gradeLevelRepo = new SqlLMSGradeLevelRepository();
            var model = new LoginRegistrationVM();
            model.RegisterViewModel.CreateGradeLevel(gradeLevelRepo.GradeLevelGetAll());
            model.RegisterViewModel.PopulateSelectListItems(gradeLevelRepo.GradeLevelGetAll());//Added 6/28--Lis

            return View(model);
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            if (User.Identity.IsAuthenticated)
            {
                if (User.IsInRole("Teacher"))
                {
                    return(RedirectToAction("Index", "Teacher"));
                }
                if (User.IsInRole("Student"))
                {
                    return(RedirectToAction("Index", "Student"));
                }
                if (User.IsInRole("Parent"))
                {
                    return(RedirectToAction("Index", "Parent"));
                }
                if (User.IsInRole("Admin"))
                {
                    return(RedirectToAction("Index", "Admin"));
                }

                return(RedirectToAction("NotApprovedYet", "Home"));
            }

            var gradeLevelRepo = new SqlLMSGradeLevelRepository();
            var model          = new LoginRegistrationVM();

            model.RegisterViewModel.CreateGradeLevel(gradeLevelRepo.GradeLevelGetAll());
            model.RegisterViewModel.PopulateSelectListItems(gradeLevelRepo.GradeLevelGetAll());//Added 6/28--Lis

            return(View(model));
        }
Esempio n. 3
0
 public void CanLoadGradeLevels()
 {
     SqlLMSGradeLevelRepository repo = new SqlLMSGradeLevelRepository();
     var gradeLevels = repo.GradeLevelGetAll();
     
     Assert.AreNotEqual(0, gradeLevels.Count);
 }
Esempio n. 4
0
        public void CanLoadGradeLevels()
        {
            SqlLMSGradeLevelRepository repo = new SqlLMSGradeLevelRepository();
            var gradeLevels = repo.GradeLevelGetAll();

            Assert.AreNotEqual(0, gradeLevels.Count);
        }
Esempio n. 5
0
        public ActionResult GetUserDetails(int ID)
        {
            var gradeLevelRepo = new SqlLMSGradeLevelRepository();
            var roleRepo = new SqlLmsRoleRepository();
            var user = _lmsUserManager.GetUnassignedUserDetails(ID);

            UserDetailsToEditVM model = new UserDetailsToEditVM();
            model.UserDetailsToEdit = user.Data;
            model.CreateGradeLevel(gradeLevelRepo.GradeLevelGetAll());
            model.CreateRole(roleRepo.RoleGetAll());
            var userAllRoles = model.CreateUserRoleList(roleRepo.UserGetAllRoles(ID));
            model.PopulateRolesCheckbox(userAllRoles);

            return View(model);
        }
Esempio n. 6
0
        public ActionResult GetUserDetails(int ID)
        {
            var gradeLevelRepo = new SqlLMSGradeLevelRepository();
            var roleRepo       = new SqlLmsRoleRepository();
            var user           = _lmsUserManager.GetUnassignedUserDetails(ID);

            UserDetailsToEditVM model = new UserDetailsToEditVM();

            model.UserDetailsToEdit = user.Data;
            model.CreateGradeLevel(gradeLevelRepo.GradeLevelGetAll());
            model.CreateRole(roleRepo.RoleGetAll());
            var userAllRoles = model.CreateUserRoleList(roleRepo.UserGetAllRoles(ID));

            model.PopulateRolesCheckbox(userAllRoles);

            return(View(model));
        }