private void gvData_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { string id = gvData.Rows[e.RowIndex].Cells["id"].FormattedValue.ToString(); string tipo = gvData.Rows[e.RowIndex].Cells["tipo"].FormattedValue.ToString(); if (tipo != "<===") { EntradaAlta frm = new EntradaAlta(); var _frm = Application.OpenForms["EntradaAlta"] as EntradaAlta; var menu = Application.OpenForms["menu"] as Menu; frm._idEntrada = int.Parse(id); ofunciones.cargarForm(frm, null, menu); } else { SalidaAlta frm = new SalidaAlta(); var _frm = Application.OpenForms["SalidaAlta"] as SalidaAlta; var menu = Application.OpenForms["menu"] as Menu; frm._idSalida = int.Parse(id); ofunciones.cargarForm(frm, null, menu); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnNuevo_Click(object sender, EventArgs e) { SalidaAlta frm = new SalidaAlta(); var menu = Application.OpenForms["menu"] as Menu; var _frm = Application.OpenForms["SalidaAlta"] as Control.SalidaAlta; ofunciones.cargarForm(frm, _frm, menu); }