예제 #1
0
        public IActionResult Login()
        {
            string username = "";
            string password = "";

            username = Request.Form["txtUser"].ToString();
            password = Request.Form["txtPassword"].ToString();

            bool isLogin = auth.AuthenticateLogin(username, password);

            if (isLogin)
            {
                Staff retrievedStaff = auth.RetrieveStaff(username);

                string user = retrievedStaff.StaffUsernameDetail();
                int    id   = retrievedStaff.StaffIDDetail();
                string role = retrievedStaff.StaffRoleDetail();

                HttpContext.Session.SetString(SessionKeyUser, user);
                HttpContext.Session.SetInt32(SessionKeyID, id);
                HttpContext.Session.SetString(SessionKeyRole, role);


                return(View("../Home/Index"));
            }
            else
            {
                ViewBag.Message = string.Format("Incorrect Username/Password");
                return(View("Login"));
            }
        }
예제 #2
0
 public FinServBussinessEntities.Utility_Classes.AuthenticationDetails AuthenticateLogin(string UserEmailId, string password)
 {
     return(repository.AuthenticateLogin(UserEmailId, password));
 }