Пример #1
0
        private void SifreDegistir(BorsaKullanici user)
        {
            string sifreGirilen = txtSifreEski.Text;

            if (sifreGirilen.Equals(user.Sifre))
            {
                string sifreDegistir = txtSifreYeni.Text;
                string sifreTekrar   = txtSifreYeniTekrar.Text;

                if (sifreDegistir.Equals(sifreTekrar))
                {
                    var sonuc = HelperBorsaKullanici.ChangePassword(userLogin, sifreDegistir);
                    if (sonuc)
                    {
                        MessageBox.Show("Şifre Başarıyla Değiştirildi!!!", "Şifre Güncelleme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        txtSifreEski.Clear();
                        txtSifreYeni.Clear();
                        txtSifreYeniTekrar.Clear();
                        lblSifreTekrar.Visible = false;
                    }
                    else
                    {
                        MessageBox.Show("Güncelleme Hatası", "Database Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    lblSifreTekrar.Visible = true;
                }
            }
            else
            {
                MessageBox.Show("Hatalı Şifre Girişi Yaptınız!!!");
            }
        }
Пример #2
0
 private void BilgileriYukle(BorsaKullanici login)
 {
     txtKullaniciAdi.Text = login.KullaniciAdi;
     txtAd.Text           = login.Adi;
     txtSoyad.Text        = login.Soyadi;
     mTxtTelefon.Text     = login.Telefon;
     txtMail.Text         = login.Email;
     txtAdres.Text        = login.Adres;
 }
        private void KullaniciGuncelle()
        {
            bool durumVeri = string.IsNullOrEmpty(txtSifre.Text) ||
                             string.IsNullOrEmpty(txtAd.Text) ||
                             string.IsNullOrEmpty(txtSoyad.Text) ||
                             string.IsNullOrEmpty(txtTcKimlikNo.Text);


            if (durumVeri)
            {
                MessageBox.Show("Lütfen tüm bilgileri doldurun!", "Kayıt Hatası", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                bool durumTCKimlik = TcKimlikNoKontrol(txtTcKimlikNo.Text);
                if (durumTCKimlik)
                {
                    BorsaKullanici b = new BorsaKullanici()
                    {
                        KullaniciID  = user.KullaniciID,
                        Tur          = user.Tur,
                        KullaniciAdi = user.KullaniciAdi,
                        Sifre        = txtSifre.Text,
                        TcKimlikNo   = txtTcKimlikNo.Text,
                        Adi          = txtAd.Text.Trim().ToLower(),
                        Soyadi       = txtSoyad.Text.Trim().ToUpper(),
                        DogumTarihi  = dtpDogumTarihi.Value,
                        Telefon      = mTxtTelefon.Text,
                        Email        = txtMail.Text,
                        Adres        = txtAdres.Text,
                        isDeleted    = false,
                        KayitTarihi  = user.KayitTarihi
                    };

                    var durumKayit = HelperBorsaKullanici.CUD(b, EntityState.Modified);
                    if (durumKayit.Item1)
                    {
                        MessageBox.Show("Güncelleme Başarılı.");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Kayıt sırasında bir hata oluştu.");
                    }
                }
                else
                {
                    MessageBox.Show("Lütfen geçerli bir TC Kimlik No giriniz.", "Kimlik No Hatası", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
 public static (bool, BorsaKullanici) CUD(BorsaKullanici b, EntityState state)
 {
     using (BorsaEntities en = new BorsaEntities())
     {
         en.Entry(b).State = state;
         if (en.SaveChanges() > 0)
         {
             return(true, b);
         }
         else
         {
             return(false, null);
         }
     }
 }
 public static bool ChangePassword(BorsaKullanici b, string pass)
 {
     using (BorsaEntities en = new BorsaEntities())
     {
         en.Entry(b).State = EntityState.Modified;
         b.Sifre           = pass;
         if (en.SaveChanges() > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Пример #6
0
 private void Form1_Load(object sender, EventArgs e)
 {
     txtKullaniciAdi.Enabled = false;
     txtAd.Enabled           = false;
     txtSoyad.Enabled        = false;
     lblTarih.Text           = DateTime.Now.ToString();
     userLogin        = HelperBorsaKullanici.getRecordbyID(userID);
     lblUserName.Text = userLogin.KullaniciAdi;
     UserCheck(userID);
     BilgileriYukle(userLogin);
     ComboBoxDoldur();
     lblSifreTekrar.Visible = false;
     OnayKoduAl();
     rdbDoviz.Checked = true;
     MenkulDoldur();
     CuzdanGuncelle();
     timer1.Start();
 }
 public static bool IletisimBilgileriGuncelle(BorsaKullanici b, string tel, string mail, string adres)
 {
     using (BorsaEntities en = new BorsaEntities())
     {
         en.Entry(b).State = EntityState.Modified;
         b.Telefon         = tel;
         b.Email           = mail;
         b.Adres           = adres;
         if (en.SaveChanges() > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
 public FormKisiGuncelle(BorsaKullanici user)
 {
     InitializeComponent();
     this.user = user;
 }
Пример #9
0
        private void KullaniciKaydet()
        {
            bool durumKullanici = KullaniciAdiKontrol(txtKullaniciAdi.Text);
            bool durumVeri      = string.IsNullOrEmpty(txtKullaniciAdi.Text) ||
                                  string.IsNullOrEmpty(txtSifre.Text) ||
                                  string.IsNullOrEmpty(txtSifreTekrar.Text) ||
                                  string.IsNullOrEmpty(txtAd.Text) ||
                                  string.IsNullOrEmpty(txtSoyad.Text) ||
                                  string.IsNullOrEmpty(txtTcKimlikNo.Text) ||
                                  cmbTip.SelectedIndex == -1;


            if (durumVeri)
            {
                MessageBox.Show("Lütfen tüm bilgileri doldurun!", "Kayıt Hatası", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (durumKullanici)
                {
                    bool durumTCKimlik = TcKimlikNoKontrol(txtTcKimlikNo.Text);
                    if (durumTCKimlik)
                    {
                        BorsaKullanici b = new BorsaKullanici()
                        {
                            Tur          = cmbTip.SelectedIndex + 1,
                            KullaniciAdi = txtKullaniciAdi.Text,
                            Sifre        = txtSifre.Text,
                            TcKimlikNo   = txtTcKimlikNo.Text,
                            Adi          = txtAd.Text.Trim().ToLower(),
                            Soyadi       = txtSoyad.Text.Trim().ToUpper(),
                            DogumTarihi  = dtpDogumTarihi.Value,
                            Telefon      = mTxtTelefon.Text,
                            Email        = txtMail.Text,
                            Adres        = txtAdres.Text,
                            isDeleted    = false,
                            KayitTarihi  = DateTime.Now
                        };

                        var durumKayit = HelperBorsaKullanici.CUD(b, EntityState.Added);
                        if (durumKayit.Item1)
                        {
                            if (admin)
                            {
                                MessageBox.Show("Kullanıcı Kaydı Başarılı.");
                            }
                            else
                            {
                                MessageBox.Show("Kullanıcı Kaydı Başarılı. Ana Menuye Yönlendiriliyorsunuz...",
                                                "Kayıt Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                int      giris = HelperBorsaKullanici.getIDfromUser(txtKullaniciAdi.Text);
                                FormMenu fm    = new FormMenu(giris);
                                fm.Show();
                                this.Close();
                            }
                        }
                        else
                        {
                            MessageBox.Show("Kayıt sırasında bir hata oluştu.");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Lütfen geçerli bir TC Kimlik No giriniz.", "Kimlik No Hatası", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }