/// <summary> /// Actualiza un registro en la base de datos /// </summary> /// <param name="parent">Objeto padre</param> internal void Update(Ayuda 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; OidAyuda = parent.Oid; ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } GrantPeriodRecord obj = parent.Session().Get <GrantPeriodRecord>(Oid); obj.CopyValues(this._base.Record); parent.Session().Update(obj); MarkOld(); }
public virtual void CopyValues(GrantPeriodRecord source) { if (source == null) { return; } Oid = source.Oid; _oid_ayuda = source.OidAyuda; _estado = source.Estado; _tipo_descuento = source.TipoDescuento; _porcentaje = source.Porcentaje; _cantidad = source.Cantidad; _fecha_ini = source.FechaIni; _fecha_fin = source.FechaFin; _observaciones = source.Observaciones; }
/// <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(AyudaPeriodos 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; GrantPeriodRecord obj = Session().Get <GrantPeriodRecord>(Oid); obj.CopyValues(this._base.Record); Session().Update(obj); MarkOld(); }