Ejemplo n.º 1
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;
            }
        }
Ejemplo n.º 2
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;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据参数Jxbbh,获取教学班详细信息
        /// </summary>
        /// <param name="jxbbh">教学班编号</param>
        public void LoadData(string jsbh, string kcmc, string jxbmc, string kbxn, string kbxq)
        {
            Database db = new Database();               //实例化一个Database类

            string sql = "";

            sql = "Select * from [js_kc_gxb],[jsb],[kcb],[jxbb] where [jsb].jsbh = "
                  + SqlStringConstructor.GetQuotedString(jsbh) + " And [kcb].kcmc = " + SqlStringConstructor.GetQuotedString(kcmc)
                  + " And [jxbb].jxbmc = " + SqlStringConstructor.GetQuotedString(jxbmc) + " And kbxn = " + SqlStringConstructor.GetQuotedString(kbxn) + " And kbxq ="
                  + SqlStringConstructor.GetQuotedString(kbxq) + "And [js_kc_gxb].jsbh=[jsb].jsbh And [js_kc_gxb].kcbh=[kcb].kcbh And [js_kc_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._kcmc  = GetSafeData.ValidateDataRow_S(dr, "kcmc");
                this._kcbh  = GetSafeData.ValidateDataRow_S(dr, "kcbh");
                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._llxs  = GetSafeData.ValidateDataRow_N(dr, "llxs");
                this._lldxs = GetSafeData.ValidateDataRow_F(dr, "lldxs");
                this._syxs  = GetSafeData.ValidateDataRow_N(dr, "syxs");
                this._sydxs = GetSafeData.ValidateDataRow_F(dr, "sydxs");

                this._exist = true;
            }
            else
            {
                this._exist = false;
            }
        }