public ActionResult SifremiUnuttum(string eposta)
        {
            try
            {
                Kullanici k = db.Kullanici.Where(x => x.eposta == eposta).SingleOrDefault();
                if (k == null)
                {
                    ViewBag.Sonuc = " Epostaya Ait Kişi bulunamadi";
                }
                else
                {
                    String sifre = Crypto.GenerateSalt(); //Benzersiz sifre olusturdu
                    k.sifre = Crypto.HashPassword(sifre); // sifreleyip veri tabanina koydu
                    db.SaveChanges();
                    string mesaj = "";
                    mesaj = mesaj + "<b>" + k.ad + " " + k.soyad.ToUpper() + "</b> <br/>";
                    mesaj = mesaj + "<b> Yeni sifreniz: <h1>" + sifre + "<h1>  </b> <br/><br/><hr/>";

                    Eposta.Gonder("Sifre Yenileme Talebi", mesaj, eposta);
                    TempData["uyari"] = "Sifreniz basarı ile sıfırlandı";
                }
            }
            catch (Exception)
            {
                ViewBag.Sonuc = "bilinmeyen bir hata olustu";
                return(View());
            }
            return(View());
        }
Beispiel #2
0
        public ActionResult MesajAt(tbl_Mesaj mesaj)
        {
            var Kullanici = uow.GetRepository <tbl_Kullanici>()
                            .Get(x => x.Kullanici_Adi == HttpContext.User.Identity.Name);
            var body = new StringBuilder();

            if (HttpContext.User.Identity.Name != "")
            {
                body.AppendLine("Kullanıcı mesajı");
                body.AppendLine("Eposta: " + Kullanici.Eposta);
                body.AppendLine("isim: " + Kullanici.Ad + " " + Kullanici.Soyad);
            }
            else
            {
                body.AppendLine("Ziyaretçi mesajı");
                body.AppendLine("Eposta: " + mesaj.Eposta);
                body.AppendLine("isim: " + mesaj.AdSoyad);
            }
            body.AppendLine("Konu: " + mesaj.Konu);
            body.AppendLine("içerik: " + mesaj.Icerik);
            Eposta.SendMail(body.ToString());
            ViewBag.succes = true;

            return(View("Index"));
        }
        public ActionResult SifremiUnuttum(string email)
        {
            SinemaContext db = new SinemaContext();
            Kullanici     k  = db.Kullanici.Where(x => x.mail == email).SingleOrDefault();

            if (k != null)
            {
                //string yeniSifre = new Random().Next(100000,999999).ToString();
                //db.SaveChanges();
                //string konu = "Şifre Hatırlatma";
                //string mesaj = "Şifreniz: " + k.sifre;
                //Eposta.Gonder(k.mail,konu,mesaj);
                //ViewBag.Mesaj = "Epostanıza Şifreniz Gönderilmiştir.";

                Sifre s = new Sifre();
                s.kullaniciID = k.kullaniciID;
                s.tarih       = DateTime.Now;
                s.kod         = Guid.NewGuid();
                db.Sifre.Add(s);
                db.SaveChanges();
                string konu  = "Şifre Sıfırlama";
                string mesaj = "Şifrenizi sıfırlamak için <a href='http://localhost:8811/Login/SifreSifirla?kod=" + s.kod + "'>tıklayınız";
                Eposta.Gonder(konu, mesaj, k.mail);
                ViewBag.Mesaj = "Epostanıza Şifreniz Gönderilmiştir.";
            }
            else
            {
                ViewBag.Mesaj = "Böyle Bir Eposta Bulunamadı!";
            }
            return(View());
        }
Beispiel #4
0
        public ActionResult Iletisim(Iletisim iletisim)
        {
            iletisim.tarih = DateTime.Now;
            db.Iletisim.Add(iletisim);
            db.SaveChanges();

            string mesaj = "";

            mesaj = mesaj + "Gönderen Kişinin: <hr/>";
            mesaj = mesaj + "Ad: <b>" + iletisim.ad + "&nbsp;&nbsp;" + iletisim.soyad + "</b> <br/>";
            mesaj = mesaj + "Eposta: <b>" + iletisim.eposta + "</b> <br/>";
            mesaj = mesaj + "Telefon: <b>" + iletisim.telefon + "</b> <br/><br/>";
            mesaj = mesaj + "Kullanıcının Mesajı: <hr/>";
            mesaj = mesaj + iletisim.mesaj;

            Eposta.Gonder(iletisim.konu, mesaj);

            ViewBag.Sonuc = "Mesajınızı Aldık Sizinle En Kısa Sürede İletişime Geçeceğiz.";
            return(View());
        }
Beispiel #5
0
        public ActionResult SifremiUnuttum(string eposta)
        {
            AnaokuluContext db        = new AnaokuluContext();
            kullanici       kullanici = db.kullanici.Where(x => x.eposta == eposta).SingleOrDefault();

            if (kullanici != null)
            {
                //kullanici.sifre = new Random().Next(100000, 99999).ToString();
                //db.SaveChanges();
                string konu  = "Şifre Hatırlatma";
                string mesaj = "Yeni Şifreniz:" + kullanici.sifre;
                Eposta.Gonder(kullanici.eposta, konu, mesaj);
                ViewBag.Uyari = "Epostanıza şifreniz gönderilmiştir..";
            }
            else
            {
                ViewBag.Uyari = "Böyle Bir Eposta Adresi Bulunamadı..";
            }

            return(View());
        }
Beispiel #6
0
        public ActionResult IletisimDetay(string icerik)
        {
            try
            {
                int      id = (int)TempData["Iletisimid"];
                Iletisim i  = db.Iletisim.Where(x => x.ID == id).SingleOrDefault();

                string mesaj = "";
                mesaj = mesaj + "<b>Sayın " + i.isim + "</b> <br/>";
                mesaj = mesaj + icerik + "<hr/>";
                mesaj = mesaj + i.icerik;
                Eposta.Gonder("İletisim isteginiz hakkında", mesaj, i.eposta);
                TempData["uyari"] = " Basarı ile yanıtlanmıştır";
            }
            catch (Exception)
            {
                TempData["tehlikeli"] = "Yanıtlarken hata oldu";
                return(RedirectToAction("IletisimListele"));
            }
            return(RedirectToAction("IletisimListele"));
        }