protected override bool SaveObject() { this.Datos.RaiseListChangedEvents = false; PayrollBatch temp = _entity.Clone(); temp.ApplyEdit(); // do the save try { _entity = temp.Save(); _entity.ApplyEdit(); return(true); } catch (Exception ex) { PgMng.ShowErrorException(ex); return(false); } finally { this.Datos.RaiseListChangedEvents = true; } }
public override void OpenEditForm() { PayrollBatchEditForm form = new PayrollBatchEditForm(ActiveOID, this); if (form.Entity != null) { AddForm(form); _entity = form.Entity; } }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { PayrollBatchList listA = PayrollBatchList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.Unlock: case molAction.ChangeStateContabilizado: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { PayrollBatchList listD = PayrollBatchList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public override void OpenAddForm() { TipoGastoInfo tipo = TipoGastoInfo.Get(Library.Store.ModulePrincipal.GetDefaultNominasSetting(), false); if (tipo.Oid == 0) { throw new iQException(Library.Store.Resources.Messages.NO_TIPOGASTO_NOMINAS); } PayrollbatchAddForm form = new PayrollbatchAddForm(this); AddForm(form); if (form.ActionResult == DialogResult.OK) { _entity = form.Entity; } }
protected override void GetFormSourceData(long oid) { _entity = PayrollBatch.Get(oid); _entity.BeginEdit(); }
public override void ChangeStateAction(EEstadoItem estado) { _entity = PayrollBatch.ChangeStatus(ActiveOID, Base.EnumConvert.ToEEstado(estado)); _action_result = DialogResult.OK; }
public override void DeleteAction() { PayrollBatch.Delete(ActiveOID); _action_result = DialogResult.OK; }
protected override void GetFormSourceData() { _entity = PayrollBatch.New(); _entity.BeginEdit(); }