/// <summary> /// Actualiza un registro en la base de datos /// </summary> /// <param name="parent">Objeto padre</param> internal void Update(Cash 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; OidCaja = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } CashCountRecord obj = parent.Session().Get <CashCountRecord>(Oid); obj.CopyValues(Base.Record); parent.Session().Update(obj); _lineas.Update(this); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
internal void Update(CierreCajas 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; CashCountRecord obj = Session().Get <CashCountRecord>(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"); _caja = Format.DataReader.GetString(source, "CAJA"); _usuario = Format.DataReader.GetString(source, "USUARIO"); _saldo_final = SaldoAcumulado; //_saldo_inicial = Format.DataReader.GetDecimal(source, "SALDO_INICIAL"); }
protected override void DataPortal_Update() { if (IsDirty) { try { CashCountRecord obj = Session().Get <CashCountRecord>(Oid); obj.CopyValues(Base.Record); Session().Update(obj); MarkOld(); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } } }