Пример #1
0
        public BussinesLayerResult <Uyeler> UyeGiris(LoginView data)
        {
            BussinesLayerResult <Uyeler> repo = new BussinesLayerResult <Uyeler>();

            repo.Sonuc = uye.Listele().Find(x => x.Kullanici_EPosta == data.Kullanici_EPosta && x.Kullanici_Sifre == data.Kullanici_Sifre);

            if (repo.Sonuc != null)
            {
                if (!repo.Sonuc.IsActive)
                {
                    throw new Exception("Kullanıcı Aktifleştirilmemiştir");
                }
            }
            else
            {
                throw new Exception("E-Posta veya Şifre Hatalı");
            }

            return(repo);
        }
        public int KelimeListemeEkle(int Kullaniciid, int Kategoriid, int Kelimeid)
        {
            BussinesLayerResult <Kullanıcı_Kelime> repo = new BussinesLayerResult <Kullanıcı_Kelime>();
            Kullanıcı_Kelime K_Kelime = KullanıcıKelime.Listele().Find(x => x.Kelime_Id == Kelimeid && x.Kullanicı_Id == Kullaniciid && x.Kategori_Id == Kategoriid);

            if (K_Kelime != null)
            {
                return(0);
            }
            else
            {
                int deger = KullanıcıKelime.Ekle(new Kullanıcı_Kelime
                {
                    Kelime_Id    = Kelimeid,
                    Kullanicı_Id = Kullaniciid,
                    Kategori_Id  = Kategoriid,
                });
                return(1);
            }
        }
Пример #3
0
        public Uyeler UyeKayıt(LoginGirisView data)
        {
            //E-posta kontrolü
            BussinesLayerResult <Uyeler> repo = new BussinesLayerResult <Uyeler>();

            Uyeler kisi = uye.Listele().Find(x => x.Kullanici_EPosta == data.Kullanici_EPosta); //Kullanıcı E-mailleri eşleşiyormu Eşleşiyorsa bir kullanıcı dönecek bize

            if (kisi != null)                                                                   //belirtilen e-mail var ise hata mesajı yolla
            {
                throw new Exception("E-Posta adresi Zaten Var");
            }

            else
            {
                int sayı = uye.Ekle(new Uyeler
                {
                    Kullanici_Ad     = data.Kullanici_Ad,
                    Kullanici_EPosta = data.Kullanici_EPosta,
                    Kullanici_Sifre  = data.Kullanici_Sifre,
                    ActiveGuid       = Guid.NewGuid(),
                    IsActive         = false
                });

                if (sayı == 1) //Insert edilen kullanıcıları ekleme
                {
                    repo.Sonuc = uye.Listele().Find(x => x.Kullanici_EPosta == data.Kullanici_EPosta);
                }



                string gönderilecekkisi = data.Kullanici_EPosta;
                string Uri    = "http://localhost:60580";
                string Active = $"{Uri}/Anasayfa/UserActive/{repo.Sonuc.ActiveGuid}";
                string body   = $"Hesabını Aktifleştirmek için <a href='{Active}' target='_blank'>Tıklayınız</a> ";
                MailHelper.MailGönder(gönderilecekkisi, body, "Aktivasyon Kodu");//Aktivasyon kodunu gönderme
            }
            return(kisi);
        }