Ejemplo n.º 1
0
        public void InicializarModificar()
        {
            if (gvSctr.RowCount > 0)
            {
                SctrBE objSctr = new SctrBE();
                objSctr.IdSctr = int.Parse(gvSctr.GetFocusedRowCellValue("IdSctr").ToString());

                int intIdSituacion = int.Parse(gvSctr.GetFocusedRowCellValue("IdSituacion").ToString());
                if (intIdSituacion == Parametros.intSCTRGenerada)
                {
                    frmRegSctrEdit objManSctrEdit = new frmRegSctrEdit();
                    objManSctrEdit.pOperacion        = frmRegSctrEdit.Operacion.Modificar;
                    objManSctrEdit.IdSctr            = objSctr.IdSctr;
                    objManSctrEdit.StartPosition     = FormStartPosition.CenterParent;
                    objManSctrEdit.btnGrabar.Enabled = true;
                    objManSctrEdit.ShowDialog();
                }

                if (intIdSituacion == Parametros.intSCTRAtendida || intIdSituacion == Parametros.intSCTRAnulada)
                {
                    frmRegSctrEdit objManSctrEdit = new frmRegSctrEdit();
                    objManSctrEdit.pOperacion        = frmRegSctrEdit.Operacion.Modificar;
                    objManSctrEdit.IdSctr            = objSctr.IdSctr;
                    objManSctrEdit.StartPosition     = FormStartPosition.CenterParent;
                    objManSctrEdit.btnGrabar.Enabled = false;
                    objManSctrEdit.ShowDialog();
                }

                Cargar();
            }
            else
            {
                MessageBox.Show("No se pudo editar");
            }
        }
Ejemplo n.º 2
0
 private void tlbMenu_NewClick()
 {
     try
     {
         frmRegSctrEdit objManSctr = new frmRegSctrEdit();
         objManSctr.pOperacion    = frmRegSctrEdit.Operacion.Nuevo;
         objManSctr.IdSctr        = 0;
         objManSctr.StartPosition = FormStartPosition.CenterParent;
         objManSctr.ShowDialog();
         Cargar();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }