private void tlbMenu_NewClick() { try { frmRegSolicitudEppEdit objManSolicitudEpp = new frmRegSolicitudEppEdit(); objManSolicitudEpp.pOperacion = frmRegSolicitudEppEdit.Operacion.Nuevo; objManSolicitudEpp.IdSolicitudEpp = 0; objManSolicitudEpp.StartPosition = FormStartPosition.CenterParent; objManSolicitudEpp.ShowDialog(); Cargar(); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void InicializarModificar() { if (gvSolicitudEpp.RowCount > 0) { SolicitudEppBE objSolicitudEpp = new SolicitudEppBE(); objSolicitudEpp.IdSolicitudEpp = int.Parse(gvSolicitudEpp.GetFocusedRowCellValue("IdSolicitudEpp").ToString()); int intIdSituacion = int.Parse(gvSolicitudEpp.GetFocusedRowCellValue("IdSituacion").ToString()); if (intIdSituacion == Parametros.intSLCPendiente) { frmRegSolicitudEppEdit objManSolicitudEppEdit = new frmRegSolicitudEppEdit(); objManSolicitudEppEdit.pOperacion = frmRegSolicitudEppEdit.Operacion.Modificar; objManSolicitudEppEdit.IdSolicitudEpp = objSolicitudEpp.IdSolicitudEpp; objManSolicitudEppEdit.StartPosition = FormStartPosition.CenterParent; objManSolicitudEppEdit.btnGrabar.Enabled = true; objManSolicitudEppEdit.ShowDialog(); } if (intIdSituacion == Parametros.intSLCAtendido || intIdSituacion == Parametros.intSLCAnulado) { frmRegSolicitudEppEdit objManSolicitudEppEdit = new frmRegSolicitudEppEdit(); objManSolicitudEppEdit.pOperacion = frmRegSolicitudEppEdit.Operacion.Modificar; objManSolicitudEppEdit.IdSolicitudEpp = objSolicitudEpp.IdSolicitudEpp; objManSolicitudEppEdit.StartPosition = FormStartPosition.CenterParent; objManSolicitudEppEdit.btnGrabar.Enabled = false; objManSolicitudEppEdit.ShowDialog(); } Cargar(); } else { MessageBox.Show("No se pudo editar"); } }