private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "") { MessageBox.Show("Kullanıcı Adı ve Şifre Alanlarını Boş Bırakamazsınız."); return; } SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=G:\KafeOtomasyonu\KafeOtomasyonu\KafeOtomasyonu\Kafe.mdf;Integrated Security=True"); con.Open(); MessageBox.Show("Connection Successful"); SqlCommand cmd = new SqlCommand("SELECT * FROM [User] Where UserName = '******' and Password = '******'", con); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { MessageBox.Show("Kullanıcı Adı Ve Şifre Doğru"); this.Hide(); FrmMasa masa = new FrmMasa(); masa.ShowDialog(); } else { MessageBox.Show("Kullanıcı Adı Ve Şifre Yanlış"); } con.Close(); }
private void button28_Click(object sender, EventArgs e) { button28.BackColor = Color.Red; FrmMasa masa = new FrmMasa(); masa.Hide(); FrmUrunler urun = new FrmUrunler(); urun.ShowDialog(); }