private void btnnuevo_Click(object sender, EventArgs e) { try { UCGe_Mant_Empresa UCEm = new UCGe_Mant_Empresa(); frmCon_Mantenimiento frM = new frmCon_Mantenimiento(); frM.Height = UCEm.Height + 150; frM.Width = UCEm.Width + 20; UCEm.set_Accion(Cl_Enumeradores.eTipo_action.grabar); frM.Controls.Add(UCEm); frM.ShowDialog(); cargar_empresas(); } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); MessageBox.Show(ex.Message.ToString()); } }
private void btnconsultar_Click(object sender, EventArgs e) { try { if (this.dgEmpresa.SelectedRows.Count == 0) { MessageBox.Show("Selecciones una fila", "sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } foreach (DataGridViewRow row in this.dgEmpresa.SelectedRows) { //Customer cust = row.DataBoundItem as Customer; tb_Empresa_Info Emprei = row.DataBoundItem as tb_Empresa_Info; if (Emprei != null) { UCGe_Mant_Empresa UCEm = new UCGe_Mant_Empresa(); frmCon_Mantenimiento frM = new frmCon_Mantenimiento(); frM.Height = UCEm.Height + 150; frM.Width = UCEm.Width + 20; UCEm.set_Accion(Cl_Enumeradores.eTipo_action.consultar); UCEm.set_empresa(Emprei); UCEm.set_enable_btn_Grabar(false); frM.Controls.Add(UCEm); frM.ShowDialog(); cargar_empresas(); } } } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }