protected override void GetFormSourceData(object[] parameters)
        {
            if (parameters[0] == null)
            {
                if (parameters[2] != null)
                {
                    _holder = (IAcreedor)parameters[2];
                    _holder.LoadChilds(typeof(Payment), true);
                    _entity = _holder.Pagos.NewItem(_holder, ETipoPago.Nomina);
                    _entity.CopyFrom(_holder, ETipoPago.Nomina);
                }
                else
                {
                    _entity = Payment.New((ETipoPago)parameters[1]);
                }

                _entity.ETipoAcreedor = ETipoAcreedor.Empleado;
                _entity.BeginEdit();
                _entity.Oid = -1;
            }
            else
            {
                _entity = (Payment)parameters[0];
                _entity.BeginEdit();
                _entity.Oid = -1;
            }

            if (_holder != null)
            {
                _payrolls = PayrollList.GetPendientesList((_holder as Employee).Oid, false);
            }
            else
            {
                _payrolls = PayrollList.GetPendientesList(_entity.GetInfo(false), false);
            }

            //Asociamos los gastos previamente vinculados
            foreach (TransactionPayment item in _entity.Operations)
            {
                NominaInfo gasto = _payrolls.GetItem(item.OidOperation);
                gasto.Vincula();
            }
        }
Beispiel #2
0
 protected void UpdatePendientes()
 {
     Unpaids_BS.DataSource = PayrollList.GetPendientesList(Entity.Oid, false);
 }