public bool isLoginSucces(string user, string pass) { TBLKULLANICI resultUser = db.TBLKULLANICI.Where(x => x.KullaniciAdi.Equals(user) && x.Sifre.Equals(pass)).FirstOrDefault(); if (resultUser != null) { return(true); } return(false); }
public ActionResult Index(string username, string pass) { TBLKULLANICI resultUser = db.TBLKULLANICI.Where(x => x.KullaniciAdi.Equals(username) && x.Sifre.Equals(pass)).FirstOrDefault(); if (resultUser != null) { Session.Add("KullaniciAdi", resultUser.KullaniciAdi); Session.Add("Yetki", resultUser.Yetki); return(RedirectToAction("Index", "Default")); } return(RedirectToAction("Index", "UyeGiris")); }
public ActionResult GirisYap(TBLKULLANICI t) { var bilgiler = db.TBLKULLANICI.FirstOrDefault(x => x.AD == t.AD && x.SIFRE == t.SIFRE); if (bilgiler != null) { FormsAuthentication.SetAuthCookie(bilgiler.AD, false); return(RedirectToAction("Index", "Musteri")); } else { return(View()); } }
public ActionResult Login(LoginModel model, string returnurl) { using (MvsDbstokEntities1 db = new MvsDbstokEntities1()) { if (ModelState.IsValid) { TBLKULLANICI kullanici = db.TBLKULLANICI.Where (x => x.Email.ToLower().Trim() == model.Email.ToLower().Trim() && x.Sifre.ToLower().Trim() == model.Sifre.ToLower().Trim()).FirstOrDefault(); if (kullanici != null) { FormsAuthentication.SetAuthCookie(model.Email, true); FormsAuthentication.RedirectFromLoginPage(model.Email, true); return(RedirectToAction("Index", "Home")); } } return(View(model)); } }
public ActionResult KullanıcıGüncelle(string username, string password, string eposta) { int userid = (int)Session["UserId"]; TBLKULLANICI obj = new TBLKULLANICI(); obj = entities.TBLKULLANICI.Where(a => a.REC_ID == userid).FirstOrDefault(); obj.KULLANICI_ADI = username; obj.SIFRE = password; obj.REC_UPUSERNO = (int)Session["UserId"]; obj.REC_UPUSERNAME = username; obj.REC_UPDATE = DateTime.Now; obj.E_POSTA = eposta; obj.REC_CHANGED = "1"; obj.REC_VERSION = CreateCommon.REC_VERSION; entities.Entry(obj).State = EntityState.Modified; entities.SaveChanges(); return(RedirectToAction("Index", "Personel")); }
public ActionResult personelEkle(TBLPERSONEL model) { model.REC_DATE = DateTime.Now; model.REC_UPDATE = DateTime.Now; model.REC_UPUSERNAME = (String)Session["UserName"]; model.REC_UPUSERNO = (int)Session["UserId"]; model.REC_USERNAME = (String)Session["UserName"]; model.REC_USERNO = (int)Session["UserId"]; model.REC_CHANGED = "0"; model.REC_VERSION = CreateCommon.REC_VERSION; model.DURUM = "1"; entities.TBLPERSONEL.Add(model); TBLKULLANICI kullaniciModel = new TBLKULLANICI(); kullaniciModel.REC_DATE = DateTime.Now; kullaniciModel.REC_UPDATE = DateTime.Now; kullaniciModel.REC_UPUSERNAME = (String)Session["UserName"]; kullaniciModel.REC_UPUSERNO = (int)Session["UserId"]; kullaniciModel.REC_USERNAME = (String)Session["UserName"]; kullaniciModel.REC_USERNO = (int)Session["UserId"]; kullaniciModel.REC_CHANGED = "0"; kullaniciModel.REC_VERSION = CreateCommon.REC_VERSION; kullaniciModel.PERSONEL_KOD = model.PERSONEL_KOD; kullaniciModel.SIFRE = CreateCommon.ilkSifre; kullaniciModel.KULLANICI_ADI = model.PERSONEL_KOD; entities.TBLKULLANICI.Add(kullaniciModel); entities.SaveChanges(); ViewBag.Messsage = "kayıdınız başarılı bir şekilde oluşturuldu"; return(RedirectToAction("Index")); //return RedirectToAction("kullanıcıEkle", new { personel_kod = model.PERSONEL_KOD }); }