Esempio n. 1
0
        //根据题目ID 初始化题目
        //输入:
        //      TID - 题目编号;
        //输出:
        //      题目存在:返回True;
        //      题目不在:返回False;
        public bool LoadData(int TID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase       DB     = new DataBase();

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

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

            ds.CaseSensitive = false;
            DataRow DR;

            if (ds.Tables[0].Rows.Count > 0)
            {
                DR             = ds.Tables[0].Rows[0];
                this._CourseID = GetSafeData.ValidateDataRow_N(DR, "CourseID"); //科目编号
                this._ImgFile  = GetSafeData.ValidateDataRow_S(DR, "Img");      //图片url
                this._Title    = GetSafeData.ValidateDataRow_S(DR, "Title");    //大题信息
                this._nandu    = GetSafeData.ValidateDataRow_N(DR, "Nandu");    //难度
                this._zhang    = GetSafeData.ValidateDataRow_N(DR, "Zhang");    //章
                this._jie      = GetSafeData.ValidateDataRow_N(DR, "Jie");      //节
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 根据参数loginName,获取用户详细信息
        /// </summary>
        /// <param name="userId">用户ID</param>
        public void LoadData(int userId)
        {
            Database db = new Database();                       //实例化一个Database类

            string sql = "";

            sql = "Select * from [User] where UserId = " + userId.ToString();

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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._userID    = GetSafeData.ValidateDataRow_N(dr, "UserID");
                this._loginName = GetSafeData.ValidateDataRow_S(dr, "loginName");
                this._userName  = GetSafeData.ValidateDataRow_S(dr, "UserName");
                this._password  = GetSafeData.ValidateDataRow_S(dr, "PassWord");
                this._address   = GetSafeData.ValidateDataRow_S(dr, "Address");
                this._zip       = GetSafeData.ValidateDataRow_S(dr, "Zip");

                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 3
0
        public void LoadDataJXB2(string jxbmc)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

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


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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._jxbbh  = GetSafeData.ValidateDataRow_S(dr, "jxbbh");
                this._jxbmc  = GetSafeData.ValidateDataRow_S(dr, "jxbmc");
                this._jxbzrs = GetSafeData.ValidateDataRow_S(dr, "jxbzrs");


                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 4
0
        //根据题目ID 初始化题目
        //输入:
        //      TID - 题目编号;
        //输出:
        //      如果考试题目存在:返回True;
        //      如果考试题目不在:返回False;
        public bool LoadData(int TID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase       DB     = new DataBase();
            string         strsql = "SELECT * FROM JudgeProblemmr where ID=@ID";

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

            DataSet ds = DB.GetStrDataSetSql(strsql, Params);

            ds.CaseSensitive = false;
            DataRow DR;

            if (ds.Tables[0].Rows.Count > 0)
            {
                DR             = ds.Tables[0].Rows[0];
                this._CourseID = GetSafeData.ValidateDataRow_N(DR, "CourseID");                 //科目编号
                this._Title    = GetSafeData.ValidateDataRow_S(DR, "Title");                    //题目
                this._Answer   = GetSafeData.ValidateDataRow_B(DR, "Answer");                   //答案
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 根据参数Jxbbh,获取教学班详细信息
        /// </summary>
        /// <param name="jxbbh">教学班编号</param>
        public void LoadData(string jsbh, string kcsjmc, string jxbmc, string kbxn, string kbxq)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [js_kcsj_gxb],[jsb],[kcsjb],[jxbb] where [jsb].jsbh = "
                  + SqlStringConstructor.GetQuotedString(jsbh) + " And [kcsjb].kcsjmc = " + SqlStringConstructor.GetQuotedString(kcsjmc)
                  + " And [jxbb].jxbmc = " + SqlStringConstructor.GetQuotedString(jxbmc) + " And kbxn = " + SqlStringConstructor.GetQuotedString(kbxn) + " And kbxq ="
                  + SqlStringConstructor.GetQuotedString(kbxq) + "And [js_kcsj_gxb].jsbh=[jsb].jsbh And [js_kcsj_gxb].kcsjbh=[kcsjb].kcsjbh And [js_kcsj_gxb].jxbbh=[jxbb].jxbbh";


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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._jsxm   = GetSafeData.ValidateDataRow_S(dr, "jsxm");
                this._jsbh   = GetSafeData.ValidateDataRow_S(dr, "jsbh");
                this._kcsjmc = GetSafeData.ValidateDataRow_S(dr, "kcsjmc");
                this._kcsjbh = GetSafeData.ValidateDataRow_S(dr, "kcsjbh");
                this._jxbbh  = GetSafeData.ValidateDataRow_S(dr, "jxbbh");
                this._jxbmc  = GetSafeData.ValidateDataRow_S(dr, "jxbmc");
                this._kbxn   = GetSafeData.ValidateDataRow_S(dr, "kbxn");
                this._kbxq   = GetSafeData.ValidateDataRow_S(dr, "kbxq");

                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 6
0
        //根据用户 UserID 初始化该用户
        //输入:
        //      XUserID - 用户编号;
        //输出:
        //      用户存在:返回True;
        //      用户不在:返回False;
        public bool LoadData(int XUserID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase       DB     = new DataBase();

            Params[0] = DB.MakeInParam("@UserID", SqlDbType.VarChar, 50, XUserID);                  //用户编号

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

            ds.CaseSensitive = false;
            DataRow DR;

            if (ds.Tables[0].Rows.Count > 0)
            {
                DR              = ds.Tables[0].Rows[0];
                this._userID    = GetSafeData.ValidateDataRow_N(DR, "UserID");                      //用户编号
                this._userPower = GetSafeData.ValidateDataRow_N(DR, "UserPower");                   //用户权限
                this._userName  = GetSafeData.ValidateDataRow_S(DR, "UserName");                    //用户姓名
                this._userEmail = GetSafeData.ValidateDataRow_S(DR, "UserEmail");                   //用户邮箱
                this._userNum   = GetSafeData.ValidateDataRow_S(DR, "UserNum");                     //用户学号
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 根据参数bookID,获取图书详细信息
        /// </summary>
        /// <param name="topicID">图书ID</param>
        public void LoadData(int bookID)
        {
            Database db = new Database();                       //实例化一个Database类

            string sql = "";

            sql = "Select * from [Book] where BookID = " + bookID;

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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._bookId      = GetSafeData.ValidateDataRow_N(dr, "BookID");
                this._bookName    = GetSafeData.ValidateDataRow_S(dr, "BookName");
                this._categoryId  = GetSafeData.ValidateDataRow_N(dr, "CategoryId");
                this._price       = GetSafeData.ValidateDataRow_F(dr, "Price");
                this._publisher   = GetSafeData.ValidateDataRow_S(dr, "Publisher");
                this._publishDate = GetSafeData.ValidateDataRow_T(dr, "PublishDate");
                this._author      = GetSafeData.ValidateDataRow_S(dr, "Author");
                this._pageNum     = GetSafeData.ValidateDataRow_N(dr, "PageNum");
                this._pictureUrl  = GetSafeData.ValidateDataRow_S(dr, "PictureUrl");
                this._description = GetSafeData.ValidateDataRow_S(dr, "Description");
                this._saleCount   = GetSafeData.ValidateDataRow_N(dr, "SaleCount");

                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 根据参数departmentId,获取部门详细信息
        /// </summary>
        /// <param name="topicID">部门ID</param>
        public bool LoadData(int DepartmentId)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase       DB     = new DataBase();

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

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

            ds.CaseSensitive = false;
            DataRow DR;

            if (ds.Tables[0].Rows.Count > 0)
            {
                DR = ds.Tables[0].Rows[0];
                this._departmentId   = GetSafeData.ValidateDataRow_N(DR, "DepartmentId");
                this._departmentName = GetSafeData.ValidateDataRow_S(DR, "DepartmentName");

                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 9
0
        public void LoadInfo(string authorID)
        {
            string   sql = "select * from author where authorID=" + SQLString.GetQuotedString(authorID);
            Database db  = new Database();
            DataRow  dr  = db.GetDataRow(sql);

            if (dr != null)
            {
                this._authorID      = GetSafeData.ValidateDataRow_S(dr, "authorID");
                this._authorPwd     = GetSafeData.ValidateDataRow_S(dr, "authorPwd");
                this._authorName    = GetSafeData.ValidateDataRow_S(dr, "authorName");
                this._authorSex     = GetSafeData.ValidateDataRow_S(dr, "authorSex");
                this._authorBirth   = GetSafeData.ValidateDataRow_S(dr, "authorBirth");
                this._authorRegion  = GetSafeData.ValidateDataRow_S(dr, "authorRegion");
                this._authorPost    = GetSafeData.ValidateDataRow_S(dr, "authorPost");
                this._authorMail    = GetSafeData.ValidateDataRow_S(dr, "authorMail");
                this._authorDegree  = GetSafeData.ValidateDataRow_S(dr, "authorDegree");
                this._authorMajor   = GetSafeData.ValidateDataRow_S(dr, "authorMajor");
                this._authorTitle   = GetSafeData.ValidateDataRow_S(dr, "authorTitle");
                this._authorJob     = GetSafeData.ValidateDataRow_S(dr, "authorJob");
                this._authorCompany = GetSafeData.ValidateDataRow_S(dr, "authorCompany");
                this._authorPhone   = GetSafeData.ValidateDataRow_S(dr, "authorPhone");
                this._authorAddress = GetSafeData.ValidateDataRow_S(dr, "authorAddress");
                this._authorInfo    = GetSafeData.ValidateDataRow_S(dr, "authorInfo");
                this._exist         = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 10
0
        /// <summary>
        /// 根据参数jsbh,获取教师详细信息
        /// </summary>
        /// <param name="jsbh">教师编号/param>
        public void LoadData(string jsbh)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [jsb],[yxb],[zwb],[zcb] where jsbh = " + SqlStringConstructor.GetQuotedString(jsbh)
                  + "And [jsb].yxbh = [yxb].yxbh And [jsb].zcbh = [zcb].zcbh And [jsb].zwbh = [zwb].zwbh";

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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._jsbh = GetSafeData.ValidateDataRow_S(dr, "Jsbh");
                this._jsxm = GetSafeData.ValidateDataRow_S(dr, "Jsxm");
                this._jsxb = GetSafeData.ValidateDataRow_S(dr, "Jsxb");
                this._yxmc = GetSafeData.ValidateDataRow_S(dr, "Yxmc");
                this._zcmc = GetSafeData.ValidateDataRow_S(dr, "Zcmc");
                this._zwlx = GetSafeData.ValidateDataRow_S(dr, "Zwlx");
                this._dlmm = GetSafeData.ValidateDataRow_S(dr, "Dlmm");
                this._zzzt = GetSafeData.ValidateDataRow_B(dr, "Zzzt");

                //解密口令
                this._dlmm  = Encrypt.DecryptString(_dlmm, _jsbh);
                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 11
0
        //根据题目ID 初始化题目
        //输入:
        //      TID - 题目编号;
        //输出:
        //      题目存在:返回True;
        //      题目不在:返回False;
        public bool LoadData(int TID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase       DB     = new DataBase();

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

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

            ds.CaseSensitive = false;
            DataRow DR;

            if (ds.Tables[0].Rows.Count > 0)
            {
                DR               = ds.Tables[0].Rows[0];
                this._CourseID   = GetSafeData.ValidateDataRow_N(DR, "CourseID");                 //科目编号
                this._FrontTitle = GetSafeData.ValidateDataRow_S(DR, "FrontTitle");               //题目前部分
                this._BackTitle  = GetSafeData.ValidateDataRow_S(DR, "BackTitle");                //题目后部分
                this._Answer     = GetSafeData.ValidateDataRow_S(DR, "Answer");                   //答案
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 12
0
        //根据题目ID 初始化题目
        //输入:
        //      TID - 题目编号;
        //输出:
        //      题目存在:返回True;
        //      题目不在:返回False;
        public bool LoadData(int TID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase       DB     = new DataBase();

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

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

            ds.CaseSensitive = false;
            DataRow DR;

            if (ds.Tables[0].Rows.Count > 0)
            {
                DR             = ds.Tables[0].Rows[0];
                this._CourseID = GetSafeData.ValidateDataRow_N(DR, "CourseID");                   //科目编号
                this._Title    = GetSafeData.ValidateDataRow_S(DR, "Title");                      //题目
                this._AnswerA  = GetSafeData.ValidateDataRow_S(DR, "AnswerA");                    //答案A
                this._AnswerB  = GetSafeData.ValidateDataRow_S(DR, "AnswerB");                    //答案B
                this._AnswerC  = GetSafeData.ValidateDataRow_S(DR, "AnswerC");                    //答案C
                this._AnswerD  = GetSafeData.ValidateDataRow_S(DR, "AnswerD");                    //答案D
                this._Answer   = GetSafeData.ValidateDataRow_S(DR, "Answer");                     //答案
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 13
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);
            }
        }
Esempio n. 14
0
        /// <summary>
        /// 根据参数loginName,获取用户详细信息
        /// </summary>
        /// <param name="czy">用户登录名</param>
        public void LoadData(string czy)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [czyb],[yxb] where czy = "
                  + SqlStringConstructor.GetQuotedString(czy)
                  + " And [czyb].yxbh=[yxb].yxbh";

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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._czy  = GetSafeData.ValidateDataRow_S(dr, "czy");
                this._dlmm = GetSafeData.ValidateDataRow_S(dr, "dlmm");
                this._yxmc = GetSafeData.ValidateDataRow_S(dr, "yxmc");
                this._qx   = GetSafeData.ValidateDataRow_S(dr, "qx");

                //解密口令
                this._dlmm = Encrypt.DecryptString(_dlmm, _czy);

                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 15
0
        /// <summary>
        /// 根据参数Jxbbh,获取教学班详细信息
        /// </summary>
        /// <param name="jxbbh">教学班编号</param>
        public void LoadData(string jsbh, string bysjlx, string kbxn, string kbxq)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [bysjb],[jsb],[yxb] where [jsb].jsbh = "
                  + SqlStringConstructor.GetQuotedString(jsbh) + " And bysjlx = " + SqlStringConstructor.GetQuotedString(bysjlx) + " And kbxn = " + SqlStringConstructor.GetQuotedString(kbxn) + " And kbxq ="
                  + SqlStringConstructor.GetQuotedString(kbxq) + "And [bysjb].jsbh=[jsb].jsbh And [bysjb].yxbh=[yxb].yxbh";


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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._jsxm   = GetSafeData.ValidateDataRow_S(dr, "jsxm");
                this._bysjlx = GetSafeData.ValidateDataRow_S(dr, "bysjlx");
                this._yxmc   = GetSafeData.ValidateDataRow_S(dr, "yxmc");
                this._bysjzs = GetSafeData.ValidateDataRow_F(dr, "bysjzs");
                this._cjrs   = GetSafeData.ValidateDataRow_N(dr, "cjrs");
                this._kbxn   = GetSafeData.ValidateDataRow_S(dr, "kbxn");
                this._kbxq   = GetSafeData.ValidateDataRow_S(dr, "kbxq");
                this._jsbh   = GetSafeData.ValidateDataRow_S(dr, "jsbh");
                this._yxbh   = GetSafeData.ValidateDataRow_S(dr, "yxbh");
                this._exist  = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 16
0
        /// <summary>
        /// 根据参数kcsjbh,获取课程设计详细信息
        /// </summary>
        /// <param name="kcsjbh">课程设计编号/param>
        public void LoadData(string kcsjbh)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

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


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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._kcsjbh = GetSafeData.ValidateDataRow_S(dr, "Kcsjbh");
                this._kcsjmc = GetSafeData.ValidateDataRow_S(dr, "Kcsjmc");
                this._kcsjzs = GetSafeData.ValidateDataRow_S(dr, "Kcsjzs");
                this._yxbz   = GetSafeData.ValidateDataRow_B(dr, "Yxbz");
                this._exist  = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 17
0
        public void LoadInfo(string adminID)
        {
            string   sql = "select * from admin where adminID=" + SQLString.GetQuotedString(adminID);
            Database db  = new Database();
            DataRow  dr  = db.GetDataRow(sql);

            if (dr != null)
            {
                this._adminID  = GetSafeData.ValidateDataRow_S(dr, "adminID");
                this._adminPwd = GetSafeData.ValidateDataRow_S(dr, "adminPwd");
            }
        }
Esempio n. 18
0
        public void LoadInfo(string expertID)
        {
            string   sql = "select * from expert where expertID=" + SQLString.GetQuotedString(expertID);
            Database db  = new Database();
            DataRow  dr  = db.GetDataRow(sql);

            if (dr != null)
            {
                this._expertID      = GetSafeData.ValidateDataRow_S(dr, "expertID");
                this._expertPwd     = GetSafeData.ValidateDataRow_S(dr, "expertPwd");
                this._expertName    = GetSafeData.ValidateDataRow_S(dr, "expertName");
                this._expertSex     = GetSafeData.ValidateDataRow_S(dr, "expertSex");
                this._expertColumn  = GetSafeData.ValidateDataRow_S(dr, "expertColumn");
                this._expertMail    = GetSafeData.ValidateDataRow_S(dr, "expertMail");
                this._expertPhone   = GetSafeData.ValidateDataRow_S(dr, "expertPhone");
                this._expertAddress = GetSafeData.ValidateDataRow_S(dr, "expertAddress");
                this._expertInfo    = GetSafeData.ValidateDataRow_S(dr, "expertInfo");
            }
        }
Esempio n. 19
0
        public void LoadInfo(string editorID)
        {
            string   sql = "select * from editor where editorID=" + SQLString.GetQuotedString(editorID);
            Database db  = new Database();
            DataRow  dr  = db.GetDataRow(sql);

            if (dr != null)
            {
                this._editorID      = GetSafeData.ValidateDataRow_S(dr, "editorID");
                this._editorPwd     = GetSafeData.ValidateDataRow_S(dr, "editorPwd");
                this._editorName    = GetSafeData.ValidateDataRow_S(dr, "editorName");
                this._editorSex     = GetSafeData.ValidateDataRow_S(dr, "editorSex");
                this._editorColumn  = GetSafeData.ValidateDataRow_S(dr, "editorColumn");
                this._editorPhone   = GetSafeData.ValidateDataRow_S(dr, "editorPhone");
                this._editorMail    = GetSafeData.ValidateDataRow_S(dr, "editorMail");
                this._editorAddress = GetSafeData.ValidateDataRow_S(dr, "editorAddress");
                this._editorInfo    = GetSafeData.ValidateDataRow_S(dr, "editorInfo");
            }
        }
Esempio n. 20
0
        //下载于51aspx.com
        //根据用户 UserID 初始化该用户
        //输入:
        //      XUserID - 用户编号;
        //输出:
        //      用户存在:返回True;
        //      用户不在:返回False;
        public bool LoadData(string XUserID)
        {//下载于51aspx.com
            SqlParameter[] Params = new SqlParameter[1];
            DataBase       DB     = new DataBase();

            Params[0] = DB.MakeInParam("@UserID", SqlDbType.VarChar, 50, XUserID);                  //用户编号

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

            ds.CaseSensitive = false;
            DataRow DR;

            if (ds.Tables[0].Rows.Count > 0)
            {
                DR               = ds.Tables[0].Rows[0];
                this._userID     = GetSafeData.ValidateDataRow_S(DR, "UserID");                 //用户编号
                this._userName   = GetSafeData.ValidateDataRow_S(DR, "UserName");               //用户姓名
                this._userPwd    = GetSafeData.ValidateDataRow_S(DR, "UserPwd");                //用户密码
                this._department = GetSafeData.ValidateDataRow_N(DR, "DepartmentId");           //所在部门
                this._roleid     = GetSafeData.ValidateDataRow_N(DR, "RoleId");                 //用户权限
                this._rolename   = GetSafeData.ValidateDataRow_S(DR, "RoleName");               //用户权限

                //获取权限集合
                string colName = "";
                for (int i = 0; i < DR.ItemArray.Length; i++)
                {
                    colName = DR.Table.Columns[i].ColumnName;
                    if (colName.StartsWith("HasDuty_") && GetSafeData.ValidateDataRow_N(DR, colName) == 1)
                    {
                        this._duties.Add(DR.Table.Columns[i].ColumnName.Substring(8));  //去掉前缀“HasDuty_”
                    }
                }
                //默认

                this._duties.Add("UserTest");
                this._duties.Add("PaperScore");
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 21
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;
            }
        }
Esempio n. 22
0
        //根据用户 UserID 初始化该用户
        //输入:
        //      XUserID - 用户编号;
        //输出:
        //      用户存在:返回True;
        //      用户不在:返回False;
        public bool LoadData(string XUserID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase       DB     = new DataBase();

            Params[0] = DB.MakeInParam("@UserID", SqlDbType.VarChar, 50, XUserID);                  //用户编号
            string  strsql = "SELECT * FROM Usersmr,Departmentmr,Rolemr WHERE UserID=@UserID AND Usersmr.DepartmentId = Departmentmr.DepartmentId And Usersmr.RoleId = Rolemr.RoleId";
            DataSet ds     = DB.GetStrDataSetSql(strsql, Params);

            ds.CaseSensitive = false;
            DataRow DR;

            if (ds.Tables[0].Rows.Count > 0)
            {
                DR               = ds.Tables[0].Rows[0];
                this._userID     = GetSafeData.ValidateDataRow_S(DR, "UserID");                 //用户编号
                this._userName   = GetSafeData.ValidateDataRow_S(DR, "UserName");               //用户姓名
                this._userPwd    = GetSafeData.ValidateDataRow_S(DR, "UserPwd");                //用户密码
                this._department = GetSafeData.ValidateDataRow_N(DR, "DepartmentId");           //所在部门
                this._roleid     = GetSafeData.ValidateDataRow_N(DR, "RoleId");                 //用户权限
                this._rolename   = GetSafeData.ValidateDataRow_S(DR, "RoleName");               //用户权限

                //获取权限集合
                string colName = "";
                for (int i = 0; i < DR.ItemArray.Length; i++)
                {
                    colName = DR.Table.Columns[i].ColumnName;
                    if (colName.StartsWith("HasDuty_") && GetSafeData.ValidateDataRow_N(DR, colName) == 1)
                    {
                        this._duties.Add(DR.Table.Columns[i].ColumnName.Substring(8));  //去掉前缀“HasDuty_”
                    }
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 23
0
        /// <summary>
        /// 根据参数categoryId,获取图书类别详细信息
        /// </summary>
        /// <param name="topicID">图书类别ID</param>
        public void LoadData(int categoryId)
        {
            Database db = new Database();                       //实例化一个Database类

            string sql = "";

            sql = "Select * from [Category] where CategoryId = " + categoryId;

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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._categoryId   = GetSafeData.ValidateDataRow_N(dr, "CategoryId");
                this._categoryName = GetSafeData.ValidateDataRow_S(dr, "CategoryName");

                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 24
0
        /// <summary>
        /// 根据参数roleId,获取角色(职务)详细信息
        /// </summary>
        /// <param name="topicID">角色(职务)ID</param>
        public void LoadData(int roleId)
        {
            DataBase db = new DataBase();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [Role] where RoleId = " + roleId;

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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._roleId   = GetSafeData.ValidateDataRow_N(dr, "RoleId");
                this._roleName = GetSafeData.ValidateDataRow_S(dr, "RoleName");

                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 25
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;
            }
        }
Esempio n. 26
0
        /// <summary>
        /// 根据参数zcbh,获取职称详细信息
        /// </summary>
        /// <param name="zcbh">职称编号/param>
        public void LoadData(string zcbh)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [zcb] where zcbh = " + zcbh;

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

            //根据查询得到的数据,对成员赋值
            if (dr != null)
            {
                this._zcbh  = GetSafeData.ValidateDataRow_S(dr, "Zcbh");
                this._zcmc  = GetSafeData.ValidateDataRow_S(dr, "Zcmc");
                this._zclx  = GetSafeData.ValidateDataRow_S(dr, "Zclx");
                this._bzgzl = GetSafeData.ValidateDataRow_N(dr, "Bzgzl");
                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }
Esempio n. 27
0
        public void Docload(int docID)  //加载稿件信息
        {
            string   sql = "select * from document where docID=" + SQLString.GetQuotedString(Convert.ToString(docID));
            Database db  = new Database();
            DataRow  dr  = db.GetDataRow(sql);

            if (dr != null)
            {
                this._docID         = GetSafeData.ValidateDataRow_N(dr, "docID");
                this._docTime       = GetSafeData.ValidateDataRow_T(dr, "docTime");
                this._docTitle      = GetSafeData.ValidateDataRow_S(dr, "docTitle");
                this._docTitleEn    = GetSafeData.ValidateDataRow_S(dr, "docTitleEn");
                this._docAbstract   = GetSafeData.ValidateDataRow_S(dr, "docAbstract");
                this._docAbstractEn = GetSafeData.ValidateDataRow_S(dr, "docAbstractEn");
                this._docKeywords   = GetSafeData.ValidateDataRow_S(dr, "docKeywords");
                this._docKeywordsEn = GetSafeData.ValidateDataRow_S(dr, "docKeywordsEn");
                this._docLetters    = GetSafeData.ValidateDataRow_N(dr, "docLetters");
                this._docAuthor     = GetSafeData.ValidateDataRow_S(dr, "docAuthor");
                this._docColumnID   = GetSafeData.ValidateDataRow_S(dr, "docColumnID");
                this._authorID      = GetSafeData.ValidateDataRow_S(dr, "authorID");
                this._docState      = GetSafeData.ValidateDataRow_S(dr, "docState");
                this._docReason     = GetSafeData.ValidateDataRow_S(dr, "docReason");
            }
        }