/// <summary>Duplica un objeto y abre el formulario para editar item /// <returns>void</returns> /// </summary> public override void DuplicateObject(long oid) { try { ClaseAuditoria old = ClaseAuditoria.Get(oid); ClaseAuditoria dup = old.CloneAsNew(); old.CloseSession(); AddForm(new ClaseAuditoriaAddForm(dup)); } catch (iQException ex) { MessageBox.Show(ex.Message, moleQule.Face.Resources.Labels.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Csla.DataPortalException ex) { MessageBox.Show(iQExceptionHandler.GetiQException(ex).Message, moleQule.Face.Resources.Labels.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.ToString(), moleQule.Face.Resources.Labels.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } RefreshList(); }
/// <summary> /// Abre el formulario para editar item /// <returns>void</returns> /// </summary> public override void OpenEditForm() { try { ClaseAuditoriaEditForm form = new ClaseAuditoriaEditForm(ActiveOID); if (form.Entity != null) { AddForm(form); _entity = form.Entity; } } catch (Csla.DataPortalException ex) { MessageBox.Show(ex.BusinessException.ToString(), moleQule.Face.Resources.Labels.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.ToString(), moleQule.Face.Resources.Labels.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
/// <summary> /// Abre el formulario para borrar item /// <returns>void</returns> /// </summary> public override void DeleteObject(long oid) { //if (MessageBox.Show(moleQule.Face.Resources.Messages.DELETE_CONFIRM, // moleQule.Face.Resources.Labels.ADVISE_TITLE, // MessageBoxButtons.YesNoCancel, // MessageBoxIcon.Question) == DialogResult.Yes) //{ try { ClaseAuditoria.Delete(oid); _action_result = DialogResult.OK; //Se eliminan todos los formularios de ese objeto foreach (ItemMngBaseForm form in _list_active_form) { if (form.Oid == oid) { form.Dispose(); break; } } } catch (Csla.DataPortalException ex) { MessageBox.Show(iQExceptionHandler.GetiQException(ex).Message); } //} }
/// <summary>Aplica las reglas de validación de usuarios al formulario. /// <returns>void</returns> /// </summary> protected override void ApplyAuthorizationRules() { Tabla.Visible = ClaseAuditoria.CanGetObject(); Add_Button.Enabled = ClaseAuditoria.CanAddObject(); Edit_Button.Enabled = ClaseAuditoria.CanEditObject(); Delete_Button.Enabled = ClaseAuditoria.CanDeleteObject(); Print_Button.Enabled = ClaseAuditoria.CanGetObject(); View_Button.Enabled = ClaseAuditoria.CanGetObject(); }
public TipoAuditoriaAddForm(bool IsModal, ClaseAuditoria item) : base(IsModal) { InitializeComponent(); _clase = item; _entity = _clase.TipoAuditorias.NewItem(_clase); SetFormData(); this.Text = Resources.Labels.TIPO_AUDITORIA_TITLE; }
public TipoAuditoriaEditForm(bool IsModal, ClaseAuditoria item, TipoAuditoria entity) : base(IsModal) { InitializeComponent(); _clase = item; _entity = entity; SetFormData(); this.Text = Resources.Labels.TIPO_AUDITORIA_TITLE; }
public ClaseAuditoriaAddForm(ClaseAuditoria source) : base() { InitializeComponent(); _entity = source.Clone(); _entity.BeginEdit(); SetFormData(); _mf_type = ManagerFormType.MFAdd; this.Text = Resources.Labels.CLASE_AUDITORIA_ADD_TITLE; }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { ClaseAuditoriaList listA = ClaseAuditoriaList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.Lock: case molAction.Unlock: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { ClaseAuditoriaList listD = ClaseAuditoriaList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } _entity = null; RefreshSources(); }
/// <summary> /// Guarda en la bd el objeto actual /// </summary> protected override bool SaveObject() { using (StatusBusy busy = new StatusBusy(moleQule.Face.Resources.Messages.SAVING)) { this.Datos.RaiseListChangedEvents = false; ClaseAuditoria temp = _entity.Clone(); temp.ApplyEdit(); // do the save try { _entity = temp.Save(); _entity.ApplyEdit(); //Decomentar si se va a mantener en memoria //_entity.BeginEdit(); return(true); } catch (iQValidationException ex) { MessageBox.Show(iQExceptionHandler.GetAllMessages(ex) + Environment.NewLine + ex.SysMessage, AppController.APP_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } catch (Exception ex) { MessageBox.Show(iQExceptionHandler.GetAllMessages(ex), AppController.APP_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } finally { this.Datos.RaiseListChangedEvents = true; } } }
protected override void GetFormSourceData(long oid) { _entity = ClaseAuditoria.Get(oid); _entity.BeginEdit(); _mf_type = ManagerFormType.MFEdit; }
protected override void GetFormSourceData() { _entity = ClaseAuditoria.New(); _entity.BeginEdit(); }
public TipoAuditoriaAddForm(ClaseAuditoria item) : this(true, item) { }
public TipoAuditoriaEditForm(ClaseAuditoria item, TipoAuditoria entity) : this(true, item, entity) { }