private void btnGerar_Click(object sender, EventArgs e) { String comprador = txtClienteOrcamento.Text.Trim(); String vendedor = txtVendedor.Text.Trim(); int desconto = Convert.ToInt32(txtDescontoOrcamento.Text.Trim()); int valorItens = Convert.ToInt32(txtValorItensOrcamento.Text.Trim()); int frete = Convert.ToInt32(txtFreteOrcamento.Text.Trim()); int valorTotal = Convert.ToInt32(txtTotalOrcamento.Text.Trim()); string Config = "server=127.0.0.1;userid=root;database=bd_commanager"; MySqlConnection conex = new MySqlConnection(Config); conex.Open(); MySqlCommand Query = new MySqlCommand("UPDATE orcamentos SET Cliente='" + comprador + "', Vendedor='" + vendedor + "', Desconto=" + desconto + ", ValorItens=" + valorItens + ", ValorFrete=" + frete + ", ValorTotal=" + valorTotal + " WHERE Id=" + ClassInfo.IdVendaGlobal + ";", conex); Query.ExecuteNonQuery(); Query.Connection = conex; if (conex.State == ConnectionState.Open) { MessageBox.Show("Alterado com sucesso!"); this.Close(); ConsultarOrcamento sub = new ConsultarOrcamento(); sub.Show(); } else { MessageBox.Show("Erro ao alterar!"); } conex.Close(); }
private void btSair_Click(object sender, EventArgs e) { this.Close(); ConsultarOrcamento cons = new ConsultarOrcamento(); cons.Show(); }
private void button4_Click(object sender, EventArgs e) { ConsultarOrcamento cons = new ConsultarOrcamento(); cons.Show(); this.Close(); }