Ejemplo n.º 1
0
 public IActionResult SignIn(SignInViewModel model)
 {
     if (ModelState.IsValid)
     {
         var user = new Userlogin()
         {
             Username = model.Username,
             Password = model.Password
         };
         var check = _repository.AdminSignIn(user.Username, user.Password);
         if (check != null)
         {
             HttpContext.Session.SetInt32("loginId", check.UserloginId);
             return(RedirectToAction("Index", new { area = "", controller = "Dashboard" }));
         }
     }
     return(View());
 }
Ejemplo n.º 2
0
 public IActionResult SignIn(AdminSignInViewModel model)
 {
     if (ModelState.IsValid)
     {
         var user = new Userlogin()
         {
             Username = model.Username,
             Password = model.Password
         };
         var client = _repository.AdminSignIn(user.Username, user.Password);
         if (client != null)
         {
             HttpContext.Session.SetInt32("UserId", client.UserloginId);
             ViewBag.Name = client.Name;
             return(RedirectToAction("Index", new { controller = "Dashboard", area = "Admin" }));
         }
     }
     return(View());
 }