private void btnEfetuarPagamento_Click(object sender, EventArgs e) { DataGridViewRow linhaAtual = dataGridView1.CurrentRow; int i = linhaAtual.Index; FormPgtoDebito frmPg = new FormPgtoDebito(); frmPg.MdiParent = this.ParentForm; frmPg.txtNumParcelaAtual.Text = Convert.ToString(dataGridView1.Rows[i].Cells["idparcela"].Value); frmPg.txtNumVendaAtual.Text = Convert.ToString(dataGridView1.Rows[i].Cells["idvenda"].Value); frmPg.txtValorAtual.Text = Convert.ToString(dataGridView1.Rows[i].Cells["valor"].Value); frmPg.txtTotal.Text = Convert.ToString(dataGridView1.Rows[i].Cells["total"].Value); frmPg.txtJuros.Text = Convert.ToString(dataGridView1.Rows[i].Cells["juros"].Value); frmPg.dtVencimentoAtual.Value = Convert.ToDateTime(dataGridView1.Rows[i].Cells["dtvencimento"].Value); frmPg.idCliente = Convert.ToInt32(dataGridView1.Rows[i].Cells["id_cliente"].Value); frmPg.usuario = usuario; frmPg.Show(); this.Dispose(); }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { } else { FormPgtoDebito frmPg = new FormPgtoDebito(); frmPg.MdiParent = this.ParentForm; frmPg.txtNumParcelaAtual.Text = Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["idparcela"].Value); frmPg.txtNumVendaAtual.Text = Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["idvenda"].Value); frmPg.txtValorAtual.Text = Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["valor"].Value); frmPg.txtJuros.Text = Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["juros"].Value); frmPg.txtTotal.Text = Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["total"].Value); frmPg.dtVencimentoAtual.Value = Convert.ToDateTime(dataGridView1.Rows[e.RowIndex].Cells["dtvencimento"].Value); frmPg.idCliente = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["id_cliente"].Value); frmPg.usuario = usuario; frmPg.Show(); this.Dispose(); } }