Ejemplo n.º 1
0
        /// <summary>
        /// 设置为默认
        /// </summary>
        /// <param name="LocalNum"></param>
        /// <returns></returns>
        public int SetDefault(string LocalNum)
        {
            string Key = string.Format(CacheKey.JOOSHOW_LOCATION_CACHE, this.CompanyID);

            LocationEntity location = GetSingleByNum(LocalNum);

            location           = new LocationEntity();
            location.IsDefault = (int)EBool.No;
            location.IncludeIsDefault(true);
            location.And(a => a.CompanyID == this.CompanyID);
            this.Location.Update(location);

            LocationEntity entity = new LocationEntity();

            entity.IsDefault = (int)EBool.Yes;
            entity.IncludeIsDefault(true);
            entity.Where(a => a.LocalNum == LocalNum)
            .And(a => a.CompanyID == this.CompanyID)
            ;
            int line = this.Location.Update(entity);

            if (line > 0)
            {
                CacheHelper.Remove(Key);
            }
            return(line);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除库位信息
        /// </summary>
        /// <param name="storageNum"></param>
        /// <returns></returns>
        public int Delete(IEnumerable <string> list)
        {
            string Key = string.Format(CacheKey.JOOSHOW_LOCATION_CACHE, this.CompanyID);

            LocationEntity entity = new LocationEntity();

            entity.IsDelete = (int)EIsDelete.Deleted;
            entity.IncludeIsDelete(true);
            entity.Where("LocalNum", ECondition.In, list.ToArray());
            entity.And(a => a.CompanyID == this.CompanyID);
            int line = this.Location.Update(entity);

            if (line > 0)
            {
                CacheHelper.Remove(Key);
            }
            return(line);
        }