コード例 #1
0
        private void Siparis_Click(object sender, EventArgs e)
        {
            this.Hide();
            Siparis sipariş = new Siparis();

            sipariş.StartPosition = FormStartPosition.CenterScreen;
            sipariş.Show();
        }
コード例 #2
0
        private void M1_Click(object sender, EventArgs e)
        {
            Button  btn     = (Button)sender;
            Siparis siparis = new Siparis();
            string  number  = btn.Text.Substring(5);

            siparis.label6.Text = number;
            siparis.label7.Text = "aç";
            this.Hide();
            siparis.ShowDialog();
        }
コード例 #3
0
        private void Save_Click(object sender, EventArgs e)
        {
            connection.Open();
            if (label6.Text != "")
            {
                int table_NO = Convert.ToInt32(label6.Text);
                foreach (var x in drink)
                {
                    command = new SqlCommand("insert into sold values(@id,NULL,@price,@date,@table,1)", connection);
                    command.Parameters.AddWithValue("@id", x.Id);
                    command.Parameters.AddWithValue("@price", x.price);
                    command.Parameters.AddWithValue("@date", DateTime.Now);
                    command.Parameters.AddWithValue("@table", table_NO);
                    command.ExecuteNonQuery();
                }
                foreach (var x in food)
                {
                    command = new SqlCommand("insert into sold values(NULL,@id,@price,@date,@table,NULL)", connection);
                    command.Parameters.AddWithValue("@id", x.Id);
                    command.Parameters.AddWithValue("@price", x.price);
                    command.Parameters.AddWithValue("@date", DateTime.Now);
                    command.Parameters.AddWithValue("@table", table_NO);
                    command.ExecuteNonQuery();
                    connection.Close();
                }
            }
            Choosen_list.Items.Clear();
            Sum.Text = "";
            Drink_list.Items.Clear();
            Food_list.Items.Clear();
            label7.Text = "";
            Isopen();
            Siparis siparis = new Siparis();

            this.Hide();
            siparis.ShowDialog();
        }