public List <KullaniciBilgileriEn> GetKullaniciBul(KullaniciBilgileriEn kullanici) { var list = new List <KullaniciBilgileriEn>(); var KullaniciBulundu = kullaniciLogin.GetKullaniciLoginIslemleriBy(kullanici.Email, kullanici.Sifre); return(list); }
//public List<KullaniciBilgileriEn> GetKullaniciKaydiBilgileri(string email) public List <KullaniciBilgileriEn> GetKullaniciKaydiBilgileri(string email) { var kullanici = new KullaniciBilgileriEn() { Email = email }; //Todo Kullanici Var mı yok mu ona bakılacak var list = new List <KullaniciBilgileriEn>(); SqlConnection con = baglan.Baglanti(); using (SqlCommand com = new SqlCommand("Select Ad,Soyad,Sifre from Kullanici_tbl where Email=@email", con)) { com.Parameters.AddWithValue("@email", kullanici.Email); SqlDataAdapter dap = new SqlDataAdapter(com); SqlDataReader reader = com.ExecuteReader(); while (reader.Read()) { list.Add(new KullaniciBilgileriEn() { Ad = reader["Ad"].ToString(), Soyad = reader["Soyad"].ToString(), Sifre = reader["Sifre"].ToString() }); } } return(list); }
public void GetSifremiUnuttum([FromBody] string email) { var mail = new KullaniciBilgileriEn() { Email = email }; // var jsonString = JsonConvert.SerializeObject(mail); kullaniciLogin.GetSifremiUnuttumMailGonderBy(mail.Email); }
public HttpResponseMessage yeniKullaniciEkle(KullaniciBilgileriEn kullaniciBilgileri) { try { LoginBO yeniKullanici = new LoginBO(); yeniKullanici.GetKullaniciEkleBy(kullaniciBilgileri); return(Request.CreateResponse(HttpStatusCode.Created, "Yeni Kullanici Kaydı Oluşturuldu.")); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex)); } }
public void GetSifremiUnuttumMailGonderBy(string email) { //Yapılacaklar //1. kontrol email var mı ona bakılacak //2. varsa mail atılacak kişiye var kullanici = new KullaniciBilgileriEn() { Email = email, }; LoginDB login = new LoginDB(); if (login.GetSifremiUnuttumBy(kullanici.Email) == false) { MailSendTO ayarlar = new MailSendTO(); ayarlar.MailAyarlari(); MailMessage mailMessage = new MailMessage(); mailMessage.From = new MailAddress(kullanici.Email); mailMessage.To.Add(kullanici.Email); //TODO list deki degerleri nasıl alabilirim degişkenlerin yerine yazdım Bu mantık dogrumu? string ad = ""; string soyad = ""; string sifre = ""; foreach (var bilgi in login.GetKullaniciKaydiBilgileri(kullanici.Email)) { ad = bilgi.Ad; soyad = bilgi.Soyad; sifre = bilgi.Sifre; } string SifreOnay = Guid.NewGuid().ToString("N").Substring(0, 6); mailMessage.Subject = "Bitkimi Tanı'dan Kullanıcı Şifrenizi Hatırlatma"; mailMessage.Body = "Merhaba,<br/>Lütfen giriş bilgilerinizi kontrol ediniz.<br/> Kullanıcı Adınız:" + ad + "" + " " + " " + soyad + "<br/><br/>Şifreniz :" + SifreOnay + ""; //Veri tabanına kaydediyorum burda sifreyi login.MailSifreOnayKoduOlustur(SifreOnay, kullanici.Email); // throw new Exception("Mail Gönderme işlemi sırasında hata oluştu"); //Hata fırlatma işi dogru mu? Hata hata = new Hata(); var hataOlustu = hata.ToString();//Hatayı bu şekilde yakalama şansım nedir? varsa veri tabanına kaydetcem :)) } }
public void GetYeniKullaniciEkleBy(KullaniciBilgileriEn kullaniciEkle) { SqlConnection con = baglan.Baglanti(); using (SqlCommand com = new SqlCommand("sp_YeniKullaniciEkle", con)) { com.CommandType = CommandType.StoredProcedure; com.Parameters.AddWithValue("@Ad", kullaniciEkle.Ad); com.Parameters.AddWithValue("@Soyad", kullaniciEkle.Soyad); com.Parameters.AddWithValue("@CepTelefonu", kullaniciEkle.CepTelefonu); com.Parameters.AddWithValue("@Adres", kullaniciEkle.Adres); com.Parameters.AddWithValue("@Sehir", kullaniciEkle.Sehir); com.Parameters.AddWithValue("@onay", kullaniciEkle.Onay); com.Parameters.AddWithValue("@email", kullaniciEkle.Email); com.Parameters.AddWithValue("@sifre", kullaniciEkle.Sifre); com.ExecuteNonQuery(); } con.Close(); }
public string KullaniciBilgileriByEkle(KullaniciBilgileriEn bilgiler) { SqlConnection con = baglan.Baglanti(); using (SqlCommand com = new SqlCommand("sp_YeniKullaniciEkle", con)) { com.CommandType = CommandType.StoredProcedure; com.Parameters.AddWithValue("@Ad", bilgiler.Ad); com.Parameters.AddWithValue("@Soyad", bilgiler.Soyad); com.Parameters.AddWithValue("@CepTelefonu", bilgiler.CepTelefonu); com.Parameters.AddWithValue("@Adres", bilgiler.Adres); com.Parameters.AddWithValue("@Sehir", bilgiler.Sehir); com.Parameters.AddWithValue("@Email", bilgiler.Email); com.Parameters.AddWithValue("@Sifre", bilgiler.Sifre); com.Parameters.AddWithValue("@onay", bilgiler.Onay); int res1 = com.ExecuteNonQuery(); } return("Yeni Kullanıcı Kaydı Oluşturuldu."); }
public List <KullaniciBilgileriEn> GetKullaniciLoginIslemleriBy(string email, string sifre) { var kullanici = new KullaniciBilgileriEn() { Email = email, Sifre = sifre }; var list = new List <KullaniciBilgileriEn>(); if (!string.IsNullOrEmpty(kullanici.Email) && !string.IsNullOrEmpty(kullanici.Sifre)) { LoginDB login = new LoginDB(); list = login.KullaniciEmailVeSifre(kullanici.Email, kullanici.Sifre); HttpContext.Current.Response.Redirect("~/BitkiDetay.aspx"); } else { HttpContext.Current.Response.Redirect("~/Login.aspx"); } return(list); }
public bool GetSifremiGuncelle(int kullaniciID, string eskiSifre, string yeniSifre) { var sifreGun = new KullaniciBilgileriEn() { ID = kullaniciID, Sifre = yeniSifre }; if (sifreGun.ID != 0 || !string.IsNullOrEmpty(sifreGun.Sifre) || string.IsNullOrEmpty(yeniSifre)) { var kullanici = new KullaniciBilgileriEn() { ID = kullaniciID, Sifre = yeniSifre, SifreGuncellemeTarihi = DateTime.Now, CepTelefonuOnay = Guid.NewGuid().ToString("N").Substring(0, 6), //Cep Telefonu Onayı için 6 haneli sayı uretiyor }; //Todo Şifre Güncelle } return(false); }
public void GetKullaniciEkleBy(KullaniciBilgileriEn kullaniciBilgileri) { LoginDB login = new LoginDB(); login.GetYeniKullaniciEkleBy(kullaniciBilgileri); }
public HttpResponseMessage GetYeniKullaniciEkleBy([FromBody] KullaniciBilgileriEn kullaniciBilgileri) { //var kullaniciEkle = JsonConvert.SerializeObject(yeniUyeEkle); kullaniciLogin.GetKullaniciEkleBy(kullaniciBilgileri); return(Request.CreateResponse(HttpStatusCode.Created, "Yeni Üye Kaydınız Başarılı Bir Şekilde Oluşturuldu")); }