Exemple #1
0
 public ActionResult Create(UserViewModel userViewModel)
 {
     userViewModel.User.CreationDate = DateTime.Now;
     userViewModel.User.Password = Crypto.HashPassword(userViewModel.User.Password);
     _userService.CreateUser(userViewModel.User.ToBllUser());
     return RedirectToAction("Index");
 }
Exemple #2
0
 public ActionResult Edit(int id)
 {
     UserViewModel userViewModel = new UserViewModel()
     {
         User = _userService.GetUserEntity(id).ToMvcUser(),
         Roles = _roleService.GetAllRoleEntities().ToMvcRole()
     };
     return View(userViewModel);
 }
Exemple #3
0
 public ActionResult Create()
 {
     UserViewModel userViewModel = new UserViewModel();
     userViewModel.Roles = _roleService.GetAllRoleEntities().ToMvcRole();
     return View(userViewModel);
 }
Exemple #4
0
 public ActionResult Edit(UserViewModel userViewModel)
 {
     _userService.UpdateUser(userViewModel.User.ToBllUser());
     return RedirectToAction("Index");
 }