Beispiel #1
0
        // called to retrieve data from the database
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;

                Childs = criteria.Childs;

                if (nHMng.UseDirectSQL)
                {
                    TipoAuditoria.LOCK();
                    IDataReader reader = nHMng.SQLNativeSelect(criteria.Query);

                    if (reader.Read())
                    {
                        _base.CopyValues(reader);
                    }

                    if (Childs)
                    {
                        Criterio.LOCK(AppContext.ActiveSchema.Code);

                        string query = Criterios.SELECT_BY_TIPO_AUDITORIA(this.Oid);
                        reader     = nHManager.Instance.SQLNativeSelect(query, Session());
                        _criterios = Criterios.GetChildList(reader);

                        Auditoria_Area.LOCK(AppContext.ActiveSchema.Code);

                        query  = Auditorias_Areas.SELECT_BY_AUDITORIA(this.Oid);
                        reader = nHManager.Instance.SQLNativeSelect(query, Session());
                        _areas = Auditorias_Areas.GetChildList(reader);

                        Cuestion.LOCK(AppContext.ActiveSchema.Code);

                        query       = Cuestiones.SELECT_BY_TIPO_AUDITORIA(this.Oid);
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _cuestiones = Cuestiones.GetChildList(criteria.SessionCode, reader);

                        Plan_Tipo.LOCK(AppContext.ActiveSchema.Code);

                        query         = Planes_Tipos.SELECT_BY_FIELD("OidTipo", this.Oid);
                        reader        = nHManager.Instance.SQLNativeSelect(query, Session());
                        _planes_tipos = Planes_Tipos.GetChildList(reader);
                    }
                }
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
Beispiel #2
0
        private void Fetch(int session_code, IDataReader source)
        {
            try
            {
                _base.CopyValues(source);

                if (Childs)
                {
                    Criterio.LOCK(AppContext.ActiveSchema.Code);

                    string      query  = Criterios.SELECT_BY_TIPO_AUDITORIA(this.Oid);
                    IDataReader reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _criterios = Criterios.GetChildList(reader);

                    Auditoria_Area.LOCK(AppContext.ActiveSchema.Code);

                    query  = Auditorias_Areas.SELECT_BY_AUDITORIA(this.Oid);
                    reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _areas = Auditorias_Areas.GetChildList(reader);

                    Cuestion.LOCK(AppContext.ActiveSchema.Code);

                    query       = Cuestiones.SELECT_BY_TIPO_AUDITORIA(this.Oid);
                    reader      = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _cuestiones = Cuestiones.GetChildList(session_code, reader);

                    Plan_Tipo.LOCK(AppContext.ActiveSchema.Code);

                    query         = Planes_Tipos.SELECT_BY_FIELD("OidTipo", this.Oid);
                    reader        = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _planes_tipos = Planes_Tipos.GetChildList(reader);
                }
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }