Пример #1
0
 private void tlbMenu_NewClick()
 {
     try
     {
         frmManCarpetaEdit objManCarpeta = new frmManCarpetaEdit();
         objManCarpeta.lstCarpeta    = mLista;
         objManCarpeta.pOperacion    = frmManCarpetaEdit.Operacion.Nuevo;
         objManCarpeta.IdCarpeta     = 0;
         objManCarpeta.StartPosition = FormStartPosition.CenterParent;
         objManCarpeta.ShowDialog();
         Cargar();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
        public void InicializarModificar()
        {
            if (gvCarpeta.RowCount > 0)
            {
                CarpetaBE objCarpeta = new CarpetaBE();
                objCarpeta.IdCarpeta   = int.Parse(gvCarpeta.GetFocusedRowCellValue("IdCarpeta").ToString());
                objCarpeta.DescCarpeta = gvCarpeta.GetFocusedRowCellValue("DescCarpeta").ToString();
                objCarpeta.FlagEstado  = Convert.ToBoolean(gvCarpeta.GetFocusedRowCellValue("FlagEstado").ToString());

                frmManCarpetaEdit objManCarpetaEdit = new frmManCarpetaEdit();
                objManCarpetaEdit.pOperacion    = frmManCarpetaEdit.Operacion.Modificar;
                objManCarpetaEdit.IdCarpeta     = objCarpeta.IdCarpeta;
                objManCarpetaEdit.pCarpetaBE    = objCarpeta;
                objManCarpetaEdit.StartPosition = FormStartPosition.CenterParent;
                objManCarpetaEdit.ShowDialog();

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