Example #1
0
 private void tlbMenu_NewClick()
 {
     try
     {
         frmManPerfilEdit objManPerfil = new frmManPerfilEdit();
         objManPerfil.pOperacion    = frmManPerfilEdit.Operacion.Nuevo;
         objManPerfil.IdProfile     = 0;
         objManPerfil.StartPosition = FormStartPosition.CenterParent;
         objManPerfil.ShowDialog();
         Cargar();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
        public void InicializarModificar()
        {
            if (gvPerfil.RowCount > 0)
            {
                ProfileBE objPerfil = new ProfileBE();
                objPerfil.IdProfile   = int.Parse(gvPerfil.GetFocusedRowCellValue("IdProfile").ToString());
                objPerfil.NameProfile = gvPerfil.GetFocusedRowCellValue("NameProfile").ToString();
                objPerfil.FlagState   = Convert.ToBoolean(gvPerfil.GetFocusedRowCellValue("FlagState").ToString());

                frmManPerfilEdit objManPerfilEdit = new frmManPerfilEdit();
                objManPerfilEdit.pOperacion    = frmManPerfilEdit.Operacion.Modificar;
                objManPerfilEdit.IdProfile     = objPerfil.IdProfile;
                objManPerfilEdit.pPerfilBE     = objPerfil;
                objManPerfilEdit.StartPosition = FormStartPosition.CenterParent;
                objManPerfilEdit.ShowDialog();

                Cargar();
            }
            else
            {
                MessageBox.Show("Could not edit");
            }
        }