Example #1
0
        /// <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();
        }
Example #2
0
        /// <summary>
        /// Inserta un registro en la base de datos
        /// </summary>
        /// <param name="parent">Objeto padre</param>
        internal void Insert(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);
            }

            parent.Session().Save(Base.Record);

            MarkOld();
        }