/// <summary> /// Actualiza un registro en la base de datos /// </summary> /// <param name="parent">Objeto padre</param> internal void Update(WorkReport 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; OidWorkReport = parent.Oid; ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } WorkReportResourceRecord obj = parent.Session().Get <WorkReportResourceRecord>(Oid); obj.CopyValues(Base.Record); parent.Session().Update(obj); MarkOld(); }
public virtual void CopyValues(WorkReportResourceRecord source) { if (source == null) { return; } Oid = source.Oid; _oid_work_report = source.OidWorkReport; _oid_resource = source.OidResource; _entity_type = source.EntityType; _amount = source.Amount; _cost = source.Cost; _from = source.From; _till = source.Till; _hours = source.Hours; _extra_cost = source.ExtraCost; _total = source.Total; _comments = source.Comments; }
/// <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(WorkReportResources parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } SessionCode = parent.SessionCode; WorkReportResourceRecord obj = Session().Get <WorkReportResourceRecord>(Oid); obj.CopyValues(Base.Record); Session().Update(obj); MarkOld(); }