Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            OgrGorPaneli op = new OgrGorPaneli();

            op.Show();
            this.Hide();
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox3.Text == "" && textBox4.Text == "")
            {
                MessageBox.Show("Lütfen e posta adresinizi ve şifrenizi giriniz.");
            }
            else if (textBox3.Text == "")
            {
                MessageBox.Show("Lütfen e posta adresinizi giriniz.");
            }
            else if (textBox4.Text == "")
            {
                MessageBox.Show("Lütfen şifrenizi giriniz.");
            }
            else
            {
                try
                {
                    MySqlConnection connection = new MySqlConnection("datasource=localhost;port=3306;username=root;password="******"select * from ders_kayit_sistemi.ogrgor where ogrgor_eposta='" + textBox3.Text + "' and ogrgor_sifre='" + textBox4.Text + "'";
                    cmd.ExecuteNonQuery();
                    DataTable dt = new DataTable();
                    MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
                    adapter.Fill(dt);
                    i = int.Parse(dt.Rows.Count.ToString());

                    if (i == 0)
                    {
                        MessageBox.Show("E posta adresi ya da şifre geçersizdir.");
                    }
                    else
                    {
                        ogrgor_eposta = textBox3.Text;
                        OgrGorPaneli op = new OgrGorPaneli();
                        op.Show();
                        this.Hide();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Bir hata ile karşılaşıldı: \n" + ex.Message);
                }
            }
        }