Exemple #1
0
        public ActionResult Login(CustomerDto customer)
        {
            Customer findCustomer = _customerServices.FindCustomerByName(customer.Username);

            if (ModelState.IsValid)
            {
                // Kullanici Active olmuşmu
                bool res = _customerServices.Login(findCustomer);
                if (res == true)
                {
                    // ModelState.AddModelError("", "Giriş Başarılı");
                    Session["loginCustomer"] = findCustomer;
                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    ModelState.AddModelError("", "Lütfen kullanıcı adınızı ve şifrenizi kontrol ediniz.");
                }
            }
            return(View(customer));
        }