public void AlterStausVendaDetalhada(DividaDetalhada divida) { SqlConnection con = new SqlConnection(conexao.StrConexao()); SqlCommand cmd = new SqlCommand("p_ALTERANDO_VALORES_VD_DETALHADA", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@VALOR_PAGO", divida.ValorPago); cmd.Parameters.AddWithValue("@ID", divida.Id); con.Open(); cmd.ExecuteNonQuery(); con.Close(); }
private void btnConfirmar_Click(object sender, EventArgs e) { try { daoCliente.PagCliente(id, Decimal.Parse(txtValor.Text)); DividaDetalhada divida = new DividaDetalhada(id, txtValor.Text); dividaDetalhada.AlterStausVendaDetalhada(divida); MessageBox.Show("Pagamento confirmado!"); this.Close(); } catch (Exception ex) { MessageBox.Show("Erro!!! " + ex); } }