Beispiel #1
0
 public ActionResult SifreUnuttum(UyeFormu uye)
 {
     try
     {
         UyeFormu yeniSifre = new UyeFormu();
         yeniSifre.KullaniciAdi = uye.KullaniciAdi;
         Random rnd = new Random();
         yeniSifre.Sifre = rnd.Next(100000, 999999).ToString();
         //db de şifre alanını güncelle sifre değişkeni ile
         //sifre değişkenini mail at.
         _uyeFormuService.sifreGuncelle(yeniSifre);
         string mesaj = "Sifreniz sıfırlanmıstır." + "  " + "Yeni Şifreniz :" + yeniSifre.Sifre;
         bool   sonuc = MailHelper.SendConfirmationMail(mesaj, uye.KullaniciAdi);
         if (!sonuc)
         {
             throw new Exception();
         }
     }
     catch (Exception)
     {
         ViewBag.Error = "Şifre Sıfırlama Gerceklesmedi gerçekleştirilemedi";
         return(View());
     }
     return(RedirectToAction("Index", "Home"));
 }