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();
        }
Exemple #3
0
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClasePracticaList</returns>
        public static ClasePracticaList GetProgramadasList(long oid_plan, long oid_promocion)
        {
            CriteriaEx criteria = ClasePractica.GetCriteria(ClasePractica.OpenSession());

            //No criteria. Retrieve all de List
            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = ClasePracticas.SELECT_CLASES_PRACTICAS_PROGRAMADAS(oid_plan, oid_promocion);
            }
            ClasePracticaList list = DataPortal.Fetch <ClasePracticaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
Exemple #4
0
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClasePracticaList</returns>
        public static ClasePracticaList GetClasesOrdenadasPlanList(long oid_plan, long oid_promocion = 0, int grupo = 0)
        {
            CriteriaEx criteria = ClasePractica.GetCriteria(ClasePractica.OpenSession());

            //No criteria. Retrieve all de List
            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = ClasePracticas.SELECT_CLASES_PRACTICAS_PLAN_ORDENADAS(oid_plan, oid_promocion, grupo);
            }
            ClasePracticaList list = DataPortal.Fetch <ClasePracticaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
Exemple #5
0
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClasePracticaList</returns>
        public static ClasePracticaList GetDisponiblesList(long oid_plan, long oid_promocion, long oid_horario, long grupo)
        {
            CriteriaEx criteria = ClasePractica.GetCriteria(ClasePractica.OpenSession());

            criteria.Childs = false;

            //No criteria. Retrieve all de List
            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = ClasePracticas.SELECT_CLASES_PRACTICAS_DISPONIBLES(oid_plan, oid_promocion, oid_horario, grupo);
            }
            ClasePracticaList list = DataPortal.Fetch <ClasePracticaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
Exemple #6
0
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClasePracticaList</returns>
        public static ClasePracticaList GetClasesPlanList(long oid_plan)
        {
            CriteriaEx criteria = ClasePractica.GetCriteria(ClasePractica.OpenSession());

            criteria.Childs = false;

            //No criteria. Retrieve all de List
            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = ClasePracticas.SELECT_CLASES_PRACTICAS_PLAN(oid_plan);
            }
            ClasePracticaList list = DataPortal.Fetch <ClasePracticaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
Exemple #7
0
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClasePracticaList</returns>
        public static ClasePracticaList GetList(bool childs)
        {
            CriteriaEx criteria = ClasePractica.GetCriteria(ClasePractica.OpenSession());

            criteria.Childs = childs;

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

            CloseSession(criteria.SessionCode);

            return(list);
        }
Exemple #8
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(ClasePracticas list)
 {
     return(GetDetailReport(ClasePracticaList.GetChildList(list)));
 }
Exemple #10
0
 public static string SELECT_BY_SUBMODULO(long oid_submodulo)
 {
     return(ClasePracticas.SELECT_BY_SUBMODULO(oid_submodulo, false));
 }