/// <summary> /// Actualiza un registro en la base de datos /// </summary> /// <param name="parent">Objeto padre</param> internal void Update(Product 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; OidKit = parent.Oid; ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR); } KitRecord obj = parent.Session().Get <KitRecord>(Oid); obj.CopyValues(Base.Record); parent.Session().Update(obj); MarkOld(); }
public virtual void CopyValues(KitRecord source) { if (source == null) { return; } Oid = source.Oid; _oid_kit = source.OidKit; _oid_product = source.OidProduct; _amount = source.Amount; }
/// <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(Kits parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR); } SessionCode = parent.SessionCode; KitRecord obj = Session().Get <KitRecord>(Oid); obj.CopyValues(Base.Record); Session().Update(obj); MarkOld(); }