コード例 #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)
                {
                    Instructor_Promocion.DoLOCK(Session());

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

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

                    if (Childs)
                    {
                        string query;

                        Submodulo_Instructor_Promocion.DoLOCK(Session());

                        query       = Submodulos_Instructores_Promociones.SELECT_BY_INSTRUCTOR_PROMOCION(this.Oid);
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _submodulos = Submodulos_Instructores_Promociones.GetChildList(reader);
                    }
                }
                else
                {
                    _base.Record.CopyValues((Instructor_PromocionRecord)(criteria.UniqueResult()));

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

                    if (Childs)
                    {
                        criteria = Submodulo_Instructor_Promocion.GetCriteria(Session());
                        criteria.AddEq("OidInstructorPromocion", this.Oid);
                        _submodulos = Submodulos_Instructores_Promociones.GetChildList(criteria.List <Submodulo_Instructor_Promocion>());
                    }
                }
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
コード例 #2
0
        public static Submodulo_Instructor_PromocionList GetPromocionList(long oid_promocion)
        {
            string      query  = Submodulos_Instructores_Promociones.SELECT_BY_PROMOCION(oid_promocion);
            IDataReader reader = nHManager.Instance.SQLNativeSelect(query);
            Submodulo_Instructor_PromocionList submodulos = Submodulo_Instructor_PromocionList.GetChildList(reader);

            if (submodulos == null)
            {
                return(null);
            }
            else
            {
                return(submodulos);
            }
        }
コード例 #3
0
        private void Fetch(Instructor_Promocion source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                CriteriaEx criteria;

                criteria = Submodulo_Instructor_Promocion.GetCriteria(Session());
                criteria.AddEq("OidInstructorPromocion", this.Oid);
                _submodulos = Submodulos_Instructores_Promociones.GetChildList(criteria.List <Submodulo_Instructor_Promocion>());
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
コード例 #4
0
        private void Fetch(int session_code, IDataReader source)
        {
            try
            {
                _base.CopyValues(source);

                if (Childs)
                {
                    string query;

                    Submodulo_Instructor_Promocion.DoLOCK(Session(session_code));

                    query = Submodulos_Instructores_Promociones.SELECT_BY_INSTRUCTOR_PROMOCION(this.Oid);
                    IDataReader reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _submodulos = Submodulos_Instructores_Promociones.GetChildList(reader);
                }
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }