private void muestraPagosToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRow Row = dgvCobros.SelectedRows[0]; venta.CodFacturaVenta = Row.Cells[codnota.Name].Value.ToString(); frmMuestraPagos2 form = new frmMuestraPagos2(); form.CodNota = Convert.ToInt32(venta.CodFacturaVenta); form.InOut = true; form.ShowDialog(); CargaLista(); }
private void dgvCobros_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (dgvCobros.Rows.Count >= 1 && e.RowIndex != -1) { DataGridViewCell celda = dgvCobros.Rows[e.RowIndex].Cells[e.ColumnIndex]; Int32 itipo = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[tipo.Name].Value); if (celda.Value.ToString() == "Ingresar Pago") { if (itipo == 3) { venta.CodFacturaVenta = dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value.ToString(); frmCancelarPago form = new frmCancelarPago(); form.CodNota = venta.CodFacturaVenta; form.tipo = itipo; DialogResult dlgResult = form.ShowDialog(); if (dlgResult == DialogResult.Yes) { CargaLista(); } } else if (itipo == 4) { let.CodLetra = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value); frmCancelarPago form = new frmCancelarPago(); form.CodLetra = let.CodLetra; form.tipo = itipo; DialogResult dlgResult = form.ShowDialog(); if (dlgResult == DialogResult.Yes) { CargaLista(); } } } else if (celda.Value.ToString() == "Muestra Pagos") { if (itipo == 3) { venta.CodFacturaVenta = dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value.ToString(); frmMuestraPagos2 form = new frmMuestraPagos2(); form.CodNota = Convert.ToInt32(venta.CodFacturaVenta); form.InOut = true; form.tipo = 0; DialogResult dlgResult = form.ShowDialog(); if (dlgResult == DialogResult.Yes) { CargaLista(); } } else if (itipo == 4) { let.CodLetra = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value); frmMuestraPagos2 form = new frmMuestraPagos2(); form.CodNota = let.CodLetra; form.InOut = true; form.tipo = 1; DialogResult dlgResult = form.ShowDialog(); if (dlgResult == DialogResult.Yes) { CargaLista(); } } } } }