예제 #1
0
        ///add by qizq 2012-9-11
        /// <summary>
        /// 根据试卷id,题型,判断是否有该题型
        /// </summary>
        /// <returns></returns>
        public DataTable HaveAskCategoryByEPID(string epid, int askcategory)
        {
            QueryExamBigQuestion query = new QueryExamBigQuestion();

            query.EPID        = CommonFunction.ObjectToInteger(epid, -1);
            query.AskCategory = askcategory;
            DataTable dt    = new DataTable();
            int       count = 0;

            dt = GetExamBigQuestion(query, "createtime asc", 1, 1000000, out count);
            return(dt);
        }
예제 #2
0
        /// <summary>
        /// 按照查询条件查询
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <param name="order">排序</param>
        /// <param name="currentPage">页号,-1不分页</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="totalCount">总行数</param>
        /// <returns>集合</returns>
        public DataTable GetExamBigQuestion(QueryExamBigQuestion query, string order, int currentPage, int pageSize, out int totalCount)
        {
            string where = string.Empty;
            if (query.EPID != Constant.INT_INVALID_VALUE)
            {
                where += " and EPID=" + query.EPID;
            }
            if (query.BQID != Constant.INT_INVALID_VALUE)
            {
                where += " and b.BQID=" + query.BQID;
            }
            if (query.Name != Constant.STRING_INVALID_VALUE)
            {
                where += " and Name like '%" + StringHelper.SqlFilter(query.Name) + "%'";
            }
            if (query.BQDesc != Constant.STRING_INVALID_VALUE)
            {
                where += " and BQDesc like '%" + StringHelper.SqlFilter(query.BQDesc) + "%'";
            }
            if (query.AskCategory != Constant.INT_INVALID_VALUE)
            {
                where += " and AskCategory =" + query.AskCategory;
            }
            if (query.Status != Constant.INT_INVALID_VALUE)
            {
                where += " and Status =" + query.Status;
            }



            DataSet ds;

            SqlParameter[] parameters =
            {
                new SqlParameter("@where",         SqlDbType.NVarChar, 40000),
                new SqlParameter("@order",         SqlDbType.NVarChar,   200),
                new SqlParameter("@pagesize",      SqlDbType.Int,          4),
                new SqlParameter("@indexpage",     SqlDbType.Int,          4),
                new SqlParameter("@totalRecorder", SqlDbType.Int, 4)
            };

            parameters[0].Value     = where;
            parameters[1].Value     = order;
            parameters[2].Value     = pageSize;
            parameters[3].Value     = currentPage;
            parameters[4].Direction = ParameterDirection.Output;

            ds         = SqlHelper.ExecuteDataset(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_EXAMBIGQUESTION_SELECT, parameters);
            totalCount = (int)(parameters[4].Value);
            return(ds.Tables[0]);
        }
예제 #3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Entities.ExamBigQuestion GetExamBigQuestion(long BQID)
        {
            QueryExamBigQuestion query = new QueryExamBigQuestion();

            query.BQID = BQID;
            DataTable dt    = new DataTable();
            int       count = 0;

            dt = GetExamBigQuestion(query, string.Empty, 1, 1, out count);
            if (count > 0)
            {
                return(LoadSingleExamBigQuestion(dt.Rows[0]));
            }
            else
            {
                return(null);
            }
        }
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool IsExistsByBQID(long BQID)
        {
            QueryExamBigQuestion query = new QueryExamBigQuestion();

            query.BQID = BQID;
            DataTable dt    = new DataTable();
            int       count = 0;

            dt = GetExamBigQuestion(query, string.Empty, 1, 1, out count);
            if (count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #5
0
        /// <summary>
        /// 根据试卷ID得到一个对象实体List add by qizq 2012-9-3
        /// </summary>
        public List <Entities.ExamBigQuestion> GetExamBigQuestionList(long EPID)
        {
            List <Entities.ExamBigQuestion> GetExamBigQuestionList = null;
            QueryExamBigQuestion            query = new QueryExamBigQuestion();

            query.EPID = EPID;
            DataTable dt    = new DataTable();
            int       count = 0;

            dt = GetExamBigQuestion(query, "createtime asc", 1, 1000000, out count);
            if (count > 0)
            {
                GetExamBigQuestionList = new List <Entities.ExamBigQuestion>();
                for (int i = 0; i < count; i++)
                {
                    GetExamBigQuestionList.Add(LoadSingleExamBigQuestion(dt.Rows[i]));
                }
                return(GetExamBigQuestionList);
            }
            else
            {
                return(null);
            }
        }
 /// <summary>
 /// 按照查询条件查询
 /// </summary>
 /// <param name="query">查询条件</param>
 /// <param name="order">排序</param>
 /// <param name="currentPage">页号,-1不分页</param>
 /// <param name="pageSize">每页记录数</param>
 /// <param name="totalCount">总行数</param>
 /// <returns>集合</returns>
 public DataTable GetExamBigQuestion(QueryExamBigQuestion query, string order, int currentPage, int pageSize, out int totalCount)
 {
     return(Dal.ExamBigQuestion.Instance.GetExamBigQuestion(query, order, currentPage, pageSize, out totalCount));
 }