Esempio n. 1
0
        public async Task <ActionResult> Index(LoginModel model)
        {
            var user = await _userManager.FindByNameAsync(model.IDNP);

            if (_userManager != null)
            {
                var resultsignin = await _signInManager.PasswordSignInAsync(model.IDNP, model.VnPassword, false, false);

                if (resultsignin.Succeeded)
                {
                    return(RedirectToAction("Index", "Home"));
                }
            }

            LoginData data = new LoginData();

            data.IDNP       = model.IDNP;
            data.VnPassword = model.VnPassword;

            var response = await session.Login(data);

            if (response.Status == true)
            {
                return(RedirectToAction("Vote", "User"));
            }
            else
            {
                return(View());
            }
        }