private void btnBuscar_Click(object sender, EventArgs e) { string numContra = string.Empty; string numCdgScn = string.Empty; string tipContra = string.Empty; frmCryReporteContrato frmVistaReporte = new frmCryReporteContrato(); tipContra = cmbTipCnt.SelectedItem.ToString(); numContra = txtCdgCnt.Text; numCdgScn = txtCdgScn.Text; if (busCarCnt(numContra, numCdgScn) > 1) { this.Size = new System.Drawing.Size(560, 411); dgvDatos.Visible = true; carDatCnt(numContra, numCdgScn); } else if (busCarCnt(numContra, numCdgScn) == 1) { this.Size = new System.Drawing.Size(560, 211); dgvDatos.Visible = false; frmVistaReporte.numConsec = numCon; frmVistaReporte.tipContra = tipContra; frmVistaReporte.ShowDialog(); } else { MessageBox.Show("No hay registros que mostrar"); } }
private void dgvDatos_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string tipContra = string.Empty; tipContra = cmbTipCnt.SelectedItem.ToString(); frmCryReporteContrato frmVistaReporte = new frmCryReporteContrato(); frmVistaReporte.tipContra = tipContra; frmVistaReporte.numConsec = Convert.ToInt32(dgvDatos.Rows[e.RowIndex].Cells["clmCon"].Value.ToString()); frmVistaReporte.ShowDialog(); }