コード例 #1
0
        /// <summary>
        ///  To Fill Content module tracking object properties valus from reader data
        /// </summary>
        /// <param name="pReader"></param>
        /// <returns>ContentModuleTracking object</returns>
        private ContentModuleTracking FillObject(SqlDataReader pReader, SQLObject pSqlObject)
        {
            ContentModuleTracking entContModuleTracking = new ContentModuleTracking();
            int iIndex;

            if (pReader.HasRows)
            {
                while (pReader.Read())
                {
                    iIndex = pReader.GetOrdinal(Schema.Common.COL_ATTEMPT_ID);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.ID = pReader.GetString(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModule.COL_CONTENT_MODULE_ID);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.ContentModuleId = pReader.GetString(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.Learner.COL_USER_ID);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.UserID = pReader.GetString(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_DATE_OF_START);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.DateOfStart = pReader.GetDateTime(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_DATE_OF_COMPLETION);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.DateOfCompletion = pReader.GetDateTime(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_TOTAL_NO_OF_PAGES);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.TotalNoOfPages = pReader.GetInt32(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_NO_OF_PAGES_COMPLETED);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.NoOfPagesCompleted = pReader.GetInt32(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_COMPLETION_STATUS);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.CompletionStatus = (ActivityCompletionStatus)Enum.Parse(typeof(ActivityCompletionStatus), pReader.GetString(iIndex));
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_USER_DATA_XML);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.UserDataXML = pReader.GetString(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_SCORE);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.Score = pReader.GetString(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_MARKED_COMPLETED_BY_ID);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.MarkedCompletedById = pReader.GetString(iIndex);
                    }

                    iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_SCANNED_CERTIFICATION_FILE_NAME);
                    if (!pReader.IsDBNull(iIndex))
                    {
                        entContModuleTracking.ScannedCertificationFileName = pReader.GetString(iIndex);
                    }

                    if (pSqlObject.ReaderHasColumn(pReader, Schema.ContentModuleTracking.COL_ACTIVITY_NAME))
                    {
                        iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_ACTIVITY_NAME);
                        if (!pReader.IsDBNull(iIndex))
                        {
                            entContModuleTracking.ActivityName = pReader.GetString(iIndex);
                        }
                    }
                    if (pSqlObject.ReaderHasColumn(pReader, Schema.ContentModuleTracking.COL_USER_FIRST_LAST_NAME))
                    {
                        iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_USER_FIRST_LAST_NAME);
                        if (!pReader.IsDBNull(iIndex))
                        {
                            entContModuleTracking.UserFirstLastName = pReader.GetString(iIndex);
                        }
                    }
                    if (pSqlObject.ReaderHasColumn(pReader, Schema.ContentModuleTracking.COL_REVIEWER_COMMENTS))
                    {
                        iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_REVIEWER_COMMENTS);
                        if (!pReader.IsDBNull(iIndex))
                        {
                            entContModuleTracking.ReviewComments = pReader.GetString(iIndex);
                        }
                    }
                    if (pSqlObject.ReaderHasColumn(pReader, Schema.ContentModuleTracking.COL_REGION_VIEW_INFO))
                    {
                        iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_REGION_VIEW_INFO);
                        if (!pReader.IsDBNull(iIndex))
                        {
                            entContModuleTracking.RegionViewInfo = pReader.GetString(iIndex);
                        }
                    }
                    if (pSqlObject.ReaderHasColumn(pReader, Schema.ContentModuleTracking.COL_IS_FOR_ADMIN_PREVIEW))
                    {
                        iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_IS_FOR_ADMIN_PREVIEW);
                        if (!pReader.IsDBNull(iIndex))
                        {
                            entContModuleTracking.IsForAdminPreview = pReader.GetBoolean(iIndex);
                        }
                    }

                    if (pSqlObject.ReaderHasColumn(pReader, Schema.ContentModuleTracking.COL_VENDORCODE))
                    {
                        iIndex = pReader.GetOrdinal(Schema.ContentModuleTracking.COL_VENDORCODE);
                        if (!pReader.IsDBNull(iIndex))
                        {
                            entContModuleTracking.VendorCode = pReader.GetString(iIndex);
                        }
                    }
                }
            }
            return(entContModuleTracking);
        }
コード例 #2
0
        public Learner FillUserObject_CoursePlayer(SqlDataReader pSqlReader)
        {
            _entLearner = new Learner();
            int index;

            if (pSqlReader.HasRows)
            {
                if (_sqlObject.ReaderHasColumn(pSqlReader, Schema.Learner.COL_USER_ID))
                {
                    index = pSqlReader.GetOrdinal(Schema.Learner.COL_USER_ID);
                    if (!pSqlReader.IsDBNull(index))
                    {
                        _entLearner.ID = pSqlReader.GetString(index);
                    }
                }

                if (_sqlObject.ReaderHasColumn(pSqlReader, Schema.Learner.COL_LEARNERID))
                {
                    index = pSqlReader.GetOrdinal(Schema.Learner.COL_LEARNERID);
                    if (!pSqlReader.IsDBNull(index))
                    {
                        _entLearner.LearnerId = pSqlReader.GetString(index);
                    }
                }

                index = pSqlReader.GetOrdinal(Schema.Learner.COL_FIRST_NAME);
                if (!pSqlReader.IsDBNull(index))
                {
                    _entLearner.FirstName = pSqlReader.GetString(index);
                }
                else
                {
                    _entLearner.FirstName = "";
                }

                index = pSqlReader.GetOrdinal(Schema.Learner.COL_LAST_NAME);
                if (!pSqlReader.IsDBNull(index))
                {
                    _entLearner.LastName = pSqlReader.GetString(index);
                }
                else
                {
                    _entLearner.LastName = "";
                }

                //index = pSqlReader.GetOrdinal(Schema.Learner.COL_USER_NAME_ALIAS);
                //if (!pSqlReader.IsDBNull(index))
                //    _entLearner.UserName = pSqlReader.GetString(index);
                //else
                //    _entLearner.UserName = "";

                ////index = pSqlReader.GetOrdinal(Schema.Learner.COL_USER_MANAGEREMAIL);
                ////if (!pSqlReader.IsDBNull(index))
                ////    _entLearner.ManagerEmailId = pSqlReader.GetString(index);
                ////else
                ////    _entLearner.ManagerEmailId = "";

                //index = pSqlReader.GetOrdinal(Schema.Learner.COL_USER_STUDENTEMAIL);
                //if (!pSqlReader.IsDBNull(index))
                //    _entLearner.Email = pSqlReader.GetString(index);
                //else
                //    _entLearner.Email = "";

                //index = pSqlReader.GetOrdinal(Schema.Learner.COL_DEFAULT_LANGUAGE_ID);
                //if (!pSqlReader.IsDBNull(index))
                //    _entLearner.DefaultLanguageId = pSqlReader.GetString(index);

                //index = pSqlReader.GetOrdinal(Schema.Client.COL_CLIENT_ID);
                //if (!pSqlReader.IsDBNull(index))
                //    _entLearner.ClientId = pSqlReader.GetString(index);

                //index = pSqlReader.GetOrdinal(Schema.Learner.COL_DEFAULT_RV);
                //if (!pSqlReader.IsDBNull(index))
                //    _entLearner.DefaultRegionView = pSqlReader.GetString(index);

                //index = pSqlReader.GetOrdinal(Schema.Learner.COL_CURRENT_RV);
                //if (!pSqlReader.IsDBNull(index))
                //    _entLearner.CurrentRegionView = pSqlReader.GetString(index);

                //index = pSqlReader.GetOrdinal(Schema.Learner.COL_RV_NAME);
                //if (!pSqlReader.IsDBNull(index))
                //    _entLearner.RegionViewName = pSqlReader.GetString(index);
                //else
                //    _entLearner.RegionViewName = String.Empty;

                //if (_sqlObject.ReaderHasColumn(pSqlReader, Schema.Learner.COL_AV_PATH))
                //{
                //    index = pSqlReader.GetOrdinal(Schema.Learner.COL_AV_PATH);
                //    if (!pSqlReader.IsDBNull(index))
                //        _entLearner.AvPath = pSqlReader.GetString(index);
                //    else
                //        _entLearner.AvPath = String.Empty;
                //}
            }
            return(_entLearner);
        }
コード例 #3
0
        /// <summary>
        /// Fill Object
        /// </summary>
        /// <param name="pSqlreader"></param>
        /// <param name="pSqlObject"></param>
        /// <returns></returns>
        private CourseConfiguration FillObject(SqlDataReader pSqlreader, SQLObject pSqlObject)
        {
            _entCourseConfiguration = new CourseConfiguration();
            int iIndex;

            if (pSqlreader.HasRows)
            {
                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_ALLOW_RESIZE);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.AllowResize = pSqlreader.GetBoolean(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_ALLOW_SCROLL);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.AllowScroll = pSqlreader.GetBoolean(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_AV_PATH);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.AVPath = pSqlreader.GetString(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_CLIENT_ID);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.ClientId = pSqlreader.GetString(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_COURSE_CONFIGURATION_ID);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.ID = pSqlreader.GetString(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_COURSE_LAUNCH_NEW_WINDOW);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.CourseLaunchNewWindow = pSqlreader.GetBoolean(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_COURSE_LAUNCH_SAME_WINDOW);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.CourseLaunchSameWindow = pSqlreader.GetBoolean(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_COURSE_WINDOW_HEIGHT);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.CourseWindowHeight = pSqlreader.GetInt32(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_COURSE_WINDOW_WIDTH);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.CourseWindowWidth = pSqlreader.GetInt32(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_IS_COURSE_SESSION_NO_EXPIRY);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.IsCourseSessionNoExpiry = pSqlreader.GetBoolean(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_MASTERY_SCORE);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.MasteryScore = pSqlreader.GetInt32(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_MAX_FILE_UPLOAD_SIZE_MB);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.MaxFileUploadSizeMB = pSqlreader.GetInt32(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_QUESTION_RESPONSE_TRACKING);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.QuestionResponseTracking = pSqlreader.GetBoolean(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_SCORE_TRACKING);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.ScoreTracking = pSqlreader.GetBoolean(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.Common.COL_CREATED_BY);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.CreatedById = pSqlreader.GetString(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.Common.COL_CREATED_ON);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.DateCreated = pSqlreader.GetDateTime(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.Common.COL_MODIFIED_BY);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.LastModifiedById = pSqlreader.GetString(iIndex);
                }

                iIndex = pSqlreader.GetOrdinal(Schema.Common.COL_MODIFIED_ON);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.LastModifiedDate = pSqlreader.GetDateTime(iIndex);
                }

                if (pSqlObject.ReaderHasColumn(pSqlreader, Schema.AVPathSetting.COL_IS_SAME_FOR_ALL))
                {
                    iIndex = pSqlreader.GetOrdinal(Schema.AVPathSetting.COL_IS_SAME_FOR_ALL);
                    if (!pSqlreader.IsDBNull(iIndex))
                    {
                        _entCourseConfiguration.IsSameAVPathForAll = pSqlreader.GetBoolean(iIndex);
                    }
                }

                //-aw 6/15/2011 Added course protocol
                iIndex = pSqlreader.GetOrdinal(Schema.CourseConfiguration.COL_PROTOCOL);
                if (!pSqlreader.IsDBNull(iIndex))
                {
                    _entCourseConfiguration.Protocol = pSqlreader.GetString(iIndex);
                }
            }
            return(_entCourseConfiguration);
        }