Exemple #1
0
        /// <summary>
        /// 判断表存在不
        /// </summary>
        /// <param name="TableName"></param>
        /// <returns></returns>
        public static bool ExistTable(string TableName)
        {
            DbBase db  = new DbBase();
            string sql = "select COUNT( *) from sysobjects where id = OBJECT_ID('[" + TableName + "]')";

            return((int)db.ExecuteScalar(sql) > 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);
        }
        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);
        }