public void InicializarModificar() { if (gvPersona.RowCount > 0) { PersonaBE objSSOMA = new PersonaBE(); objSSOMA.IdEmpresa = int.Parse(gvPersona.GetFocusedRowCellValue("IdEmpresa").ToString()); objSSOMA.IdUnidadMinera = int.Parse(gvPersona.GetFocusedRowCellValue("IdUnidadMinera").ToString()); objSSOMA.IdArea = int.Parse(gvPersona.GetFocusedRowCellValue("IdArea").ToString()); objSSOMA.IdPersona = int.Parse(gvPersona.GetFocusedRowCellValue("IdPersona").ToString()); frmManPersonaEdit objManPersonaEdit = new frmManPersonaEdit(); objManPersonaEdit.pOperacion = frmManPersonaEdit.Operacion.Modificar; objManPersonaEdit.IdEmpresa = objSSOMA.IdEmpresa; objManPersonaEdit.IdPersona = objSSOMA.IdPersona; objManPersonaEdit.pPersonaBE = objSSOMA; objManPersonaEdit.StartPosition = FormStartPosition.CenterParent; objManPersonaEdit.ShowDialog(); Cargar(); } else { MessageBox.Show("No se pudo editar"); } }
private void tlbMenu_NewClick() { try { if (IdEmpresa == 0) { XtraMessageBox.Show("Debe seleccionar la empresa contratista", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } frmManPersonaEdit objManPersona = new frmManPersonaEdit(); objManPersona.lstPersona = mLista; objManPersona.pOperacion = frmManPersonaEdit.Operacion.Nuevo; objManPersona.IdEmpresa = IdEmpresa; objManPersona.IdPersona = 0; objManPersona.StartPosition = FormStartPosition.CenterParent; objManPersona.ShowDialog(); Cargar(); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }