Web/Model/QuestionMultiSelectExtend.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using Maticsoft.DBUtility;
using System.Web.UI.WebControls;
using System.Collections.Generic;//Please add references

namespace StudentExamination.Model
{
    //扩展QuestionMulti类,增加自定义的方法

    public partial class QuestionMultiSelect
    {
        /// <summary>
        /// 按分类获取数据表
        /// 
        public void GetModelByItemID(int ItemID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select QuestionID,QtTitle,QtSelection,QtAnswer,CreateUserID,CreateDate,Score,QtExplain,SubjectID ");
            strSql.Append(" FROM [QuestionMultiSelect] a left join ExaminationItem b on a.QuestionID = b.QuestionID and b.QuestionType = 3 ");
            strSql.Append(" where b.ItemID=@ItemID ");
            SqlParameter[] parameters = {
					new SqlParameter("@ItemID", SqlDbType.Int,4)};
            parameters[0].Value = ItemID;

            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
           
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["QuestionID"] != null && ds.Tables[0].Rows[0]["QuestionID"].ToString() != "")
                {
                    this.QuestionID = int.Parse(ds.Tables[0].Rows[0]["QuestionID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["QtTitle"] != null && ds.Tables[0].Rows[0]["QtTitle"].ToString() != "")
                {
                    this.QtTitle = ds.Tables[0].Rows[0]["QtTitle"].ToString();
                }
                if (ds.Tables[0].Rows[0]["QtSelection"] != null && ds.Tables[0].Rows[0]["QtSelection"].ToString() != "")
                {
                    this.QtSelection = ds.Tables[0].Rows[0]["QtSelection"].ToString();
                }
                if (ds.Tables[0].Rows[0]["QtAnswer"] != null && ds.Tables[0].Rows[0]["QtAnswer"].ToString() != "")
                {
                    this.QtAnswer = ds.Tables[0].Rows[0]["QtAnswer"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CreateUserID"] != null && ds.Tables[0].Rows[0]["CreateUserID"].ToString() != "")
                {
                    this.CreateUserID = int.Parse(ds.Tables[0].Rows[0]["CreateUserID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CreateDate"] != null && ds.Tables[0].Rows[0]["CreateDate"].ToString() != "")
                {
                    this.CreateDate = DateTime.Parse(ds.Tables[0].Rows[0]["CreateDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Score"] != null && ds.Tables[0].Rows[0]["Score"].ToString() != "")
                {
                    this.Score = decimal.Parse(ds.Tables[0].Rows[0]["Score"].ToString());
                }
                if (ds.Tables[0].Rows[0]["QtExplain"] != null && ds.Tables[0].Rows[0]["QtExplain"].ToString() != "")
后面还有 36 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。