Beispiel #1
0
        private void btnAnasayfa_Click(object sender, EventArgs e)
        {
            frmAnaSayfa fr = new frmAnaSayfa();

            fr.Show();
            this.Hide();
        }
Beispiel #2
0
        private void btnGirisYap_Click(object sender, EventArgs e)
        {
            try
            {
                baglanti.Open();
                string       sql     = "Select * from AdminGiris where Kullanici=@Kullaniciadi and Sifre=@Sifresi";
                SqlParameter prm1    = new SqlParameter("Kullaniciadi", txtKullaniciAdi.Text);
                SqlParameter prm2    = new SqlParameter("Sifresi", txtSifre.Text);
                SqlCommand   command = new SqlCommand(sql, baglanti);
                command.Parameters.Add(prm1);
                command.Parameters.Add(prm2);

                DataTable      dt = new DataTable();
                SqlDataAdapter da = new SqlDataAdapter(command);
                da.Fill(dt);

                if (dt.Rows.Count > 0)
                {
                    frmAnaSayfa frm = new frmAnaSayfa();
                    frm.Show();
                    frm.Hide();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Hatalı Giriş");
            }
        }