public IList <RandomExamStrategy> GetTotalRandomExamStrategys(int SubjectID)
        {
            SystemVersionDAL systemVersionDal = new SystemVersionDAL();
            int usePlace = systemVersionDal.GetUsePlace();

            IList <RandomExamStrategy> items = new List <RandomExamStrategy>();

            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_Random_Exam_Strategy_Q_T";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_subject_id", DbType.Int32, SubjectID);
            db.AddInParameter(dbCommand, "p_range_id", DbType.Int32, 0);
            db.AddInParameter(dbCommand, "p_range_type", DbType.Int32, 0);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    RandomExamStrategy item = CreateModelObject(dataReader);
                    if (usePlace == 3)
                    {
                        item.MaxItemDifficultyID   = Convert.ToInt32(dataReader[GetMappingFieldName("MaxItemDifficultyID")].ToString());
                        item.MaxItemDifficultyName = dataReader[GetMappingFieldName("MaxItemDifficultyName")].ToString();
                    }
                    item.TotalItemCount = Convert.ToInt32(dataReader[GetMappingFieldName("TotalItemCount")].ToString());
                    item.SelectCount    = Convert.ToInt32(dataReader[GetMappingFieldName("SelectCount")].ToString());
                    items.Add(item);
                }
            }

            return(items);
        }
        public IList <RandomExamStrategy> GetRandomExamStrategysByExamID(int RandomExamID)
        {
            SystemVersionDAL systemVersionDal = new SystemVersionDAL();
            int usePlace = systemVersionDal.GetUsePlace();

            IList <RandomExamStrategy> items = new List <RandomExamStrategy>();

            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_Random_Exam_Strategy_F";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_RANDOM_EXAM_ID", DbType.Int32, RandomExamID);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    RandomExamStrategy item = CreateModelObject(dataReader);
                    if (usePlace == 3)
                    {
                        item.MaxItemDifficultyID   = Convert.ToInt32(dataReader[GetMappingFieldName("MaxItemDifficultyID")].ToString());
                        item.MaxItemDifficultyName = dataReader[GetMappingFieldName("MaxItemDifficultyName")].ToString();
                    }
                    items.Add(item);
                }
            }

            return(items);
        }
        public RandomExamStrategy GetRandomExamStrategy(int ExamStrategyId)
        {
            SystemVersionDAL systemVersionDal = new SystemVersionDAL();
            int usePlace = systemVersionDal.GetUsePlace();

            RandomExamStrategy item = null;

            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_Random_Exam_Strategy_g";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_Random_Exam_Strategy_Id", DbType.Int32, ExamStrategyId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    item = CreateModelObject(dataReader);
                    if (usePlace == 3)
                    {
                        item.MaxItemDifficultyID   = Convert.ToInt32(dataReader[GetMappingFieldName("MaxItemDifficultyID")].ToString());
                        item.MaxItemDifficultyName = dataReader[GetMappingFieldName("MaxItemDifficultyName")].ToString();
                    }
                    break;
                }
            }

            return(item);
        }