Example #1
0
        internal void Update(ClasePractica parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            //Debe obtener la SesionCronograma del padre pq el objeto es padre a su vez
            SessionCode = parent.SessionCode;

            OidClasePractica = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                SesionCronogramaRecord obj = parent.Session().Get <SesionCronogramaRecord>(Oid);
                obj.CopyValues(this.Base.Record);
                parent.Session().Update(obj);

                //_asistencias.Update(this);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Example #2
0
        internal void DeleteSelf(ClasePractica parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            // if we're new then don't update the database
            if (this.IsNew)
            {
                return;
            }

            try
            {
                SessionCode = parent.SessionCode;
                Session().Delete(Session().Get <SesionCronogramaRecord>(Oid));
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkNew();
        }
        internal void Update(ClasePractica parent)
        {
            this.RaiseListChangedEvents = false;

            // update (thus deleting) any deleted child objects
            foreach (Sesion obj in DeletedList)
            {
                obj.DeleteSelf(parent);
            }

            // now that they are deleted, remove them from memory too
            DeletedList.Clear();

            // AddItem/update any current child objects
            foreach (Sesion obj in this)
            {
                if (obj.IsNew)
                {
                    obj.Insert(parent);
                }
                else
                {
                    obj.Update(parent);
                }
            }

            this.RaiseListChangedEvents = true;
        }
Example #4
0
        internal void Insert(ClasePractica parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            //Debe obtener la sesion del padre pq el objeto es padre a su vez
            SessionCode = parent.SessionCode;

            OidClasePractica = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                parent.Session().Save(this.Base.Record);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
        internal void Update(ClasePractica parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            OidClasePractica = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                AlumnoPracticaRecord obj = parent.Session().Get <AlumnoPracticaRecord>(Oid);
                obj.CopyValues(this.Base.Record);
                parent.Session().Update(obj);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Example #6
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);
            }
        }
Example #7
0
        // called to copy objects data from list
        private void Fetch(IDataReader reader)
        {
            while (reader.Read())
            {
                this.AddItem(ClasePractica.GetChild(reader).GetInfo());
            }

            this.RaiseListChangedEvents = true;
        }
Example #8
0
        public static SesionCronograma NewChild(ClasePractica parent)
        {
            if (!CanAddObject())
            {
                throw new System.Security.SecurityException(
                          moleQule.Library.Resources.Messages.USER_NOT_ALLOWED);
            }

            SesionCronograma obj = new SesionCronograma();

            obj.OidClasePractica = parent.Oid;
            return(obj);
        }
Example #9
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);
        }
        public void CopyValues(ClasePractica source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);

            _modulo       = source.Modulo;
            _submodulo    = source.Submodulo;
            _codigo_orden = source.CodigoOrden;
            _estado       = source.Estado;
            _grupo        = source.Grupo;
        }
Example #11
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);
        }
Example #12
0
        public static ClasePracticaList GetListBySubmodulo(long oid)
        {
            CriteriaEx criteria = ClasePractica.GetCriteria(ClasePractica.OpenSession());

            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = ClasePracticaList.SELECT_BY_SUBMODULO(oid);
            }

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

            CloseSession(criteria.SessionCode);

            return(list);
        }
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <param name="get_childs">retrieving the childs</param>
        /// <returns></returns>
        public static NotaPracticasList GetListByAlumno(bool childs, long oid_alumno)
        {
            CriteriaEx criteria = ClasePractica.GetCriteria(ClasePractica.OpenSession());

            criteria.Childs = childs;

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
Example #14
0
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>ClasePracticaList</returns>
        public static ClasePracticaList GetImpartidasList(long oid_promocion, DateTime fecha, long grupo)
        {
            CriteriaEx criteria = ClasePractica.GetCriteria(ClasePractica.OpenSession());

            criteria.Childs = false;

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

            CloseSession(criteria.SessionCode);

            return(list);
        }
Example #15
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);
        }
Example #16
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);
        }
Example #17
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);
        }
 public Alumno_Practica NewItem(ClasePractica parent)
 {
     this.AddItem(Alumno_Practica.NewChild(parent));
     return(this[Count - 1]);
 }
Example #19
0
 public void CopyFrom(ClasePractica source)
 {
     _base.CopyValues(source);
 }
 public Sesion NewItem(ClasePractica parent)
 {
     this.AddItem(Sesion.NewChild(parent));
     return(this[Count - 1]);
 }