public ActionResult UyeOl(UyeBilgileri bilgi)
        {
            var sifre = new ToPasswordRepository().Md5(bilgi.parola);


            _customeradresservice.Add(new CustomersAdress {
                CustomerAdress = bilgi.adres
            });
            var sonkisi = _customeradresservice.GetAll().LastOrDefault();

            _customerservice.Add(new Customer
            {
                Cname             = bilgi.isim,
                UserName          = bilgi.soyisim,
                CountryName       = bilgi.ulke,
                CityName          = bilgi.il,
                CountyName        = bilgi.ilce,
                NeighborhoodName  = bilgi.semt,
                Password          = sifre,
                EmailAdress       = bilgi.Email,
                CustomersAdressId = sonkisi.Id
            });

            return(RedirectToAction("GirisYap"));
        }
        public void Kaydet(object sender, System.EventArgs e)
        {
            var dbpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "UserDatabase.db");
            var db     = new SQLiteConnection(dbpath);

            db.CreateTable <UyeBilgileri>();

            var item = new UyeBilgileri()
            {
                UyeAd    = AdEditor.Text,
                UyeEmail = EmailEntry.Text,
                UyeSifre = SifreEditor.Text,
                UyeSoyad = SoyadEditor.Text
            };

            db.Insert(item);
            Device.BeginInvokeOnMainThread(async() =>
            {
                var result = await this.DisplayAlert("Tebrikler!", "Kayit Isleminiz Tamamlandi", "Tamam", "Iptal");
                if (result)
                {
                    await Navigation.PushAsync(new GirisSayfasi());
                }
            });
        }
        public ActionResult UyeKayit(UyeKontrol KayitOlanUye)
        {
            var varmi = NotBankasiDB.UyeBilgileris.FirstOrDefault(x => x.EMail == KayitOlanUye.Email);

            if (varmi == null)
            {
                UyeBilgileri uye = new UyeBilgileri();

                if (KayitOlanUye.Sifre == KayitOlanUye.SifreOnay)
                {
                    uye.İsim          = KayitOlanUye.Isim;
                    uye.Soyisim       = KayitOlanUye.Soyisim;
                    uye.Sifre         = KayitOlanUye.Sifre;
                    uye.EMail         = KayitOlanUye.Email;
                    uye.Resim         = "user.jpg";
                    uye.Universite_Id = 1;
                    uye.Bolum_Id      = 1;
                    NotBankasiDB.UyeBilgileris.Add(uye);
                    NotBankasiDB.SaveChanges();
                    return(RedirectToAction("UyeGiris", "UyeGiris"));
                }
                else
                {
                    ViewBag.mesaj += "Şifreler eşleşmiyor";
                }
            }
            else
            {
                ViewBag.mesaj += "Sistemde böyle bir kullanıcı var";
            }
            return(View());
        }
        public ActionResult UyeKayit(string adi, string email, string sifre, string sifreOnayla)
        {
            var varmi = NotBankasiDB.UyeBilgileris.FirstOrDefault(x => x.EMail == email);

            if (varmi == null)
            {
                UyeBilgileri uye = new UyeBilgileri();

                if (sifre == sifreOnayla)
                {
                    uye.EMail        = email;
                    uye.KullanıcıAdı = adi;
                    uye.Sifre        = sifre;
                    NotBankasiDB.UyeBilgileris.Add(uye);
                    NotBankasiDB.SaveChanges();
                    return(RedirectToAction("UyeGirsi", "UyeGiris"));
                }
                else
                {
                    ViewBag.mesaj += "Şifreler eşleşmiyor";
                }
            }
            else
            {
                ViewBag.mesaj += "Sistemde böyle bir kullanıcı var";
            }
            return(View());
        }
        public ActionResult UyeGiris(UyeBilgileri GelenUye, string benihatirla)
        {
            if (ModelState.IsValid)
            {
                var GirenUye = NotBankasiDB.UyeBilgileris.FirstOrDefault(x => x.EMail == GelenUye.EMail && x.Sifre == GelenUye.Sifre);
                if (GirenUye != null)
                {
                    //if (benihatirla == "true")
                    //FormsAuthentication.SetAuthCookie(GelenUye.EMail, true);

                    if (benihatirla == "true")
                    {
                        var cookie = FormsAuthentication.GetAuthCookie(GelenUye.EMail, true);
                        cookie.Expires = DateTime.Now.AddDays(30);
                        Response.Cookies.Add(cookie);
                    }
                    else
                    {
                        FormsAuthentication.SetAuthCookie(GelenUye.EMail, false);
                    }

                    return(RedirectToAction("UyeProfilDuzenle", "UyeProfilDuzenle", GelenUye));
                }
                else
                {
                    ModelState.AddModelError("", "Mail veya şifre hatalı!");
                }
            }

            return(View(GelenUye));
        }
        // GET: UyeProfilDuzele
        public ActionResult UyeProfilDuzenle(UyeBilgileri kullanici)
        {
            List <Universite> unis = NotBankasiDB.Universites.ToList();

            ViewBag.Unis = unis;
            var gelenKullanici = NotBankasiDB.UyeBilgileris.Where(x => x.Uye_Id == kullanici.Uye_Id).FirstOrDefault();

            return(View(gelenKullanici));
        }
        // GET: UyeProfilDuzele
        public ActionResult UyeProfilDuzenle()
        {
            List <Universite> unis = NotBankasiDB.Universites.ToList();

            ViewBag.Unis = unis;
            int          kullanciID = Convert.ToInt32(Session["KullaniciID"]);
            UyeBilgileri uye        = NotBankasiDB.UyeBilgileris.Where(x => x.Uye_Id == kullanciID).FirstOrDefault();

            return(View(uye));
        }
Exemple #8
0
        async void Kaydet(object sender, System.EventArgs e)
        {
            try
            {
                var authProvider = new FirebaseAuthProvider(new FirebaseConfig(WebAPIkey));
                var auth         = await authProvider.CreateUserWithEmailAndPasswordAsync(EmailEntry.Text, SifreEditor.Text);

                string gettoken = auth.FirebaseToken;
            }
            catch (Exception ex)
            {
                await App.Current.MainPage.DisplayAlert("Uyari", ex.Message, "Tamam");
            }


            var dbpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "UserDatabase.db");
            var db     = new SQLiteConnection(dbpath);

            db.CreateTable <UyeBilgileri>();

            var item = new UyeBilgileri()
            {
                UyeAd    = AdEditor.Text,
                UyeEmail = EmailEntry.Text,
                UyeSifre = SifreEditor.Text,
                UyeSoyad = SoyadEditor.Text
            };

            if (SifreEditor.Text == SifreYenidenEditor.Text)
            {
                db.Insert(item);

                Device.BeginInvokeOnMainThread(async() =>
                {
                    var result = await this.DisplayAlert("Tebrikler!", "Kayit Isleminiz Tamamlandi", "Tamam", "Iptal");
                    if (result)
                    {
                        await Navigation.PushAsync(new GirisSayfasi());
                    }
                });
            }
            else
            {
                Device.BeginInvokeOnMainThread(async() =>
                {
                    var result = await this.DisplayAlert("Uyari!", "Sifre ve sifre yeniden ayni olmali", "Tamam", "Iptal");
                    if (result)
                    {
                        await Navigation.PushAsync(new KayitSayfasi());
                    }
                });
            }
        }
        public ActionResult UyeProfilDuzenle(HttpPostedFileBase ProfilResmi, UyeKontrol GuncellenenUye, string comboUni, string comboBolum)
        //Allah affettis abi
        {
            ViewBag.Mesaj = "";
            UyeBilgileri uye        = new UyeBilgileri();
            int          kullanciID = Convert.ToInt32(Session["KullaniciID"]);
            int          bolumID    = NotBankasiDB.Universite_Bolum.Where(x => x.BolumAdı == comboBolum).Select(x => x.Bolum_Id).FirstOrDefault();

            uye = NotBankasiDB.UyeBilgileris.FirstOrDefault(x => x.Uye_Id == kullanciID);

            if (GuncellenenUye.Sifre == GuncellenenUye.SifreOnay)
            {
                if (ProfilResmi != null)
                {
                    string dosyaAdi = Path.GetFileName(ProfilResmi.FileName);
                    string path     = Path.Combine(Server.MapPath("~/img"), dosyaAdi);
                    ProfilResmi.SaveAs(Server.MapPath($"~/img/{dosyaAdi}"));
                    uye.Resim = dosyaAdi;
                }
                uye.EMail         = GuncellenenUye.Email;
                uye.İsim          = GuncellenenUye.Isim;
                uye.Soyisim       = GuncellenenUye.Soyisim;
                uye.Sifre         = GuncellenenUye.Sifre;
                uye.Universite_Id = Convert.ToInt32(comboUni);
                uye.Bolum_Id      = bolumID;
                NotBankasiDB.SaveChanges();
                //ViewBag.Isim = uye.İsim;
                //ViewBag.Soyad = uye.Soyisim;
                //ViewBag.Sifre = uye.Sifre;
                //ViewBag.Universite = uye.Universite.UniversiteAdı;
                //ViewBag.Mail = uye.EMail;
                ViewBag.Mesaj += "Kayıt İşlemi Tamamlandı";
                //ViewBag.Resim = uye.Resim;
                Session["KullaniciResmi"] = uye.Resim;
                List <Universite> unis = NotBankasiDB.Universites.ToList();
                ViewBag.Unis = unis;
                return(View(uye));
            }
            else
            {
                ViewBag.mesaj += "Şifreler eşleşmiyor";
            }


            return(View());
        }
        public ActionResult UyeGiris(UyeBilgileri GirisYapanUye, string benihatirla)
        {
            if (ModelState.IsValid)
            {
                var Kontrol = NotBankasiDB.UyeBilgileris.FirstOrDefault(x => x.EMail == GirisYapanUye.EMail && x.Sifre == GirisYapanUye.Sifre);
                if (Kontrol != null)
                {
                    //if (benihatirla == "true")
                    //FormsAuthentication.SetAuthCookie(GirisYapanUye.EMail, true);

                    if (benihatirla == "true")
                    {
                        var cookie = FormsAuthentication.GetAuthCookie(GirisYapanUye.EMail, true);
                        cookie.Expires = DateTime.Now.AddDays(30);
                        Response.Cookies.Add(cookie);
                    }
                    else
                    {
                        FormsAuthentication.SetAuthCookie(GirisYapanUye.EMail, false);
                    }

                    UyeBilgileri UyeBilgileri = NotBankasiDB.UyeBilgileris.Where(x => x.EMail == GirisYapanUye.EMail).FirstOrDefault();

                    //FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, UyeBilgileri.Uye_Id.ToString(), DateTime.Now, DateTime.Now.AddMinutes(Session.Timeout), true, UyeBilgileri.EMail);
                    //HttpCookie giris = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket));
                    //Response.Cookies.Add(giris);

                    //UyeBilgileri.Bolum_Id = 1;
                    //UyeBilgileri.Universite_Id = 1;
                    //UyeBilgileri.Not_Id = 1;
                    //UyeBilgileri.Resim = "~/img/user.png";
                    Session.Add("KullaniciIsmi", UyeBilgileri.İsim);
                    Session.Add("KullaniciResmi", UyeBilgileri.Resim);
                    Session.Add("KullaniciID", UyeBilgileri.Uye_Id);

                    return(RedirectToAction("AnaSayfa", "AnaSayfa"));
                }
                else
                {
                    ModelState.AddModelError("", "Mail veya şifre hatalı!");
                }
            }
            return(View());
        }
        public ActionResult Uyeol()
        {
            UyeBilgileri bilgi = new UyeBilgileri();

            return(View(bilgi));
        }