public IActionResult Index(Uye Gelenbilgi) { using (ZamanContext ctx = new ZamanContext()) { var SifreDönüt = Sifreleme.CalculateMd5Hash(Gelenbilgi.Sifre); var bulunanone = ctx.Uyeler.Where(u => u.Eposta == Gelenbilgi.Eposta && u.Sifre == SifreDönüt); if (bulunanone.Count() == 0) { TempData["durum"] = true; TempData["mesaj"] = "Email or password is incorrect"; return(RedirectToAction("Index")); } else { var bulunan = ctx.Uyeler.FirstOrDefault(o => o.Eposta == Gelenbilgi.Eposta); if (bulunan.AktifMi == 1) { var i = bulunan.Uyeid; TempData["gidenid"] = i; return(RedirectToAction("Send", "SignIn", new { id = i })); } else { TempData["durumtwo"] = true; TempData["msj"] = "your membership is inactive"; return(RedirectToAction("Index")); } } } }
public IActionResult Index(Uye GelenUye) { using (ZamanContext ctx = new ZamanContext()) { var dönüt = Sifreleme.CalculateMd5Hash(GelenUye.Sifre); var toplu = ctx.Uyeler.ToList(); var bulunanone = ctx.Uyeler.Where(u => u.Eposta == GelenUye.Eposta); if (bulunanone.Count() != 0) { TempData["mesaj"] = "email is already in use"; TempData["durum"] = true; return(new RedirectResult("/Register/Index")); } GelenUye.Sifre = dönüt; GelenUye.AktifMi = 0; string mail = GelenUye.Eposta; ctx.Uyeler.Add(GelenUye); ctx.SaveChanges(); int i = GelenUye.Uyeid; //string url = string.Format("<a href=\"www.zaman.com/Register/UyeKayit/{0}\"></a>",i); //Link olarak dönmüyor. string link = string.Format("<a href=\"http://www.timemail.org/Register/UyeKayit/{0}\">Onay için buraya tıklayınız.</a>", i); SendMail.Onaymail(mail, link); return(RedirectToAction("Onay")); } }
public IActionResult NewPassword(Uye yeniSifre) //şifre yenileme mailinde ,maildeki adrese tıkladığında burası işleme giricek { var dönüt = Sifreleme.CalculateMd5Hash(yeniSifre.Sifre); using (ZamanContext ctx = new ZamanContext()) { var i = Convert.ToInt32(TempData["id"]); var b = ctx.Uyeler.Find(i); b.Sifre = dönüt; ctx.SaveChanges(); TempData["d"] = true; TempData["m"] = "Password change is successful"; return(RedirectToAction("Index")); } }