コード例 #1
0
 public void OnGet(string userName, string passWord)
 {
     check = _userService.checkLoginVm(userName, passWord);
     if (check)
     {
         Response.Redirect("http://localhost:5000");
         HttpContext.Session.SetString("IDUser", userName);
         session = HttpContext.Session.GetString("IDUser");
     }
 }
コード例 #2
0
 public void OnGet(string userName, string passWord)
 {
     checkRole = _userService.checkRole(userName, passWord);
     check     = _userService.checkLoginVm(userName, passWord);
     HttpContext.Session.SetString("Role", checkRole);
     if (check)
     {
         Response.Redirect("http://localhost:5000");
         HttpContext.Session.SetString("IDUser", userName);
         session = HttpContext.Session.GetString("IDUser");
         if (!HttpContext.Session.GetString("Role").Contains("admin"))
         {
             Response.Redirect("http://localhost:5000/Order");
         }
     }
 }