Exemplo n.º 1
0
        private void btnGiris_Click(object sender, EventArgs e)
        {
            string userName = txtKullaniciAdi.Text;
            string password = txtSifre.Text;

            con = new SqlConnection("Data Source=DESKTOP-4UMSCIK;Initial Catalog=kullanici;Integrated Security=True");
            cmd = new SqlCommand();
            con.Open();
            cmd.Connection  = con;
            cmd.CommandText = "SELECT * FROM kullanici where kullaniciadi = '" + txtKullaniciAdi.Text + "' AND sifre='" + txtSifre.Text.ToString() + "'";
            dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                AnaSayfa Asayfa = new AnaSayfa();
                Asayfa.Show();
                this.Hide();
            }
            else if ("admin" == txtKullaniciAdi.Text && "admin" == txtSifre.Text)
            {
                FormAdminOnay admin = new FormAdminOnay();
                admin.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Yalnış Kullanici Adi veya Sifre!");
            }
            con.Close();

            gidenbilgi = txtKullaniciAdi.Text;
        }
Exemplo n.º 2
0
        private void btnOnay_Click(object sender, EventArgs e)
        {
            FormAdminOnay adminPage = new FormAdminOnay();

            adminPage.Show();
        }