예제 #1
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();
        }
예제 #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)
                {
                    Cuestion.LOCK(AppContext.ActiveSchema.Code);

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

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

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

                        string query = CuestionesAuditoria.SELECT_BY_CUESTION(this.Oid);
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _cuestiones = CuestionesAuditoria.GetChildList(reader);
                    }
                }
                else
                {
                    _base.Record.CopyValues((CuestionRecord)(criteria.UniqueResult()));

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

                    if (Childs)
                    {
                        criteria = CuestionAuditoria.GetCriteria(Session());
                        criteria.AddEq("OidCuestion", this.Oid);
                        _cuestiones = CuestionesAuditoria.GetChildList(criteria.List <CuestionAuditoria>());
                    }
                }
            }
            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);
            }
        }
예제 #3
0
        public void CopyValues(CuestionAuditoria source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);
        }
예제 #4
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 CuestionauditoriaList
        /// </summary>
        /// <param name="list"></param>
        /// <returns>CuestionauditoriaList</returns>
        public static CuestionAuditoriaList GetList(bool childs)
        {
            CriteriaEx criteria = CuestionAuditoria.GetCriteria(CuestionAuditoria.OpenSession());

            criteria.Childs = childs;


            criteria.Query = CuestionAuditoriaList.SELECT();


            CuestionAuditoriaList list = DataPortal.Fetch <CuestionAuditoriaList>(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(CuestionAuditoria.GetChild(reader).GetInfo());
            }

            IsReadOnly = true;

            this.RaiseListChangedEvents = true;
        }
예제 #7
0
        private void Fetch(Cuestion source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                CriteriaEx criteria = CuestionAuditoria.GetCriteria(Session());
                criteria.AddEq("OidCuestion", this.Oid);
                _cuestiones = CuestionesAuditoria.GetChildList(criteria.List <CuestionAuditoria>());
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
예제 #8
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();
        }
예제 #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_CUESTION(this.Oid);
                    IDataReader reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _cuestiones = CuestionesAuditoria.GetChildList(reader);
                }
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
예제 #10
0
 public void CopyFrom(CuestionAuditoria source)
 {
     _base.CopyValues(source);
 }