Beispiel #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();
        }
        public void CopyValues(Auditoria_Area source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);
        }
Beispiel #3
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 #4
0
        /// <summary>
        /// Builds a AuditoriaAreaList
        /// </summary>
        /// <param name="list"></param>
        /// <returns>AuditoriaAreaList</returns>
        public static Auditoria_AreaList GetList(bool childs)
        {
            CriteriaEx criteria = Auditoria_Area.GetCriteria(Auditoria_Area.OpenSession());

            criteria.Childs = childs;


            criteria.Query = Auditoria_AreaList.SELECT();


            Auditoria_AreaList list = DataPortal.Fetch <Auditoria_AreaList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
Beispiel #5
0
        // called to copy objects data from list
        private void Fetch(IDataReader reader)
        {
            this.RaiseListChangedEvents = false;

            IsReadOnly = false;

            while (reader.Read())
            {
                this.AddItem(Auditoria_Area.GetChild(reader).GetInfo());
            }

            IsReadOnly = true;

            this.RaiseListChangedEvents = true;
        }
Beispiel #6
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();
        }
Beispiel #7
0
 public static string SELECT()
 {
     return(Auditoria_Area.SELECT(new QueryConditions(), false));
 }
 public void CopyFrom(Auditoria_Area source)
 {
     _base.CopyValues(source);
 }