public void GotoPagoAction() { if (ActiveItem.EEstado == moleQule.Base.EEstado.Anulado) { return; } if (ActiveItem.Total == 0) { return; } if (ActiveItem.OidPago == 0) { //Se obtiene el registro desde la DB para que actualice el pendiente de pago //en el caso de que se haya creado justo antes de esta acción Payment pago = Payment.New(ExpenseInfo.Get(ActiveItem.Oid, false), moleQule.Store.Structs.EnumConvert.ToETipoPago(ActiveItem.ECategoriaGasto)); ExpensePaymentAddForm form = new ExpensePaymentAddForm(pago, this); form.ShowDialog(this); if (form.ActionResult == DialogResult.OK) { ActiveItem.CopyFrom(form.Entity); } } else { ExpensePaymentEditForm form = new ExpensePaymentEditForm(ActiveItem.OidPago, moleQule.Store.Structs.EnumConvert.ToETipoPago(ActiveItem.ECategoriaGasto), this); form.ShowDialog(this); } }
public override void UpdateList() { switch (_current_action) { case molAction.Add: break; case molAction.ChangeStateContabilizado: case molAction.ChangeStateAnulado: case molAction.Unlock: case molAction.Edit: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } List.NewItem(_entity.GetInfo(false)); List.UpdateBalance(); if (FilterType == IFilterType.Filter) { LivestockBookLineList listA = LivestockBookLineList.GetList(_filter_results); listA.NewItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.Lock: case molAction.Unlock: case molAction.CustomAction1: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); List.UpdateBalance(); if (FilterType == IFilterType.Filter) { LivestockBookLineList list = LivestockBookLineList.GetList(_filter_results); list.UpdateBalance(); _filter_results = list.GetSortedList(); } break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); List.UpdateBalance(); if (FilterType == IFilterType.Filter) { LivestockBookLineList listD = LivestockBookLineList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public void ShowPagoAction() { if (ActiveItem.EEstado == moleQule.Base.EEstado.Anulado) { return; } if (ActiveItem.OidPago == 0) { Payment pago = Payment.New(ActiveItem); PayrollPaymentAddForm form = new PayrollPaymentAddForm(pago, this); form.ShowDialog(this); if (form.ActionResult == DialogResult.OK) { ActiveItem.CopyFrom(form.Entity); ExecuteAction(molAction.Refresh); } } else { PayrollPaymentEditForm form = new PayrollPaymentEditForm(ActiveItem.OidPago, moleQule.Store.Structs.EnumConvert.ToETipoPago(ECategoriaGasto.Nomina), this); form.ShowDialog(this); ExecuteAction(molAction.Refresh); } }
public override void UpdateList() { switch (_current_action) { case molAction.Add: case molAction.Copy: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { BankAccountList listA = BankAccountList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.Lock: case molAction.Unlock: case molAction.ChangeStateAnulado: if (_entity == null) { return; } if (_entity.Oid != ActiveItem.Oid) { ActiveItem.CopyFrom(_entity.CuentasAsociadas.GetItem(ActiveItem.Oid)); } else { ActiveItem.CopyFrom(_entity); } break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { BankAccountList listD = BankAccountList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public override void UpdateList() { switch (_current_action) { case molAction.Add: case molAction.Copy: if (_entity == null) { return; } if (List.GetItem(_entity.Oid) != null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { InputDeliveryList listA = InputDeliveryList.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) { InputDeliveryList listD = InputDeliveryList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public override void UpdateList() { switch (_current_action) { case molAction.Add: case molAction.Copy: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { OutputInvoiceList listA = OutputInvoiceList.GetList((SortedBindingList <OutputInvoiceInfo>)_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.ChangeStateContabilizado: case molAction.ChangeStateEmitido: case molAction.Unlock: case molAction.PrintDetail: case molAction.ExportPDF: case molAction.EmailPDF: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { OutputInvoiceList listD = OutputInvoiceList.GetList((SortedBindingList <OutputInvoiceInfo>)_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } List.AddItem(_entity.GetInfo()); if (FilterType == IFilterType.Filter) { MunicipioList listA = MunicipioList.GetList(_filter_results); listA.AddItem(_entity.GetInfo()); _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) { MunicipioList listD = MunicipioList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } _entity = null; RefreshSources(); }
public override void UpdateList() { switch (_current_action) { case molAction.Add: case molAction.Copy: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { PaymentList listA = PaymentList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.ChangeStateContabilizado: case molAction.ChangeStateAnulado: case molAction.Unlock: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } if (List.GetItem(_entity.Oid) != null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { OutputDeliveryLineList listA = OutputDeliveryLineList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.CustomAction1: case molAction.CustomAction2: case molAction.Edit: case molAction.Lock: case molAction.Unlock: if (_selected != null) { List <OutputDeliveryLineInfo> entities = (List <OutputDeliveryLineInfo>)_selected; foreach (OutputDeliveryLineInfo item in entities) { List.GetItem(item.Oid).CopyFrom(item); if (FilterType == IFilterType.Filter) { OutputDeliveryLineList list = OutputDeliveryLineList.GetList(_filter_results); OutputDeliveryLineInfo entity = list.GetItem(item.Oid); if (entity != null) { entity.CopyFrom(item); } _filter_results = list.GetSortedList(); } } } if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { OutputDeliveryLineList listD = OutputDeliveryLineList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }