Exemplo n.º 1
0
        public IActionResult Login(UserDetail ud)
        {
            UserMethod um    = new UserMethod();
            string     error = "";

            if (um.LogIn(ud.User_UserName, out error) == true)
            {
                HttpContext.Session.SetString("UserID", ud.User_UserName);
                if (HttpContext.Session.GetString("fromWhere") == "FromVoteOn")
                {
                    return(RedirectToAction("NomineesToVoteOn"));
                }
                else if (HttpContext.Session.GetString("fromWhere") == "attend")
                {
                    return(RedirectToAction("Attend"));
                }
                else
                {
                    return(View("Index"));
                }
            }
            ud.LogInErrorMessage = error;

            return(View("Login", ud));
        }