示例#1
0
        /// <summary>
        /// 搜索收货地址
        /// </summary>
        /// <returns></returns>
        public List <ShipAddress> SelectAddress(string mStoreUserID)
        {
            List <ShipAddress> luserAdreslist = new List <ShipAddress>();

            string Sqlstring = "select * from ShipAddress where UserID='" + mStoreUserID + "'";

            SqlHelper.ReadDateReadBegin(Sqlstring);
            int i = 0;

            while (SqlHelper.SqlReader.Read())
            {
                ShipAddress mUserAddress = new ShipAddress();
                mUserAddress.AddressID = (int)SqlHelper.SqlReader[0];
                mUserAddress.Address   = SqlHelper.SqlReader[2].ToString();
                if (SqlHelper.SqlReader[3].ToString() == "0")
                {
                    mUserAddress.IsDefault = '否';
                }
                else
                {
                    mUserAddress.IsDefault = '是';
                }
                luserAdreslist.Add(mUserAddress);
            }
            SqlHelper.ReadDateReadEnd();
            return(luserAdreslist);
        }
示例#2
0
        /// <summary>
        /// 获取地址
        /// </summary>
        /// <returns>发货地址表单</returns>
        public List <ShipAddress> GetAddress()
        {
            List <ShipAddress> luserAdreslist = new List <ShipAddress>();
            string             yUserName      = this.UserName;
            string             Sqlstring1     = "select UserID from StoreUser where UserName='******'";
            object             obj1           = SqlHelper.ReadSclar(Sqlstring1);
            string             ID             = obj1.ToString();
            string             Sqlstring2     = "select Address from ShipAddress where UserID='" + ID + "'";

            SqlHelper.ReadDateReadBegin(Sqlstring2);
            while (SqlHelper.SqlReader.Read())
            {
                ShipAddress Uadres = new ShipAddress();
                Uadres.Address = SqlHelper.SqlReader["Address"].ToString();
                luserAdreslist.Add(Uadres);
            }
            SqlHelper.ReadDateReadEnd();
            return(luserAdreslist);
        }