protected virtual void AcceptAction() { using (StatusBusy st = new StatusBusy(Resources.Messages.LOADING_DATA)) { using (ProgressInfoMng bar = new ProgressInfoMng()) { try { PgMng.Grow(); PrintAction(); DialogResult = DialogResult.OK; Close(); } catch (Exception ex) { MessageBox.Show(iQExceptionHandler.GetAllMessages(ex), Labels.APP_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } finally { PgMng.FillUp(); } } } }
/// <summary>Refresca la lista despues de realizar alguna operación /// <returns>void</returns> /// </summary> protected void RefreshList() { using (StatusBusy busy = new StatusBusy(Messages.LOADING_DATA)) { try { // Sergio Rosas // Se llama a ApplyFilter porque si estamos en la pestaña // con los elementos filtrados y editamos uno (o creamos uno) // al aceptar o cancelar, la lista que se muestra en la pestaña // de busqueda es la lista entera. Hay que modificar la funcion ApplyFilter // para que llame a RefreshMainData si detecta que esta en la pestaña "Todos" //RefreshMainData(); ApplyFilter(); PgMng.FillUp(); } catch (System.Security.SecurityException ex) { MessageBox.Show(ex.Message); } catch (Exception ex) { string msg = Messages.OPERATION_ERROR + System.Environment.NewLine + iQExceptionHandler.GetAllMessages(ex); MessageBox.Show(msg); } } }
protected override bool SaveObject() { using (StatusBusy busy = new StatusBusy(Resources.Messages.SAVING)) { // Comprobamos los nuevos usuarios para meterlos en la lista de usuarios-Schemas foreach (User usuario in _usuarios) { if (usuario.IsNew) { SchemaUser user = SchemaUser.NewChild(usuario); user.OidSchema = AppContext.ActiveSchema.Oid; usuario.Schemas.Add(user); } } this.Datos.RaiseListChangedEvents = false; this.Datos_Permisos.RaiseListChangedEvents = false; Users temp = _usuarios.Clone(); temp.ApplyEdit(); // do the save try { _usuarios = temp.Save(); _usuarios.ApplyEdit(); return(true); } catch (iQValidationException ex) { PgMng.ShowInfoException(ex); return(false); } catch (iQPersistentException ex) { PgMng.ShowInfoException(ex); return(false); } catch (Csla.Validation.ValidationException ex) { PgMng.ShowInfoException(ex); return(false); } finally { this.Datos.RaiseListChangedEvents = true; this.Datos_Permisos.RaiseListChangedEvents = true; } } }