Esempio n. 1
0
 public IActionResult RegisterCustomer(RegisterUserViewModel viewModel)
 {
     if (viewModel.Name != null && viewModel.LastName != null && viewModel.Email != null && viewModel.Password != null)
     {
         _registerLogic.RegisterUser(viewModel.Name, viewModel.LastName, viewModel.Email, viewModel.Password, 1);
         return(RedirectToAction("Index", "home"));
     }
     return(View("RegisterCustomer", viewModel));
 }
Esempio n. 2
0
        public IActionResult RegisterUser(RegisterUserViewModel viewModel)
        {
            if (/*viewModel.State == valid*/ viewModel.EMail != null && viewModel.Name != null && viewModel.PassWord != null)
            {
                string eMailLoggedIn = Convert.ToString(User.Claims.Where(claim => claim.Type == ClaimTypes.Email).Select(claim => claim.Value).SingleOrDefault());

                registerLogic.RegisterUser(viewModel.Name, viewModel.EMail, viewModel.PassWord, viewModel.Role, eMailLoggedIn);
                return(RedirectToAction("Index", "Home"));
            }

            return(View("RegisterUser", viewModel));
        }
Esempio n. 3
0
 public IActionResult Register(RegisterViewModel viewModel)
 {
     registerLogic.RegisterUser(viewModel.Email, viewModel.Password, viewModel.Username);
     return(RedirectToAction("Index", "Home"));
 }