Beispiel #1
0
        /// <summary>
        /// 添加计量单位
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int AddMeasure(MeasureEntity entity)
        {
            entity.IncludeAll();
            int line = this.Measure.Add(entity);

            if (line > 0)
            {
                CacheHelper.Remove(CacheKey.JOOSHOW_MEASURE_CACHE);
            }
            return(line);
        }
Beispiel #2
0
        /// <summary>
        /// 添加计量单位
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int AddMeasure(MeasureEntity entity)
        {
            string Key = string.Format(CacheKey.JOOSHOW_MEASURE_CACHE, entity.CompanyID);

            entity.IncludeAll();
            int line = this.Measure.Add(entity);

            if (line > 0)
            {
                CacheHelper.Remove(Key);
            }
            return(line);
        }
Beispiel #3
0
        /// <summary>
        /// 获得所有的计量单位
        /// </summary>
        /// <returns></returns>
        public List <MeasureEntity> GetList()
        {
            List <MeasureEntity> listResult = CacheHelper.Get(CacheKey.JOOSHOW_MEASURE_CACHE) as List <MeasureEntity>;

            if (!listResult.IsNullOrEmpty())
            {
                return(listResult);
            }
            MeasureEntity entity = new MeasureEntity();

            entity.IncludeAll();
            listResult = this.Measure.GetList(entity);
            if (!listResult.IsNullOrEmpty())
            {
                CacheHelper.Insert(CacheKey.JOOSHOW_MEASURE_CACHE, listResult);
            }
            return(listResult);
        }
Beispiel #4
0
        /// <summary>
        /// 获得所有的计量单位
        /// </summary>
        /// <returns></returns>
        public List <MeasureEntity> GetList()
        {
            string Key = string.Format(CacheKey.JOOSHOW_MEASURE_CACHE, this.CompanyID);
            List <MeasureEntity> listResult = CacheHelper.Get(Key) as List <MeasureEntity>;

            if (!listResult.IsNullOrEmpty())
            {
                return(listResult);
            }
            MeasureEntity entity = new MeasureEntity();

            entity.IncludeAll();
            entity.Where(a => a.CompanyID == this.CompanyID);
            listResult = this.Measure.GetList(entity);
            if (!listResult.IsNullOrEmpty())
            {
                CacheHelper.Insert(Key, listResult);
            }
            return(listResult);
        }