Exemple #1
0
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;
                Childs      = criteria.Childs;

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

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

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

                        ClaseTeorica.DoLOCK(Session());
                        query       = ClaseTeoricas.SELECT_BY_PLAN(this.Oid);
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _c_teoricas = ClaseTeoricas.GetChildList(reader);

                        ClasePractica.DoLOCK(Session());
                        query        = ClasePracticas.SELECT_BY_PLAN(this.Oid);
                        reader       = nHManager.Instance.SQLNativeSelect(query, Session());
                        _c_practicas = ClasePracticas.GetChildList(reader);
                    }
                }
                else
                {
                    _base.Record.CopyValues((PlanEstudiosRecord)(criteria.UniqueResult()));
                    //Session().Lock(Session().Get<PlanEstudiosRecord>(Oid), LockMode.UpgradeNoWait);

                    if (Childs)
                    {
                        criteria = ClaseTeorica.GetCriteria(Session());
                        criteria.AddEq("OidPlan", this.Oid);
                        _c_teoricas = ClaseTeoricas.GetChildList(criteria.List <ClaseTeorica>());

                        criteria = ClasePractica.GetCriteria(Session());
                        criteria.AddEq("OidPlan", this.Oid);
                        _c_practicas = ClasePracticas.GetChildList(criteria.List <ClasePractica>());
                    }
                }
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
Exemple #2
0
        private void DataPortal_Create(CriteriaCs criteria)
        {
            Random r = new Random();

            Oid = (long)r.Next();

            _c_teoricas  = ClaseTeoricas.NewChildList();
            _c_practicas = ClasePracticas.NewChildList();
        }
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClaseTeoricaList</returns>
        public static ClaseTeoricaList GetProgramadasList(long oid_plan, long oid_promocion)
        {
            CriteriaEx criteria = ClaseTeorica.GetCriteria(ClaseTeorica.OpenSession());

            //No criteria. Retrieve all de List
            criteria.Query = ClaseTeoricas.SELECT_CLASES_TEORICAS_PROGRAMADAS(oid_plan, oid_promocion);
            ClaseTeoricaList list = DataPortal.Fetch <ClaseTeoricaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClaseTeoricaList</returns>
        public static ClaseTeoricaList GetDisponiblesList(long oid_plan, long oid_promocion, long oid_horario)
        {
            CriteriaEx criteria = ClaseTeorica.GetCriteria(ClaseTeorica.OpenSession());

            //No criteria. Retrieve all de List
            criteria.Query = ClaseTeoricas.SELECT_CLASES_TEORICAS_DISPONIBLES(oid_plan, oid_promocion, oid_horario);
            ClaseTeoricaList list = DataPortal.Fetch <ClaseTeoricaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
        }/// <summary>

        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClaseTeoricaList</returns>
        public static ClaseTeoricaList GetClasesPlanList(long oid_plan)
        {
            CriteriaEx criteria = ClaseTeorica.GetCriteria(ClaseTeorica.OpenSession());

            //No criteria. Retrieve all de List
            criteria.Query = ClaseTeoricas.SELECT_CLASES_TEORICAS_PLAN(oid_plan);
            ClaseTeoricaList list = DataPortal.Fetch <ClaseTeoricaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
        //  private ClaseTeoricaList() { }

        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClaseTeoricaList</returns>
        public static ClaseTeoricaList GetList()
        {
            CriteriaEx criteria = ClaseTeorica.GetCriteria(ClaseTeorica.OpenSession());

            //No criteria. Retrieve all de List
            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = ClaseTeoricas.SELECT();
            }
            ClaseTeoricaList list = DataPortal.Fetch <ClaseTeoricaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
Exemple #7
0
        /// <summary>
        /// Función para la unión de dos planes de estudio
        /// </summary>
        /// <param name="oid"></param>
        public virtual void Merge(long oid)
        {
            PlanEstudios merge_plan = PlanEstudios.Get(oid, true);

            ClaseTeoricas cteoricas = merge_plan.CTeoricas.Clone();

            foreach (ClaseTeorica ct in cteoricas)
            {
                CTeoricas.Add(ct);
            }

            ClasePracticas cpracticas = merge_plan.CPracticas.Clone();

            foreach (ClasePractica cp in cpracticas)
            {
                CPracticas.Add(cp);
            }

            merge_plan.CloseSession();
        }
 public ClasesRpt GetDetailReport(ClaseTeoricas list)
 {
     return(GetDetailReport(ClaseTeoricaList.GetChildList(list)));
 }
 public static string SELECT_BY_SUBMODULO(long oid_submodulo)
 {
     return(ClaseTeoricas.SELECT_BY_SUBMODULO(oid_submodulo, false));
 }