public ActionResult Index(HomeIndex formData) { table_user kayit = new table_user(); string kadi, parola;//pass; Boolean dogrulama = false; if (!ModelState.IsValid) { return(View()); } foreach (var err in db.table_user) { kadi = err.kadi; parola = err.password; if (kadi == formData.kadi && parola == formData.parola) { FormsAuthentication.SetAuthCookie(err.kadi, true); Session.Add("Kullanici", err.kadi); dogrulama = true; } } if (dogrulama) { return(RedirectToRoute("akis")); //Session.Add("Kullanici",) //return View("akis"); } else { return(View()); } }
public ActionResult Reg(RegisterReg model, RegisterReg formData) { table_user kayit = new table_user(); kayit.kadi = model.Kadi; kayit.password = model.Parola; kayit.email = model.Email; kayit.name = model.Name; kayit.surname = model.Surname; kayit.telno = model.Telno; db.table_user.Add(kayit); db.SaveChanges(); if (!ModelState.IsValid) { return(View(model)); } return(View("olusturuldu")); }