Ejemplo n.º 1
0
        private void Fetch(int session_code, IDataReader source)
        {
            try
            {
                _base.CopyValues(source);

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

                    string      query  = Ampliaciones.SELECT_BY_INFORME_AMPLIACION(this.Oid);
                    IDataReader reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _ampliaciones = Ampliaciones.GetChildList(reader);

                    NotificacionInterna.LOCK(AppContext.ActiveSchema.Code);

                    query           = NotificacionesInternas.SELECT_BY_INFORME_AMPLIACION(this.Oid, TipoNotificacionAsociado.SOLICITUD_AMPLIACION);
                    reader          = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _notificaciones = NotificacionesInternas.GetChildList(reader);
                }
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Ejemplo n.º 2
0
        private void Fetch(Auditoria source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                CriteriaEx criteria = CuestionAuditoria.GetCriteria(Session());
                criteria.AddEq("OidAuditoria", this.Oid);
                _cuestiones = CuestionesAuditoria.GetChildList(criteria.List <CuestionAuditoria>());

                criteria = InformeDiscrepancia.GetCriteria(Session());
                criteria.AddEq("OidAuditoria", this.Oid);
                _informes = InformesDiscrepancias.GetChildList(criteria.List <InformeDiscrepancia>());

                criteria = HistoriaAuditoria.GetCriteria(Session());
                criteria.AddEq("OidAuditoria", this.Oid);
                _historial = HistoriaAuditorias.GetChildList(criteria.List <HistoriaAuditoria>());

                criteria = NotificacionInterna.GetCriteria(Session());
                criteria.AddEq("OidAsociado", this.Oid);
                criteria.AddEq("TipoAsociado", (long)TipoNotificacionAsociado.COMUNICADO_AUDITORIA);
                _notificaciones = NotificacionesInternas.GetChildList(criteria.List <NotificacionInterna>());
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Ejemplo n.º 3
0
        private void Fetch(InformeDiscrepancia source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                CriteriaEx criteria = InformeAmpliacion.GetCriteria(Session());
                criteria.AddEq("OidInformeDiscrepancia", this.Oid);
                _ampliaciones = InformesAmpliaciones.GetChildList(criteria.List <InformeAmpliacion>());

                criteria = InformeCorrector.GetCriteria(Session());
                criteria.AddEq("OidInformeDiscrepancia", this.Oid);
                _correctores = InformesCorrectores.GetChildList(criteria.List <InformeCorrector>());

                criteria = Discrepancia.GetCriteria(Session());
                criteria.AddEq("OidInformeDiscrepancia", this.Oid);
                _discrepancias = Discrepancias.GetChildList(criteria.List <Discrepancia>());

                criteria = NotificacionInterna.GetCriteria(Session());
                criteria.AddEq("OidAsociado", this.Oid);
                criteria.AddEq("TipoAsociado", (long)TipoNotificacionAsociado.INFORME_DISCREPANCIAS);
                _notificaciones = NotificacionesInternas.GetChildList(criteria.List <NotificacionInterna>());
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Ejemplo n.º 4
0
        public void CopyValues(NotificacionInterna source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);
        }
Ejemplo n.º 5
0
        // called to retrieve data from the database
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;

                Childs = criteria.Childs;

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

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

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

                        string query = CuestionesAuditoria.SELECT_BY_AUDITORIA(this.Oid);
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _cuestiones = CuestionesAuditoria.GetChildList(reader);

                        InformeDiscrepancia.LOCK(AppContext.ActiveSchema.Code);

                        query     = InformesDiscrepancias.SELECT_BY_AUDITORIA(this.Oid);
                        reader    = nHManager.Instance.SQLNativeSelect(query, Session());
                        _informes = InformesDiscrepancias.GetChildList(criteria.SessionCode, reader);

                        HistoriaAuditoria.LOCK(AppContext.ActiveSchema.Code);

                        query      = HistoriaAuditorias.SELECT_BY_AUDITORIA(Oid);
                        reader     = nHManager.Instance.SQLNativeSelect(query, Session());
                        _historial = HistoriaAuditorias.GetChildList(reader);

                        NotificacionInterna.LOCK(AppContext.ActiveSchema.Code);

                        query           = NotificacionesInternas.SELECT_BY_AUDITORIA(this.Oid, TipoNotificacionAsociado.COMUNICADO_AUDITORIA);
                        reader          = nHManager.Instance.SQLNativeSelect(query, Session());
                        _notificaciones = NotificacionesInternas.GetChildList(reader);
                    }
                }
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
        /// <summary>
        /// Builds a AuditoriaAreaList
        /// </summary>
        /// <param name="list"></param>
        /// <returns>AuditoriaAreaList</returns>
        public static NotificacionInternaList GetList(bool childs)
        {
            CriteriaEx criteria = NotificacionInterna.GetCriteria(NotificacionInterna.OpenSession());

            criteria.Childs = childs;


            criteria.Query = NotificacionInternaList.SELECT();


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

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

            IsReadOnly = false;

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

            IsReadOnly = true;

            this.RaiseListChangedEvents = true;
        }
Ejemplo n.º 8
0
        // called to retrieve data from the database
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;

                Childs = criteria.Childs;

                if (nHMng.UseDirectSQL)
                {
                    InformeCorrector.LOCK(AppContext.ActiveSchema.Code);

                    IDataReader reader = InformeCorrector.DoSELECT(AppContext.ActiveSchema.Code, Session(), criteria.Oid);

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

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

                        string query = AccionesCorrectoras.SELECT_BY_INFORME_CORRECTOR(this.Oid);
                        reader    = nHManager.Instance.SQLNativeSelect(query, Session());
                        _acciones = AccionesCorrectoras.GetChildList(reader);

                        NotificacionInterna.LOCK(AppContext.ActiveSchema.Code);

                        query           = NotificacionesInternas.SELECT_BY_INFORME_CORRECTOR(this.Oid, TipoNotificacionAsociado.INFORME_ACCIONES_CORRECTORAS);
                        reader          = nHManager.Instance.SQLNativeSelect(query, Session());
                        _notificaciones = NotificacionesInternas.GetChildList(reader);
                    }
                }
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
Ejemplo n.º 9
0
        private void Fetch(int session_code, IDataReader source)
        {
            try
            {
                _base.CopyValues(source);

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

                    string      query  = CuestionesAuditoria.SELECT_BY_AUDITORIA(this.Oid);
                    IDataReader reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _cuestiones = CuestionesAuditoria.GetChildList(reader);

                    InformeDiscrepancia.LOCK(AppContext.ActiveSchema.Code);

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

                    HistoriaAuditoria.LOCK(AppContext.ActiveSchema.Code);

                    query      = HistoriaAuditorias.SELECT_BY_AUDITORIA(Oid);
                    reader     = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _historial = HistoriaAuditorias.GetChildList(reader);

                    NotificacionInterna.LOCK(AppContext.ActiveSchema.Code);

                    query           = NotificacionesInternas.SELECT_BY_AUDITORIA(this.Oid, TipoNotificacionAsociado.COMUNICADO_AUDITORIA);
                    reader          = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _notificaciones = NotificacionesInternas.GetChildList(reader);
                }
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Ejemplo n.º 10
0
        private void Fetch(InformeAmpliacion source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                CriteriaEx criteria = Ampliacion.GetCriteria(Session());
                criteria.AddEq("OidInformeAmpliacion", this.Oid);
                _ampliaciones = Ampliaciones.GetChildList(criteria.List <Ampliacion>());

                criteria = NotificacionInterna.GetCriteria(Session());
                criteria.AddEq("OidAsociado", this.Oid);
                criteria.AddEq("TipoAsociado", (long)TipoNotificacionAsociado.SOLICITUD_AMPLIACION);
                _notificaciones = NotificacionesInternas.GetChildList(criteria.List <NotificacionInterna>());
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Ejemplo n.º 11
0
        private void Fetch(InformeCorrector source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                CriteriaEx criteria = AccionCorrectora.GetCriteria(Session());
                criteria.AddEq("OidInformeCorrector", this.Oid);
                _acciones = AccionesCorrectoras.GetChildList(criteria.List <AccionCorrectora>());

                criteria = NotificacionInterna.GetCriteria(Session());
                criteria.AddEq("OidAsociado", this.Oid);
                criteria.AddEq("TipoAsociado", (long)TipoNotificacionAsociado.INFORME_ACCIONES_CORRECTORAS);
                _notificaciones = NotificacionesInternas.GetChildList(criteria.List <NotificacionInterna>());
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Ejemplo n.º 12
0
        // called to retrieve data from the database
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;

                Childs = criteria.Childs;

                if (nHMng.UseDirectSQL)
                {
                    InformeAmpliacion.LOCK(AppContext.ActiveSchema.Code);

                    IDataReader reader = InformeAmpliacion.DoSELECT(AppContext.ActiveSchema.Code, Session(), criteria.Oid);

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

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

                        string query = Ampliaciones.SELECT_BY_INFORME_AMPLIACION(this.Oid);
                        reader        = nHManager.Instance.SQLNativeSelect(query, Session());
                        _ampliaciones = Ampliaciones.GetChildList(reader);

                        NotificacionInterna.LOCK(AppContext.ActiveSchema.Code);
                        query           = NotificacionesInternas.SELECT_BY_INFORME_AMPLIACION(this.Oid, TipoNotificacionAsociado.SOLICITUD_AMPLIACION);
                        reader          = nHManager.Instance.SQLNativeSelect(query, Session());
                        _notificaciones = NotificacionesInternas.GetChildList(reader);
                    }
                }
                else
                {
                    _base.Record.CopyValues((InformeAmpliacionRecord)(criteria.UniqueResult()));

                    Session().Lock(Session().Get <InformeAmpliacionRecord>(Oid), LockMode.UpgradeNoWait);

                    if (Childs)
                    {
                        criteria = Ampliacion.GetCriteria(Session());
                        criteria.AddEq("OidInformeAmpliacion", this.Oid);
                        _ampliaciones = Quality.Ampliaciones.GetChildList(criteria.List <Ampliacion>());

                        criteria = NotificacionInterna.GetCriteria(Session());
                        criteria.AddEq("OidAsociado", this.Oid);
                        criteria.AddEq("TipoAsociado", (long)TipoNotificacionAsociado.SOLICITUD_AMPLIACION);
                        _notificaciones = Quality.NotificacionesInternas.GetChildList(criteria.List <NotificacionInterna>());
                    }
                }
            }
            catch (NHibernate.ADOException)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                throw new iQLockException(moleQule.Library.Resources.Messages.LOCK_ERROR);
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
 public static string SELECT()
 {
     return(NotificacionInterna.SELECT(new QueryConditions(), false));
 }
 public void CopyFrom(NotificacionInterna source)
 {
     _base.CopyValues(source);
 }