private void button3_Click(object sender, EventArgs e)
        {
            FrmUrunler frm = new FrmUrunler();

            frm.ShowDialog();
            this.Hide();
        }
        //Ekleme
        private void button4_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\CASPER\Desktop\KafeOtomasyonu\KafeOtomasyonu\KafeOtomasyonu\Kafe.mdf;Integrated Security=True");

            con.Open();
            try
            {
                MessageBox.Show(comboBox1.SelectedIndex.ToString());
                MessageBox.Show(comboBox1.SelectedValue.ToString());
                DataSet ds = new DataSet();
                ds.Clear();
                SqlCommand komut = new SqlCommand("INSERT INTO Product(Name, Price, ProductGroupId, PicturePath) VALUES ('" + textBox1.Text + "','" + Convert.ToDecimal(textBox2.Text) + "','" + (int)comboBox1.SelectedValue + "','" + textBox4.Text + "')", con);
                komut.ExecuteNonQuery();
                con.Close();
                MessageBox.Show("Urun basarılı bir sekilde eklendi");
                kayitGetir();
                this.Hide();
                FrmUrunler frm = new FrmUrunler();
                frm.ShowDialog();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                con.Close();
            }
            //DataTable tablo = new DataTable();
            //tablo.Rows.Add(textBox1.Text, Convert.ToDecimal(textBox2.Text), comboBox1.SelectedIndex, textBox4.Text);
            //dataGridView1.DataSource = tablo;
        }
Exemple #3
0
        private void button9_Click(object sender, EventArgs e)
        {
            button9.BackColor = Color.Red;
            this.Hide();
            FrmUrunler urun = new FrmUrunler();

            urun.ShowDialog();
        }
Exemple #4
0
        private void button28_Click(object sender, EventArgs e)
        {
            button28.BackColor = Color.Red;
            FrmMasa masa = new FrmMasa();

            masa.Hide();
            FrmUrunler urun = new FrmUrunler();

            urun.ShowDialog();
        }
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox4.Text != textBox5.Text)
     {
         MessageBox.Show("Şifreler Eşleşmiyor");
     }
     else
     {
         SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\CASPER\Desktop\KafeOtomasyonu\KafeOtomasyonu\KafeOtomasyonu\Kafe.mdf;Integrated Security=True;");
         con.Open();
         MessageBox.Show("Connection Succesfull");
         SqlCommand cmd = new SqlCommand("Insert Into [User] (UserName, Password, Name, Surname) VALUES('" + textBox3.Text + "' , '" + textBox4.Text + "' , '" + textBox1.Text + "','" + textBox2.Text + "')  ", con);
         cmd.ExecuteNonQuery();
         con.Close();
         MessageBox.Show("Kullanıcı Başarılı Bir Şekilde Eklendi.");
         FrmUrunler frm = new FrmUrunler();
         frm.ShowDialog();
         this.Hide();
     }
 }