public ActionResult AddUser() { var model = new UserVM(); model.SetRoles(_repo.GetAllUsers()); return(View(model)); }
public ActionResult AddUser() { IDropDown dropDownRepo = RepositoryFactory.CreateDropDowns(); UserVM userVM = new UserVM(); userVM.SetRoles(dropDownRepo.RolesDropDown()); return(View(userVM)); }
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)); }