예제 #1
0
        /// <summary>
        /// 显示所有
        /// </summary>
        /// <returns></returns>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ID,Name,Type ");
            strSql.Append(" FROM Papers ");
            SqlParameter[] parameters =
            {
            };
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return(ExamSys.Query(strSql.ToString()));
        }
예제 #2
0
        /// <summary>
        /// add by wangke 2016-12-8
        /// 获得数据列表
        /// 获取该试卷题目所属StatusId
        /// </summary>
        public DataTable GetList(int papersID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT Status_id FROM ExaminationSystem.Exam.PapersTitleList WHERE PapersID=@papersID GROUP BY Status_id ");
            List <Model.Status> List = new List <Model.Status>();

            SqlParameter[] parameters =
            {
                new SqlParameter("@papersID", SqlDbType.Int)
            };
            parameters[0].Value = papersID;

            DataTable dt = ExamSys.Query(strSql.ToString(), parameters).Tables[0];

            return(dt);
        }
예제 #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataTable GetStatusList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select YS_CODE,YS_DESC,YS_TYPE,YS_REMARK,YS_SEQ,YS_ID ");
            strSql.Append(" FROM Status ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List <Model.Status> List = new List <Model.Status>();

            SqlParameter[] parameters =
            {
            };
            DataTable dt = ExamSys.Query(strSql.ToString(), parameters).Tables[0];

            return(dt);
        }
예제 #4
0
        /// <summary>
        /// 执行SQL语句
        /// </summary>
        public DataTable ExecSQL(string strSql, params SqlParameter[] parames)
        {
            DataTable dt = ExamSys.Query(strSql.ToString(), parames).Tables[0];

            return(dt);
        }