Ejemplo n.º 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!!!");
            }
        }
Ejemplo n.º 2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            int selectedID       = getSelectedID(dataKullanıcılar);
            var selectedUser     = HelperBorsaKullanici.getRecordbyID(selectedID);
            FormKisiGuncelle fkb = new FormKisiGuncelle(selectedUser);

            fkb.Show();
        }
        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);
                }
            }
        }
Ejemplo n.º 4
0
        private bool KullaniciAdiKontrol(string kullaniciAdi)
        {
            var durum = HelperBorsaKullanici.checkUserName(kullaniciAdi);

            if (durum)
            {
                lblInfo.Visible = true;
            }
            else
            {
                lblInfo.Visible = false;
            }
            return(!durum);
        }
Ejemplo n.º 5
0
        private void btnKisiDuzenle_Click(object sender, EventArgs e)
        {
            int selectedID = getSelectedID(dataKullanıcılar);

            if (selectedID != -1)
            {
                var selectedUser     = HelperBorsaKullanici.getRecordbyID(selectedID);
                FormKisiGuncelle fkb = new FormKisiGuncelle(selectedUser);
                fkb.Show();
            }
            else
            {
                MessageBox.Show("Seçim Yapmadınız..");
            }
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 7
0
        private void BtnBilgileriGuncelle_Click(object sender, EventArgs e)
        {
            string telefon = mTxtTelefon.Text;
            string mail    = txtMail.Text;
            string adres   = txtAdres.Text;

            var durumGuncel = HelperBorsaKullanici.IletisimBilgileriGuncelle(userLogin, telefon, mail, adres);

            if (durumGuncel)
            {
                BilgileriYukle(userLogin);
                MessageBox.Show("Bilgiler Başarıyla Güncellendi..");
            }
            else
            {
                MessageBox.Show("Güncelleme Hatası");
            }
        }
Ejemplo n.º 8
0
        private void KisileriYukle(bool deleted)
        {
            dataKullanıcılar.Rows.Clear();
            var kullaniciList = HelperBorsaKullanici.getAllRecords();

            foreach (var bk in kullaniciList)
            {
                if (bk.isDeleted == deleted)
                {
                    int satir = dataKullanıcılar.Rows.Add();
                    dataKullanıcılar.Rows[satir].Cells[0].Value = bk.KullaniciID;
                    dataKullanıcılar.Rows[satir].Cells[1].Value = (UserTur)bk.Tur;
                    dataKullanıcılar.Rows[satir].Cells[2].Value = bk.KullaniciAdi;
                    dataKullanıcılar.Rows[satir].Cells[3].Value = bk.Sifre;
                    dataKullanıcılar.Rows[satir].Cells[4].Value = bk.KayitTarihi;
                }
            }
        }
Ejemplo n.º 9
0
        private void btnGeriYukle_Click(object sender, EventArgs e)
        {
            int selectedID = getSelectedID(dataKullanıcılar);

            if (selectedID != -1)
            {
                int index = dataKullanıcılar.CurrentRow.Index;
                dataKullanıcılar.Rows.RemoveAt(index);
                var durum = HelperBorsaKullanici.UserDeleted(selectedID, false);
                if (durum)
                {
                    MessageBox.Show("Kullanıcı başarıyla aktif edildi..");
                }
                else
                {
                    MessageBox.Show("Aktif etme sırasında bir hata oluştu!!");
                }
            }
            else
            {
                MessageBox.Show("Seçim Yapmadınız..");
            }
        }
Ejemplo n.º 10
0
        private void BtnGiris_Click(object sender, EventArgs e)
        {
            string userName = txtKullaniciAdi.Text.ToLower().Trim();
            string userPass = txtSifre.Text.Trim();

            if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(userPass) && !userName.Equals("kullanıcı adı"))
            {
                var giris = HelperBorsaKullanici.checkUserLogin(userName, userPass);

                if (giris.Item1)
                {
                    if (giris.Item3)
                    {
                        MessageBox.Show("Bu kullanıcı pasif duruma geçmiştir.\n" +
                                        "Lütfen adminle iletişime geçiniz", "Kullanıcı Pasif Durumda", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        FormMenu fm = new FormMenu(giris.Item2);
                        fm.Show();
                        timerSayac.Start();
                        this.Hide();
                    }
                }
                else
                {
                    MessageBox.Show("Kullanıcı Adı veya Şifre Hatalı!!! Lütfen tekrar deneyiniz...",
                                    "Giriş Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Kullanıcı Adı veya Şifre boş bırakılamaz!!!",
                                "Giriş Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 11
0
        private void btnKisiSil_Click(object sender, EventArgs e)
        {
            int selectedID = getSelectedID(dataKullanıcılar);

            if (selectedID != -1)
            {
                int index = dataKullanıcılar.CurrentRow.Index;
                dataKullanıcılar.Rows.RemoveAt(index);
                var durum = HelperBorsaKullanici.UserDeleted(selectedID, true);
                HelperBorsaKullaniciIslem.IslemDeleted(selectedID, true);
                if (durum)
                {
                    MessageBox.Show("Kullanıcı başarıyla silindi..");
                }
                else
                {
                    MessageBox.Show("Silme sırasında bir hata oluştu!!");
                }
            }
            else
            {
                MessageBox.Show("Seçim Yapmadınız..");
            }
        }
Ejemplo n.º 12
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);
                    }
                }
            }
        }