Пример #1
0
        protected override void NewPaymentAction()
        {
            Payment            payment     = _entity.Payments.NewItem(_entity.GetInfo());
            TransactionPayment transaction = payment.Operations.NewItem(payment, _entity, ETipoPago.Prestamo);

            transaction.Cantidad = payment.Importe;

            LoanPaymentEditForm form = new LoanPaymentEditForm(payment, ETipoPago.Prestamo, _entity, this);

            form.ShowDialog();

            if (form.ActionResult != DialogResult.OK)
            {
                _entity.Payments.Remove(payment);
            }

            UpdatePayments();

            UpdateImportes();
        }
Пример #2
0
        protected override void EditPaymentAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Pagos_DGW))
            {
                return;
            }

            Payment item = ControlsMng.GetCurrentItem(Pagos_DGW) as Payment;

            if (item.Operations.Count == 0)
            {
                item.LoadChilds(typeof(TransactionPayment), false);
            }

            LoanPaymentEditForm form = new LoanPaymentEditForm(item, ETipoPago.Prestamo, _entity, this);

            form.ShowDialog();

            UpdatePayments();

            UpdateImportes();
        }
        public override void OpenEditForm()
        {
            switch (ActiveItem.ETipoPago)
            {
            case ETipoPago.Factura:
            {
                PaymentSummary item = PaymentSummary.Get((ETipoAcreedor)ActiveItem.TipoAgente, ActiveItem.OidAgente);

                PaymentEditForm form = new PaymentEditForm(this, ActiveItem.OidAgente, item);
                if (form.Entity != null)
                {
                    form.Select(ActiveItem);
                    AddForm(form);
                }
                item.CloseSession();
            }
            break;

            case ETipoPago.Nomina:
            {
                if (ActiveItem.OidAgente == 0)
                {
                    PayrollPaymentEditForm form = new PayrollPaymentEditForm(ActiveItem.Oid, ETipoPago.Nomina, this);
                    if (form.Entity != null)
                    {
                        AddForm(form);
                        _entity = form.Entity;
                    }
                }
                else
                {
                    PaymentSummary item = PaymentSummary.Get((ETipoAcreedor)ActiveItem.TipoAgente, ActiveItem.OidAgente);

                    EmployeePaymentEditForm form = new EmployeePaymentEditForm(this, ActiveItem.OidAgente, item);
                    if (form.Entity != null)
                    {
                        form.Select(ActiveItem);
                        AddForm(form);
                    }
                    item.CloseSession();
                }
            }
            break;

            case ETipoPago.Prestamo:
            {
                LoanPaymentEditForm form = new LoanPaymentEditForm(ActiveItem.Oid, ETipoPago.Prestamo, this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    _entity = form.Entity;
                }
            }
            break;

            case ETipoPago.Fraccionado:
            {
                PagoFraccionadoEditForm form = new PagoFraccionadoEditForm(ActiveItem.Oid, ETipoPago.Fraccionado, this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    _entity = form.Entity;
                }
            }
            break;

            case ETipoPago.ExtractoTarjeta:
            {
                CreditCardPaymentEditForm form = new CreditCardPaymentEditForm(ActiveItem.Oid, ETipoPago.ExtractoTarjeta, this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    _entity = form.Entity;
                }
            }
            break;

            default:
            {
                ExpensePaymentEditForm form = new ExpensePaymentEditForm(ActiveItem.Oid, ActiveItem.ETipoPago, this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    _entity = form.Entity;
                }
            }
            break;
            }
        }