private void button_ksddön_Click(object sender, EventArgs e)
        {
            adminyetkileri adm = new adminyetkileri();

            adm.Show();
            this.Close();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            adminyetkileri ay = new adminyetkileri();

            ay.Show();
            this.Close();
        }
Esempio n. 3
0
        private void button_fgiris_Click(object sender, EventArgs e)
        {
            /*if (String.IsNullOrWhiteSpace(textBox1.Text) ||
             * String.IsNullOrWhiteSpace(txtSifre.Text))
             * {
             *  MessageBox.Show("Giriş Başarısız! Eksiksiz Giriniz!", "HATA",
             *  MessageBoxButtons.OK, MessageBoxIcon.Warning);
             * } */

            SqlConnection cnn = new SqlConnection();

            cnn.ConnectionString = @"Server=.\SQLEXPRESS; Database=veritabani;Trusted_Connection=true;";
            cnn.Open();
            DataSet ds = new DataSet();

            //-- Kullanıcı Adına göre şifreyi alıyoruz..
            SqlDataAdapter sda = new SqlDataAdapter("select * from ekleKullanici where kullaniciAd = '" + textBox1.Text + "'", cnn);

            sda.Fill(ds);

            if (ds.Tables.Count == 0)
            {
                MessageBox.Show("Geçersiz Kullanıcı.", "oto_kiralama", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (textBox1.Text == "")
            {
                MessageBox.Show("Kullanıcı adı boş bırakılamaz!");
            }
            if (textBox2.Text == "")
            {
                MessageBox.Show("Lütfen şifrenizi giriniz!");
            }


            kullaniciAd = ds.Tables[0].Rows[0][1].ToString();
            kullaniciNo = (int)ds.Tables[0].Rows[0][0];
            yetkiTuru   = ds.Tables[0].Rows[0][3].ToString();
            string sifre = ds.Tables[0].Rows[0][2].ToString();

            kullaniciSifre = sifre;

            //-- Karşılaştırma yapılıyor...
            if (sifre == textBox2.Text)
            {
                if (yetkiTuru == "Admin")
                {
                    adminyetkileri ac = new adminyetkileri();
                    ac.Show();
                    this.Visible = false;
                }
                else if (yetkiTuru == "Kullanici")
                {
                    Kullanici_yetkileri kullanici = new Kullanici_yetkileri();
                    kullanici.Show();
                }
                else if (yetkiTuru == "Müşteri")
                {
                    Müşteri_Anasayfa musteri = new Müşteri_Anasayfa();
                    musteri.Show();
                }
                else
                {
                    MessageBox.Show("Geçersiz Giriş Yaptınız", "oto_kiralama", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }