private void emitirBoleta_Click(object sender, EventArgs e)
        {
            emitirBoleta eB = new emitirBoleta();

            this.Hide();
            eB.Show();
        }
Exemplo n.º 2
0
        private void cobrarBoleta_Click(object sender, EventArgs e)
        {
            BD.cnn.Open();
            BD.cnn2.Open();
            SqlCommand     command;
            SqlDataAdapter adapter = new SqlDataAdapter();

            String sql;

            sql     = "update pedido set estado = 1 where id = " + idPedido;
            command = new SqlCommand(sql, BD.cnn);
            adapter.UpdateCommand = new SqlCommand(sql, BD.cnn);
            adapter.UpdateCommand.ExecuteNonQuery();
            command.Dispose();
            MessageBox.Show("Cobro registrado correctamente");


            sql     = "insert into boleta values (" + "GETDATE()" + "," + idPedido + "," + costototal.ToString() + ")";
            command = new SqlCommand(sql, BD.cnn);
            adapter.InsertCommand = new SqlCommand(sql, BD.cnn);
            adapter.InsertCommand.ExecuteNonQuery();


            BD.cnn.Close();
            BD.cnn2.Close();
            this.Hide();
            emitirBoleta eB = new emitirBoleta();

            eB.Show();
        }