private void DGResultadoss_KeyPress(object sender, KeyPressEventArgs e) { try { if (e.KeyChar == Convert.ToChar(Keys.Enter)) { frmSistema_Usuarios frmPE = frmSistema_Usuarios.GetInstancia(); //Variables de frmSistema_Empleados string frmPE1, frmPE2; if (frmPE.Filtro) { frmPE1 = Convert.ToString(this.DGResultadoss.CurrentRow.Cells["Codigo"].Value); frmPE2 = Convert.ToString(this.DGResultadoss.CurrentRow.Cells["Empleado"].Value); frmPE.setEmpleado(frmPE1, frmPE2); this.Hide(); } } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
public static frmSistema_Usuarios GetInstancia() { if (_Instancia == null) { _Instancia = new frmSistema_Usuarios(); } return(_Instancia); }
private void UsuariosToolStripMenuItem_Click(object sender, EventArgs e) { frmSistema_Usuarios frmSistema_Usuarios = frmSistema_Usuarios.GetInstancia(); frmSistema_Usuarios.MdiParent = this; frmSistema_Usuarios.Show(); frmSistema_Usuarios.Guardar = Convert.ToString(this.SQL_Guardar); frmSistema_Usuarios.Editar = Convert.ToString(this.SQL_Editar); frmSistema_Usuarios.Eliminar = Convert.ToString(this.SQL_Eliminar); frmSistema_Usuarios.Consultar = Convert.ToString(this.SQL_Consultar); }
private void DGResultadoss_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { frmSistema_Usuarios frmPE = frmSistema_Usuarios.GetInstancia(); //Variables de frmSistema_Empleados string frmPE1, frmPE2; if (frmPE.Filtro) { frmPE1 = Convert.ToString(this.DGResultadoss.CurrentRow.Cells["Codigo"].Value); frmPE2 = Convert.ToString(this.DGResultadoss.CurrentRow.Cells["Empleado"].Value); frmPE.setEmpleado(frmPE1, frmPE2); this.Hide(); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void FrmSistema_Usuarios_FormClosing(object sender, FormClosingEventArgs e) { _Instancia = null; }