Exemplo n.º 1
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            KullaniciBL kbl = new KullaniciBL();

            foreach (DataRow item in dt.Rows)
            {
                Kullanici y = new Kullanici();
                if (item.RowState != DataRowState.Deleted)
                {
                    y.KullaniciAdi = item[1].ToString();
                }
                switch (item.RowState)
                {
                case DataRowState.Added:
                    kbl.Ekle(y);
                    break;

                case DataRowState.Deleted:
                    kbl.Sil(Convert.ToInt32(item[0, DataRowVersion.Original]));
                    break;

                case DataRowState.Modified:
                    y.KullaniciID = Convert.ToInt32(item[0]);
                    kbl.Guncelle(y);
                    break;

                default:
                    break;
                }
            }
        }
Exemplo n.º 2
0
        private void btnGiris_Click(object sender, EventArgs e)
        {
            Kullanici   kullan = new Kullanici();
            KullaniciBL kbl    = new KullaniciBL();

            kullan.KullaniciAdi = this.txtKullaniciAdi.Text.Trim();
            kullan.Sifre        = this.txtSifre.Text.Trim();
            kullan = kbl.Giris(kullan);
            switch (kullan.YetkiID)
            {
            case 1:
                frmIslem frmIslem = new frmIslem();
                frmIslem.groupBox2.Visible = true;
                frmIslem.Show();
                this.Hide();

                break;

            case 2:
                new frmIslem().Show();
                this.Hide();
                break;

            case 3:
                new frmIslem().Show();
                this.Hide();
                break;
            }
        }
Exemplo n.º 3
0
        private void btnGiris_Click(object sender, EventArgs e)
        {
            try
            {
                Kullanici   kl   = new Kullanici();
                KullaniciBL klbl = new KullaniciBL();
                kl.KullaniciAdi = txtKullanici.Text.Trim();
                kl.Sifre        = txtSifre.Text.Trim();
                SqlDataReader dr = klbl.Giris(kl);
                if (dr.Read())
                {
                    txtKullanici.Clear();
                    txtSifre.Clear();
                    frmMain frm = (frmMain)Application.OpenForms["frmMain"];
                    MessageBox.Show($"Hoşgeldiniz {kl.KullaniciAdi}");
                    frm.menuMain.Items["menuResepsiyon"].Visible     = true;
                    frm.menuDosya.DropDownItems["menuCikis"].Visible = true;
                    switch (dr["YetkiID"])
                    {
                    case (1):
                        frm.YetkiID = 1;
                        frm.menuMain.Items["menuYonetim"].Visible = true;
                        break;

                    case (2):
                        frm.YetkiID = 2;
                        break;
                    }
                    frm.menuGiris.Visible = false;
                    this.Dispose();
                }
                else
                {
                    txtKullanici.Clear();
                    txtSifre.Clear();
                    MessageBox.Show("Kullanıcı Bulunamadı!");
                }
            }
            catch (SqlException ex)
            {
                switch (ex.Number)
                {
                case (2):
                    MessageBox.Show("Veritabanına Bağlanamıyor. Lütfen internet bağlantınızı kontrol ediniz.\n\n Bağlantınız ile ilgi yapabilecekleriniz: \n 1. Uzak sunucu bağlantı ayarlarınızı kontrol ediniz.\n 2. Uzak sunucuyu tekrar başlatınız.\n\nEğer bağantınız düzelmedi ise lütfen destek hattımıza başvurunuz. ");
                    break;

                default:
                    MessageBox.Show("Bağlantı Hatası! Hata Kodu: " + ex.Number + "\n\n" + ex.Message);
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Bilinmeyen Bir Hata Oluştu!\n\n" + ex.Message);
            }
        }
Exemplo n.º 4
0
        private void frmKullanici_Load(object sender, EventArgs e)
        {
            gridKullanici.AutoGenerateColumns = false;
            KullaniciBL kbl = new KullaniciBL();

            dt = kbl.KullaniciTablosu();
            gridKullanici.DataSource = dt;
            clmYetki.ValueMember     = "YetkiID";
            clmYetki.DisplayMember   = "YetkiAd";
            clmYetki.DataSource      = kbl.YetkiGetir();
        }
Exemplo n.º 5
0
 private void btnKSil_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Hesap Silme İşlemini Onaylıyor Musunuz?", "İşlem Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         KullaniciBL kullaniciBL = new KullaniciBL();
         if (kullaniciBL.KullaniciSil(this.kullaniciId))
         {
             MessageBox.Show("Hesabınız Silindi", "İşlem Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.Close();
         }
     }
     else
     {
         MessageBox.Show("İşlem İptal Edildi", "İşlem İptal", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 6
0
        private void btnGiris_Click(object sender, EventArgs e)
        {
            KullaniciBL bl = new KullaniciBL();

            Kullanici = bl.KullaniciDogrula(txtKulAdi.Text.Trim(), txtSifre.Text.Trim());
            if (Kullanici != null)
            {
                KMainMenu kmainmenu = new KMainMenu();
                kmainmenu.Text = "Hoşgeldin" + " " + Kullanici.KullaniciAdi;
                this.Hide();
                kmainmenu.ShowDialog();
            }
            else
            {
                MessageBox.Show("Kullanici Adi yada Sifre Hatali");
            }
        }
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            KullaniciBL kulbl = new KullaniciBL();

            Kullanici kul = new Kullanici();

            kul.Ad           = txtKulAdi.Text.Trim();
            kul.Soyad        = txtKullaniciSoyadi.Text.Trim();
            kul.KullaniciAdi = txtKullaniciAdi.Text.Trim();
            kul.Sifre        = txtSif.Text.Trim();

            if (kulbl.Guncelle(kul))
            {
                MessageBox.Show("Güncelleme başarılı");
                this.Close();
            }
        }
Exemplo n.º 8
0
        private void btnKayit_Click(object sender, EventArgs e)
        {
            kullaniciBL = new KullaniciBL();
            kullanici   = new Kullanici();

            kullanici.KullaniciAd = txtAd.Text.Trim();
            kullanici.Sifre       = txtSifre.Text.Trim();

            if (kullaniciBL.KullaniciVarMi(txtAd.Text.Trim()))
            {
                if (kullaniciBL.KullaniciEkle(kullanici))
                {
                    MessageBox.Show("Kayıt Başarılı", "Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Aynı isimde kullanıcı var!!!", "Başarısız", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            KullaniciBL kbl = new KullaniciBL();
            Kullanici   kul = new Kullanici();

            kul.Ad           = txtKullaniciAd.Text.Trim();
            kul.Soyad        = txtSoyad.Text.Trim();
            kul.KullaniciAdi = txtKullaniciAdi.Text.Trim();
            kul.Sifre        = txtSifre.Text.Trim();
            if (BosKontrol() == true)
            {
                kbl.Ekle(kul);
                MessageBox.Show("Kayıt işlemi basarılı!");

                SayfayiYenile();
            }
            else if (BosKontrol() == false)
            {
            }
        }
Exemplo n.º 10
0
        private void btnGiris_Click(object sender, EventArgs e)
        {
            kullaniciBL = new KullaniciBL();
            kullanici   = new Kullanici();

            kullanici.KullaniciAd = txtAd.Text.Trim();
            kullanici.Sifre       = txtSifre.Text.Trim();

            if (kullaniciBL.GirisKontrol(kullanici).Count != 0)
            {
                txtAd.Text    = String.Empty;
                txtSifre.Text = String.Empty;

                this.Hide();
                MainForm mf = new MainForm(kullaniciBL.GirisKontrol(kullanici)[0].KullaniciId);
                mf.Show();
            }
            else
            {
                MessageBox.Show("Kullanıcı Adı Veya Şifre Hatalı!!", "Başarısız", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 11
0
        private void btnKGüncelle_Click(object sender, EventArgs e)
        {
            if (EksikVarMiKullanici())
            {
                MessageBox.Show("Lütfen Bilgileri Boş Bırakmayınız.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (MessageBox.Show("Güncelle İşlemini Onaylıyor Musunuz?", "İşlem Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                KullaniciBL kullaniciBL = new KullaniciBL();

                if (kullaniciBL.KullaniciVarMiGuncelle(txtKullaniciAdi.Text, this.kullaniciId))
                {
                    Kullanici kullanici = new Kullanici();

                    kullanici.KullaniciAd = txtKullaniciAdi.Text.Trim();
                    kullanici.Sifre       = txtKullaniciSifre.Text.Trim();
                    kullanici.KullaniciId = this.kullaniciId;

                    if (kullaniciBL.KullaniciGuncelle(kullanici))
                    {
                        MessageBox.Show("Hesabınız Güncellendi Yeniden Giriş Yapın", "İşlem Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("Aynı isimde kullanıcı var!!!", "Başarısız", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("İşlem İptal Edildi", "İşlem İptal", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }