public ActionResult Index(TBLKullanicilar user) { var kullanici = db.TBLKullanicilar.FirstOrDefault(c => c.KullaniciAdi == user.KullaniciAdi && c.Sifre == user.Sifre); if (kullanici != null) { FormsAuthentication.SetAuthCookie(user.KullaniciAdi, false); return(RedirectToAction("Index", "Route")); } ViewBag.hata = "Kullanıcı adı veya şifreniz yanlış!"; return(View()); }
public ActionResult Index(TBLKullanicilar kullanici) { if (!ModelState.IsValid) { return(View()); } else { kullanici.Rol = "User"; db.Entry(kullanici).State = System.Data.Entity.EntityState.Added; db.SaveChanges(); return(RedirectToAction("Index")); } }