Пример #1
0
        //根据题目ID 初始化题目
        //输入:
        //      TID - 题目编号;
        //输出:
        //      题目存在:返回True;
        //      题目不在:返回False;
        public bool LoadData(int TID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            Datacon        DB     = new Datacon();

            Params[0] = DB.MakeInParam("@ID", SqlDbType.Int, 4, TID);                  //用户编号

            DataSet ds = DB.GetDataSet("Proc_JudgeProblemDetail", Params);

            ds.CaseSensitive = false;
            DataRow DR;

            if (ds.Tables[0].Rows.Count > 0)
            {
                DR           = ds.Tables[0].Rows[0];
                this._c_id   = GetSafeData.ValidateDataRow_N(DR, "c_id");                 //科目编号
                this._Title  = GetSafeData.ValidateDataRow_S(DR, "Title");                //题目
                this._Answer = GetSafeData.ValidateDataRow_B(DR, "Answer");               //答案
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        /// 根据参数kcbh,获取课程详细信息
        /// </summary>
        /// <param name="kcbh">课程编号/param>
        public void LoadData(string kcbh)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [kcb] where kcbh = " + SqlStringConstructor.GetQuotedString(kcbh);


            DataRow dr = db.GetDataRow(sql);    //利用Database类的GetDataRow方法查询数据

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._kcbh   = GetSafeData.ValidateDataRow_S(dr, "Kcbh");
                this._kcmc   = GetSafeData.ValidateDataRow_S(dr, "Kcmc");
                this._kcxz   = GetSafeData.ValidateDataRow_S(dr, "Kcxz");
                this._kclx   = GetSafeData.ValidateDataRow_S(dr, "Kclx");
                this._fdkcsj = GetSafeData.ValidateDataRow_B(dr, "Fdkcsj");
                this._yxbz   = GetSafeData.ValidateDataRow_B(dr, "Yxbz");
                this._exist  = true;
            }
            else
            {
                this._exist = false;
            }
        }
Пример #3
0
        /// <summary>
        /// 获取学年度信息
        /// </summary>
        public void LoadData()
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [xndb] where [mrxn] = 1";

            DataRow dr = db.GetDataRow(sql);    //利用Database类的GetDataRow方法查询数据

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._xnd   = GetSafeData.ValidateDataRow_S(dr, "Xnd");
                this._mrxn  = GetSafeData.ValidateDataRow_B(dr, "Mrxn");
                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Пример #4
0
        /// <summary>
        /// 根据参数yxbh,获取部门详细信息
        /// </summary>
        /// <param name="yxbh">院系编号 </param >
        public void LoadData(string yxbh)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [yxb] where yxbh = " + yxbh;

            DataRow dr = db.GetDataRow(sql);    //利用Database类的GetDataRow方法查询数据

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._yxbh  = GetSafeData.ValidateDataRow_S(dr, "Yxbh");
                this._yxmc  = GetSafeData.ValidateDataRow_S(dr, "Yxmc");
                this._yxbz  = GetSafeData.ValidateDataRow_B(dr, "Yxbz");
                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }