Exemplo n.º 1
0
        public ActionResult KayitOl(KayitModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var       now       = DateTime.Now;
                    Kullanici kullanici = new Kullanici
                    {
                        Eposta             = model.Eposta,
                        GuncellemeTarihi   = now,
                        KayitTarihi        = now,
                        KullaniciAdi       = model.KullaniciAdi,
                        Sifre              = model.Sifre,
                        Onayli             = false,
                        OnayKodu           = Guid.NewGuid(),
                        OrjinalProfilResim = "Images/Icons/Buyuk/no_profile_image.png",
                        KucukProfilResim   = "Images/Icons/Kucuk/no_profile_image.png"
                    };

                    kullaniciServis.KullaniciOlustur(kullanici);
                    kullaniciServis.OnayMesajiGonder(kullanici.Eposta, Request.Url.GetLeftPart(UriPartial.Authority));
                    return(RedirectToAction("Index", "Anasayfa"));
                }
                catch (Exception ex)
                {
                    ModelState.AddModelError("", "Kullanıcı oluşturma başarısız!");
                }
            }

            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult KayitDuzenle(KayitModel km)
        {
            tbl_Kayitlar kayit = db.tbl_Kayitlar.Where(k => k.Id == km.Id).SingleOrDefault();

            kayit.AdSoyad = km.AdSoyad;
            kayit.Email   = km.Email;
            kayit.Yas     = km.Yas;
            db.SaveChanges();
            ViewBag.sonuc = "Kayıt Güncellendi";
            return(View());
        }
Exemplo n.º 3
0
        public ActionResult KayitDuzenle(int?id)
        {
            tbl_Kayitlar kayit = db.tbl_Kayitlar.Where(k => k.Id == id).SingleOrDefault();
            KayitModel   model = new KayitModel();

            model.Id      = kayit.Id;
            model.AdSoyad = kayit.AdSoyad;
            model.Email   = kayit.Email;
            model.Yas     = kayit.Yas;
            return(View(model));
        }
Exemplo n.º 4
0
        public ActionResult YeniKayit(KayitModel model)
        {
            tbl_Kayitlar kayit = new tbl_Kayitlar();

            kayit.AdSoyad = model.AdSoyad;
            kayit.Email   = model.Email;
            kayit.Yas     = model.Yas;
            db.tbl_Kayitlar.Add(kayit);
            db.SaveChanges();
            ViewBag.sonuc = "Kayıt Yapıldı";
            return(View());
        }
Exemplo n.º 5
0
        public ActionResult Kayit(KayitModel model, string returnUrl)
        {
            string message = "";
            bool   Status  = false;

            #region //User Register
            if (ModelState.IsValid)
            {
                var    isExist = IsKimlikNoExist(model.TCKN);
                string hesapNo = HesapNoÜret();
                if (isExist)
                {
                    ModelState.AddModelError("TCKN", "Bu TCKN ait baska bir müsteri vardir!");
                    message         = "Bu TCKN ait baska bir müsteri vardir!";
                    ViewBag.message = message;
                    return(View(model));
                }

                var sifre = Crypto.Hash(model.Sifre);
                var user  = new tblMusteri();
                var hesap = new tblMusteriHesap();
                user.musteriAd       = model.Ad;
                user.musteriSoyAd    = model.SoyAd;
                user.musteriMail     = model.Email;
                user.musteriSifre    = sifre;
                user.musteriTCKN     = model.TCKN;
                user.musteriTelefon  = model.TelefonNo;
                user.musteriNumarası = Convert.ToInt32(hesapNo);

                var result = db.tblMusteri.Add(user);
                if (result != null)
                {
                    db.SaveChanges();
                    Status = true;

                    return(RedirectToAction("Giris", "Uyelik"));
                }
            }
            else
            {
                message = "Gecersiz İstek";
            }

            #endregion

            ViewBag.Message = message;
            return(View());
        }
Exemplo n.º 6
0
        public SonucModel KayitEkle(KayitModel model)
        {
            if (db.Kayit.Count(s => s.kayitKatId == model.kayitKatId && s.kayitUrunId == model.kayitUrunId) > 0)
            {
                sonuc.islem = false;
                sonuc.mesaj = "Ürün bu kategoriye kayıtlıdır.";
                return(sonuc);
            }

            Kayit yeni = new Kayit();

            yeni.kayitId     = model.kayitId;
            yeni.kayitUrunId = model.kayitUrunId;
            yeni.kayitKatId  = model.kayitKatId;
            db.Kayit.Add(yeni);
            db.SaveChanges();

            sonuc.islem = true;
            sonuc.mesaj = "Ürün kategoriye eklendi.";
            return(sonuc);
        }
Exemplo n.º 7
0
        public ActionResult KayitOl(KayitModel postData)
        {
            bool result = new Models.Musteri.Kayit().KayitOl(postData);

            return(RedirectToAction("GirisYap1", "Giris"));
        }
Exemplo n.º 8
0
 public static Kayit ToEntity(this KayitModel model, Kayit destination)
 {
     return(model.MapTo(destination));
 }
Exemplo n.º 9
0
 public static Kayit ToEntity(this KayitModel model)
 {
     return(model.MapTo <KayitModel, Kayit>());
 }