Example #1
0
        /// <summary>
        /// 显示路径
        /// </summary>
        public StringBuilder ShowPath(SqlTransaction trans, string ProductCategoryId)
        {
            StringBuilder tempStr = new StringBuilder("根结点");
            ProductCategorySettingModel proModel = new ProductCategorySettingModel();

            proModel = this.GetModel(trans, ProductCategoryId);
            if (proModel == null)
            {
                return(tempStr);
            }
            else
            {
                string   strPath = proDAL.GetPath(trans, ProductCategoryId).ToString();
                string[] arrPath = strPath.Split(',');
                foreach (var item in arrPath)
                {
                    ProductCategorySettingModel areModel_2 = new ProductCategorySettingModel();
                    areModel_2 = this.GetModel(trans, item);
                    if (areModel_2 != null)
                    {
                        tempStr.Append(" > " + areModel_2.ProductCategoryName);
                    }
                }
                return(tempStr);
            }
        }
Example #2
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, ProductCategorySettingModel proModel, long SN)
        {
            string key = "Cache_ProductCategorySetting_Model_" + SN;

            CacheHelper.RemoveCache(key);
            return(proDAL.UpdateInfo(trans, proModel, SN));
        }
Example #3
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public ProductCategorySettingModel GetCacheInfo(SqlTransaction trans, long SN)
        {
            string key   = "Cache_ProductCategorySetting_Model_" + SN;
            object value = CacheHelper.GetCache(key);

            if (value != null)
            {
                return((ProductCategorySettingModel)value);
            }
            else
            {
                ProductCategorySettingModel proModel = proDAL.GetInfo(trans, SN);
                CacheHelper.AddCache(key, proModel, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), CacheItemPriority.Normal, null);
                return(proModel);
            }
        }
Example #4
0
 /// <summary>
 /// 更新Status
 /// </summary>
 public int UpdateInfo(SqlTransaction trans, ProductCategorySettingModel proCateModel)
 {
     return(proDAL.UpdateInfo(trans, proCateModel));
 }
Example #5
0
/// <summary>
/// 插入信息
/// </summary>
        public int InsertInfo(SqlTransaction trans, ProductCategorySettingModel proModel)
        {
            return(proDAL.InsertInfo(trans, proModel));
        }