コード例 #1
0
        public DataTable GetRegion(int ParentId)
        {
            string sql = string.Format("select ID,Name from Region where ParentId={0}", ParentId);

            BLL.DbBase db = new BLL.DbBase();
            db.ChangeDBShop();
            return(db.ExecuteTable(sql));
        }
コード例 #2
0
        public DataTable GetRegionAll()
        {
            string sql = "SELECT * FROM dbo.Region";

            BLL.DbBase db = new BLL.DbBase();
            db.ChangeDBShop();
            return(db.ExecuteTable(sql));
        }
コード例 #3
0
        public string GetImageUrl(int goodsId, int goodsPackageId)
        {
            BLL.DbBase db = new BLL.DbBase();
            db.ChangeDBShop();
            string url = db.ExecuteScalar("SELECT dbo.[GetImagePathOriginal](" + goodsId.ToString() + "," + goodsPackageId.ToString() + ")") as string;

            if (string.IsNullOrEmpty(url))
            {
                url = "images/nopic1.jpg";
            }
            return("http://image.101yao.com//" + url);
        }
コード例 #4
0
        public string Login(string name, string pwd)
        {
            BLL.DbBase bll = new BLL.DbBase();
            bll.ChangeDBShop();
            int c = (int)bll.ExecuteScalar(string.Format("SELECT COUNT(*) FROM yxs_administrators  WHERE NAME='{0}' AND PASSWORD='******'", Library.Lang.Input.Filter(name), Library.Lang.Input.MD5(pwd, false)));

            if (c == 1)
            {
                Memcached.ClientLibrary.MemcachedClient mc = new Memcached.ClientLibrary.MemcachedClient();
                mc.PoolName = "Price_Cache";
                string authKey = MongoDB.Oid.NewOid().ToString();
                mc.Set(authKey, name, DateTime.Now.AddHours(12));
                return(authKey);
            }
            return(null);
        }