コード例 #1
0
        public ActionResult AddUser()
        {
            var model = new UserVM();

            model.SetRoles(_repo.GetAllUsers());
            return(View(model));
        }
コード例 #2
0
        public ActionResult AddUser()
        {
            IDropDown dropDownRepo = RepositoryFactory.CreateDropDowns();
            UserVM    userVM       = new UserVM();

            userVM.SetRoles(dropDownRepo.RolesDropDown());
            return(View(userVM));
        }
コード例 #3
0
        public ActionResult EditUser(string Id)
        {
            ICarDealerRepository _repo        = RepositoryFactory.Create();
            IDropDown            dropDownRepo = RepositoryFactory.CreateDropDowns();
            UserVM  editVM = new UserVM();
            AppUser user   = _repo.GetUser(Id);

            editVM.LastName  = user.LastName;
            editVM.FirstName = user.FirstName;
            editVM.Email     = user.Email;
            editVM.Role      = user.Role;
            editVM.Password  = user.Password;
            editVM.SetRoles(dropDownRepo.RolesDropDown());
            return(View(editVM));
        }