示例#1
0
        private void Fetch(int session_code, IDataReader source)
        {
            try
            {
                _base.CopyValues(source);

                if (Childs)
                {
                    RevisionMaterial.DoLOCK(Session(session_code));

                    string      query  = RevisionMaterials.SELECT_BY_MATERIAL(this.Oid);
                    IDataReader reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _revisiones = RevisionMaterials.GetChildList(session_code, reader);

                    Material_Plan.DoLOCK(Session(session_code));

                    query   = Material_Plans.SELECT(GetInfo(false));
                    reader  = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _planes = Material_Plans.GetChildList(reader);

                    Material_Alumno.DoLOCK(Session(session_code));

                    query    = Material_Alumnos.SELECT_BY_MATERIAL(this.Oid);
                    reader   = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _alumnos = Material_Alumnos.GetChildList(reader);
                }
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
示例#2
0
        private void Fetch(MaterialDocente source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                CriteriaEx criteria = RevisionMaterial.GetCriteria(Session());
                criteria.AddEq("OidMaterial", this.Oid);
                _revisiones = RevisionMaterials.GetChildList(criteria.List <RevisionMaterial>());

                criteria = Material_Plan.GetCriteria(Session());
                criteria.AddEq("OidMaterial", this.Oid);
                _planes = Material_Plans.GetChildList(criteria.List <Material_Plan>());

                criteria = Material_Alumno.GetCriteria(Session());
                criteria.AddEq("OidMaterial", this.Oid);
                _alumnos = Material_Alumnos.GetChildList(criteria.List <Material_Alumno>());
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
示例#3
0
        // called to retrieve data from the database
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;

                Childs = criteria.Childs;

                if (nHMng.UseDirectSQL)
                {
                    RevisionMaterial.DoLOCK(Session());

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

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

                    if (Childs)
                    {
                        Material_Plan.DoLOCK(Session());

                        string query = Material_Plans.SELECT(GetInfo(false));
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _materiales = Material_Plans.GetChildList(reader);
                    }
                }
                else
                {
                    _base.Record.CopyValues((RevisionMaterialRecord)(criteria.UniqueResult()));

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

                    if (Childs)
                    {
                        criteria = Material_Plan.GetCriteria(Session());
                        criteria.AddEq("OidRevision", this.Oid);
                        _materiales = Material_Plans.GetChildList(criteria.List <Material_Plan>());
                    }
                }
            }
            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);
            }
        }
示例#4
0
 public virtual void LoadChilds(Type type, bool get_childs, bool get_gchilds)
 {
     if (type.Equals(typeof(Submodulos)))
     {
         _submodulos = Submodulos.GetChildList(this, get_childs, get_gchilds);
     }
     else if (type.Equals(typeof(Material_Plans)))
     {
         _materiales = Material_Plans.GetChildList(this, get_childs);
     }
 }
示例#5
0
        private void DataPortal_Create(CriteriaCs criteria)
        {
            Random r = new Random();

            Oid    = (long)r.Next();
            Codigo = (0).ToString(Resources.Defaults.MODULO_CODE_FORMAT);
            //_preguntas = Preguntas.NewChildList();
            //_p_examenes = PreguntaExamens.NewChildList();
            _submodulos = Submodulos.NewChildList();
            //_examenes = Examens.NewChildList();
            _materiales = Material_Plans.NewChildList();
            //_plantillas = PlantillaExamenes.NewChildList();
        }
示例#6
0
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;
                Childs      = criteria.Childs;

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

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

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

                        Submodulo.DoLOCK(Session());
                        query       = Submodulos.SELECT_BY_MODULO(this.Oid);
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _submodulos = Submodulos.GetChildList(criteria.SessionCode, reader);

                        Material_Plan.DoLOCK(Session());
                        query       = Material_Plans.SELECT(GetInfo(false));
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _materiales = Material_Plans.GetChildList(reader);
                    }
                }
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
示例#7
0
        private void Fetch(RevisionMaterial source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                CriteriaEx criteria = Material_Plan.GetCriteria(Session());
                criteria.AddEq("OidRevision", this.Oid);
                criteria.AddOrder("Fecha", true);
                _materiales = Material_Plans.GetChildList(criteria.List <Material_Plan>());
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
示例#8
0
        private void Fetch(int session_code, IDataReader source)
        {
            try
            {
                _base.CopyValues(source);

                if (Childs)
                {
                    Material_Plan.DoLOCK(Session(session_code));

                    string      query  = Material_Plans.SELECT(GetInfo(false));
                    IDataReader reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code));
                    _materiales = Material_Plans.GetChildList(reader);
                }
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
示例#9
0
 public static string SELECT_BY_FIELD(string parent_field, object field_value)
 {
     return(Material_Plans.SELECT_BY_FIELD(parent_field, field_value, false));
 }