Web/Model/QuestionJudgeExtend.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
{
    //扩展QuestionJudge类,增加自定义的方法

    public partial class QuestionJudge
    {

        /// <summary>
        ///批量删除数据
        /// </summary>
        public bool DeleteList(string DptIDlist)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from [QuestionJudge] ");
            strSql.Append(" where QuestionID in (" + DptIDlist + ")  ");
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        
        /// <summary>
        /// 按分类获取数据表
        /// 
        public void   GetModelByItemID(int ItemID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select QuestionID,QtTitle,QtAnswer,CreateUserID,CreateDate,Score,QtExplain,SubjectID ");
            strSql.Append(" FROM [QuestionJudge] a left join ExaminationItem b on a.QuestionID = b.QuestionID ");
            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]["QtAnswer"] != null && ds.Tables[0].Rows[0]["QtAnswer"].ToString() != "")
后面还有 41 行代码,购买后查看完整代码

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

AI 解读 AI

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

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