Exemplo n.º 1
0
        private void btncikis_Click(object sender, EventArgs e)
        {
            AnaMenu anm = (AnaMenu)Application.OpenForms["AnaMenu"];

            anm.Listele();
            this.Close();
        }
Exemplo n.º 2
0
        private void KayitEkle_FormClosed(object sender, FormClosedEventArgs e)
        {
            AnaMenu anm = (AnaMenu)Application.OpenForms["AnaMenu"];

            anm.Listele();
            this.Close();
        }
Exemplo n.º 3
0
        private void btngiris_Click(object sender, EventArgs e)
        {
            SqlConnection baglanti = new SqlConnection(@"Server=DESKTOP-I3MGUM0;Initial Catalog=CezaeviKayit;Integrated Security=True;");

            if (baglanti.State != ConnectionState.Open)
            {
                baglanti.Open();
            }

            string     query = "SELECT Sifre FROM dbo.Hesaplar WHERE KullaniciAdi=@KullaniciAdi";
            SqlCommand komut = new SqlCommand(query, baglanti);

            komut.Parameters.AddWithValue("@KullaniciAdi", textBox1.Text);
            SqlDataReader ok = komut.ExecuteReader();

            if (ok.Read())
            {
                string sifre = ok["Sifre"].ToString();
                if (sifre == EncodePasswordToBase64(textBox2.Text))
                {
                    AnaMenu anaMenu = new AnaMenu();
                    anaMenu.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Hatalı şifre veya kullanıcı adı !", "Hatalı Giriş", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
            }
            else
            {
                MessageBox.Show("Hatalı şifre veya kullanıcı adı !", "Hatalı Giriş", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }

            baglanti.Close();
        }