Beispiel #1
0
        private void araEkranToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            AraEkran ara = new AraEkran("", ad, k_id);

            ara.Show();
            ara.StartPosition = FormStartPosition.CenterScreen;
        }
Beispiel #2
0
        void giris()
        {
            try
            {
                using (OleDbConnection baglanti = new OleDbConnection(vt.connection))
                {
                    OleDbCommand cm = new OleDbCommand("select * from kullanici where kullanici_ad = @ad and kullanici_sifre = @sifre", baglanti);
                    cm.Parameters.AddWithValue("@ad", txt_kullanici.Text);
                    cm.Parameters.AddWithValue("@sifre", txt_sifre.Text);
                    DataTable        dt = new DataTable();
                    OleDbDataAdapter da = new OleDbDataAdapter(cm);
                    da.Fill(dt);
                    if (dt.Rows[0]["durum"].ToString() == "1")
                    {
                        if (dt.Rows[0]["yetki"].ToString() == "0")
                        {
                            permission = "0";
                        }
                        else if (dt.Rows[0]["yetki"].ToString() == "1")
                        {
                            permission = "1";
                        }
                        else
                        {
                            permission = "2";
                        }
                        kullanici = dt.Rows[0]["kullanici_ad"].ToString();
                        id        = dt.Rows[0]["kullanici_id"].ToString();


                        AraEkran ara = new AraEkran(permission, kullanici, id);
                        ara.Show();


                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Hesabınız yasaklılar listesindedir.Giriş yetkiniz yok.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Kullanıcı adı yada şifre hatalı.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }