/// <summary> /// Actualiza el registro en la base de datos /// </summary> /// <param name="parent">Lista padre</param> /// <remarks>La utiliza la BusinessListBaseEx correspondiente para actualizar elementos<remarks/> internal void Update(Cashes parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } SessionCode = parent.SessionCode; CashRecord obj = Session().Get <CashRecord>(Oid); obj.CopyValues(Base.Record); Session().Update(obj); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
internal void CopyValues(IDataReader source) { if (source == null) { return; } _record.CopyValues(source); _debe_acumulado = Format.DataReader.GetDecimal(source, "DEBE_ACUMULADO"); _haber_acumulado = Format.DataReader.GetDecimal(source, "HABER_ACUMULADO"); decimal debe_parcial = Format.DataReader.GetDecimal(source, "DEBE_ACTUAL"); decimal haber_parcial = Format.DataReader.GetDecimal(source, "HABER_ACTUAL"); _debe_total = _debe_acumulado + debe_parcial; _haber_total = _haber_acumulado + debe_parcial; }
protected override void DataPortal_Update() { if (IsDirty) { try { CashRecord obj = Session().Get <CashRecord>(Oid); obj.CopyValues(Base.Record); Session().Update(obj); MarkOld(); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } } }