Пример #1
0
 private void tlbMenu_NewClick()
 {
     try
     {
         frmManStatusEdit objManStatus = new frmManStatusEdit();
         objManStatus.lstStatus     = mLista;
         objManStatus.pOperacion    = frmManStatusEdit.Operacion.Nuevo;
         objManStatus.IdStatus      = 0;
         objManStatus.StartPosition = FormStartPosition.CenterParent;
         objManStatus.ShowDialog();
         Cargar();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
        public void InicializarModificar()
        {
            if (gvStatus.RowCount > 0)
            {
                StatusBE objStatus = new StatusBE();

                objStatus.IdStatus = int.Parse(gvStatus.GetFocusedRowCellValue("IdStatus").ToString());

                frmManStatusEdit objManStatusEdit = new frmManStatusEdit();
                objManStatusEdit.pOperacion    = frmManStatusEdit.Operacion.Modificar;
                objManStatusEdit.IdStatus      = objStatus.IdStatus;
                objManStatusEdit.pStatusBE     = objStatus;
                objManStatusEdit.StartPosition = FormStartPosition.CenterParent;
                objManStatusEdit.ShowDialog();

                Cargar();
            }
            else
            {
                MessageBox.Show("No se pudo editar");
            }
        }