private void DataPortal_Create(CriteriaCs criteria)
        {
            Random r = new Random();

            Oid = (long)r.Next();
            GetNewCode();

            _c_profesores  = Curso_Instructors.NewChildList();
            _convocatorias = Convocatoria_Cursos.NewChildList();
            _materiales    = MaterialDocentes.NewChildList();
        }
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;
                Childs      = criteria.Childs;

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

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

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

                        Curso_Instructor.DoLOCK(Session());

                        query         = Curso_Instructors.SELECT_BY_CURSO(this.Oid);
                        reader        = nHManager.Instance.SQLNativeSelect(query, Session());
                        _c_profesores = Curso_Instructors.GetChildList(reader);

                        Convocatoria_Curso.DoLOCK(Session());

                        query          = Convocatoria_Cursos.SELECT_BY_CURSO(this.Oid);
                        reader         = nHManager.Instance.SQLNativeSelect(query, Session());
                        _convocatorias = Convocatoria_Cursos.GetChildList(criteria.SessionCode, reader);

                        MaterialDocente.DoLOCK(Session());

                        query       = MaterialDocentes.SELECT_BY_CURSO(this.Oid);
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _materiales = MaterialDocentes.GetChildList(criteria.SessionCode, reader);
                    }
                }
            }
            catch (Exception exception)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(exception);
            }
        }