Exemple #1
0
        private void Fetch(TipoAuditoria source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                CriteriaEx criteria = Criterio.GetCriteria(Session());
                criteria.AddEq("OidTipoAuditoria", this.Oid);
                _criterios = Criterios.GetChildList(criteria.List <Criterio>());

                criteria = Auditoria_Area.GetCriteria(Session());
                criteria.AddEq("OidAuditoria", this.Oid);
                _areas = Auditorias_Areas.GetChildList(criteria.List <Auditoria_Area>());

                criteria = Cuestion.GetCriteria(Session());
                criteria.AddEq("OidTipoAuditoria", this.Oid);
                _cuestiones = Cuestiones.GetChildList(criteria.List <Cuestion>());

                criteria = Plan_Tipo.GetCriteria(Session());
                criteria.AddEq("OidTipo", this.Oid);
                _planes_tipos = Planes_Tipos.GetChildList(criteria.List <Plan_Tipo>());
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Exemple #2
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);
            }
        }
Exemple #3
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();
        }
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;
                Childs      = criteria.Childs;

                if (nHMng.UseDirectSQL)
                {
                    PlanAnual.DoLOCK(Session());
                    IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session());

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

                    if (Childs)
                    {
                        string query = string.Empty;

                        Plan_Tipo.DoLOCK(Session());
                        query         = Planes_Tipos.SELECT_BY_FIELD("OidPlan", 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);
            }
        }