示例#1
0
        public ActionResult Login(LoginViewModel model)
        {
            KullaniciRepository kullaniciRepository = new KullaniciRepository();
            var kullanici = kullaniciRepository.FirstOrDefault(x => x.KullaniciAdi == model.UserName && x.Sifre == model.Sifre);

            if (kullanici != null)
            {
                //TempData["Y"] = "Uygun ";
                return(RedirectToAction("List", "Home"));
            }
            else
            {
                //ViewBag.Message="sdfg";
                TempData["alertMessage"] = "Uygundeğil ";
                //ModelState.AddModelError("", "Kullanıcı bilgileri hatalı!");
                return(RedirectToAction("Index", "Home"));
            }
        }