Beispiel #1
0
        public ActionResult Login(LoginDto loginDto)
        {
            bool     res           = _customerServices.CustomerLogin(loginDto.UserName, loginDto.password);
            Customer loginCustomer = _customerServices.GetCustomerByUsername(loginDto.UserName);

            if (res == true)
            {
                if (loginCustomer != null)
                {
                    Session["loginCustomer"] = loginCustomer;
                    Session.Timeout          = 720; // Expire date!
                    return(RedirectToAction("Index", "Home"));
                }
            }
            else
            {
                ModelState.AddModelError("", "Kullanici adinizi veya şifrenizi kontrol ediniz.");
            }
            return(View(loginDto));
        }