Beispiel #1
0
        public Role GerRoleForUser(RegistrationModelDTO user)
        {
            var a = uOW.RoleRepo.All.Where(x => x.Name == user.Role.Name).First();

            return a;
        }
Beispiel #2
0
        public ActionResult Registration(RegistrationModelDTO user)
        {
            if (ModelState.IsValid)
            {
                if (!userManager.IfUserNameExists(user.UserName) && !userManager.IfEmailExists(user.Email))
                {
                    if (userManager.IsUserNameCorrect(user.UserName))
                    {

                        user.Lang = (string)Session["Culture"];

                        userManager.AddUser(user);

                        Authentification(new LoginModel() {  UserName = user.UserName, Password = user.Password});

                        return RedirectToAction("Index", "User");
                    }
                    //else ModelState.AddModelError("", "Login syntax error");
                }
                //else ModelState.AddModelError("", "User Name or Email is already exist");
            }

            return View(user);
        }
Beispiel #3
0
 public UserDTO AddUser(RegistrationModelDTO user)
 {
     return InsertUser(Mapper.Map<UserDTO>(user));
 }