Exemplo n.º 1
0
        private void KayitTipiDoldur()
        {
            SqlConnection conn = DbConncection.GetSqlConnection();

            var cmd = new SqlCommand();

            cmd.CommandText = "SELECT KullaniciTipiId,Aciklama FROM Ahmet_KullaniciTipi";
            cmd.Connection  = conn;
            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                KullaniciTipi kullanicitipi = new KullaniciTipi();
                {
                    kullanicitipi.KullaniciTipiId = reader.GetInt32(0);
                    kullanicitipi.Aciklama        = reader.GetString(1);
                }

                cmbKayıtTipi.Items.Add(kullanicitipi);
            }

            conn.Close();
            cmbKayıtTipi.SelectedIndex = 0;
        }
Exemplo n.º 2
0
        public void btnGiris_Click(object sender, EventArgs e)
        {
            kullaniciAdi = txtKullaniciAdi.Text;
            string kullaniciSifre = txtSifre.Text;
            var    KullaniciSorgu = new Kisisel();

            KullaniciTipi secilenKullaniciTipi   = (KullaniciTipi)cmbKullaniciTipi.SelectedItem;
            int           secilenKullaniciTipiId = secilenKullaniciTipi.KullaniciTipiId;

            int gelensorgusonucu = Kisisel.KullaniciSorgula(kullaniciAdi, kullaniciSifre, secilenKullaniciTipiId);

            if (gelensorgusonucu == 1)
            {
                ogrenci.Show();
                this.Hide();
            }

            else if (gelensorgusonucu == 2)
            {
                ogretmen.Show();
                this.Hide();
            }

            else if (gelensorgusonucu == 3)
            {
                veli.Show();
                this.Hide();
            }

            else if (gelensorgusonucu == 4)
            {
                memur.Show();
                this.Hide();
            }

            else
            {
                MessageBox.Show("Geçersiz Kullanıcı Adı, Şifre ve Kullanıcı Tipi Kombinasyonu");
            }
        }