/// <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(Stores 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; AlmacenRecord obj = Session().Get <AlmacenRecord>(Oid); obj.CopyValues(this._base.Record); Session().Update(obj); if (SaveChilds) { _partidas.Update(this); _stocks.Update(this); } } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
public virtual void CopyValues(AlmacenRecord source) { if (source == null) { return; } Oid = source.Oid; _nombre = source.Nombre; _ubicacion = source.Ubicacion; _observaciones = source.Observaciones; _serial = source.Serial; _codigo = source.Codigo; _estado = source.Estado; }
protected override void DataPortal_Update() { if (IsDirty) { try { AlmacenRecord obj = Session().Get <AlmacenRecord>(Oid); obj.CopyValues(this._base.Record); Session().Update(obj); MarkOld(); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } } }