Exemple #1
0
        /// <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();
        }
Exemple #2
0
        internal void CopyValues(IDataReader source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source);

            _oid_category   = Format.DataReader.GetInt64(source, "OID_CATEGORY");
            _category       = Format.DataReader.GetString(source, "CATEGORY");
            _resource       = Format.DataReader.GetString(source, "RESOURCE");
            _resource_id    = Format.DataReader.GetString(source, "RESOURCE_CODE");
            _work_report_id = Format.DataReader.GetString(source, "WORK_REPORT_ID");
            _expedient_id   = Format.DataReader.GetString(source, "EXPEDIENT_ID");
        }
Exemple #3
0
        /// <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();
        }