示例#1
0
        /// <summary>
        /// 返回题目类别
        /// </summary>
        /// <returns></returns>
        public List <Model.Status> GetCategory()
        {
            string strSql = "";

            strSql = "Select YS_TYPE,YS_REMARK FROM [Status] GROUP BY YS_TYPE,YS_REMARK";
            List <Model.Status> List = new List <Model.Status>();

            SqlParameter[] parameters =
            {
            };
            using (SqlDataReader DR = ExamSys.ExecuteReader(strSql.ToString(), parameters))
            {
                while (DR.Read())
                {
                    Model.Status model = new Model.Status();
                    model.YS_TYPE   = DR["YS_TYPE"].ToString();
                    model.YS_REMARK = DR["YS_REMARK"].ToString();
                    List.Add(model);
                }
                DR.Close();
                DR.Dispose();
            }

            return(List);
        }
示例#2
0
        /// <summary>
        /// 获取所有列表
        /// </summary>
        /// <returns></returns>
        public List <Model.Status> GetList(string Ys_Code)
        {
            string strSql = "";

            strSql = "Select * FROM [Status] WHERE [YS_TYPE]='" + Ys_Code + "'";
            List <Model.Status> List = new List <Model.Status>();

            SqlParameter[] parameters =
            {
            };
            using (SqlDataReader DR = ExamSys.ExecuteReader(strSql.ToString(), parameters))
            {
                while (DR.Read())
                {
                    Model.Status model = new Model.Status();
                    model.YS_ID   = int.Parse(DR["YS_ID"].ToString());
                    model.YS_CODE = DR["YS_CODE"].ToString();
                    model.YS_DESC = DR["YS_DESC"].ToString();
                    model.YS_SEQ  = int.Parse(DR["YS_SEQ"].ToString());
                    List.Add(model);
                }
                DR.Close();
                DR.Dispose();
            }

            return(List);
        }