Exemple #1
0
        private void button6_Click(object sender, EventArgs e)
        {
            //iniciar connecçao
            String        connectKey = "Data Source=DESKTOP-2V1JTH4;Initial Catalog=RestauranteMaravilha;Integrated Security=True";
            SqlConnection connection = new SqlConnection(connectKey);


            //cria comando para a base de dados
            SqlCommand command = new SqlCommand("dbo.novoPedido", connection);

            command.CommandType = CommandType.StoredProcedure;

            //parametros
            command.Parameters.AddWithValue("@MID", mesaNum);
            command.Parameters.AddWithValue("@func", nomeFunc.Text);

            connection.Open();
            command.ExecuteNonQuery();

            connection.Close();

            //fecha e janela e abre selecao de mesas
            Mesas mesa = new Mesas();

            mesa.Show();
            this.Close();
        }
Exemple #2
0
        private void cancelarPedido_Click(object sender, EventArgs e)
        {
            //fecha e janela e abre selecao de mesas
            Mesas mesa = new Mesas();

            mesa.Show();
            this.Close();
        }