internal void Update(TransactionPayments parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                SessionCode = parent.SessionCode;
                TransactionPaymentRecord obj = Session().Get <TransactionPaymentRecord>(Oid);
                obj.CopyValues(this._base.Record);
                Session().Update(obj);
            }
            catch (Exception ex)
            {
                throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex));
            }

            MarkOld();
        }
        internal void Update(Payment parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            //Debe obtener la sesion del padre pq el objeto es padre a su vez
            SessionCode = parent.SessionCode;

            _base.Record.OidPago  = parent.Oid;
            _base.Record.TipoPago = parent.TipoPago;

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                TransactionPaymentRecord obj = parent.Session().Get <TransactionPaymentRecord>(Oid);
                obj.CopyValues(this._base.Record);
                parent.Session().Update(obj);
            }
            catch (Exception ex)
            {
                throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex));
            }

            MarkOld();
        }
        internal void CopyValues(IDataReader source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source);

            _n_serie = Format.DataReader.GetString(source, "N_SERIE");
            //_codigo_factura = Format.DataReader.GetString(source, "CODIGO_FACTURA");
            _n_factura       = Format.DataReader.GetString(source, "NUMERO_FACTURA");
            _fecha_factura   = Format.DataReader.GetDateTime(source, "FECHA_FACTURA");
            _importe_factura = Format.DataReader.GetDecimal(source, "IMPORTE_FACTURA");
            _n_expediente    = Format.DataReader.GetString(source, "NEXPEDIENTE");
            _other_payments  = Format.DataReader.GetDecimal(source, "OTHER_PAYMENTS");
        }