示例#1
0
        public static bool ModifyStorageLocation(StorageLocationEntity entity)
        {
            long result = 0;

            if (entity != null)
            {
                StorageLocationRepository mr = new StorageLocationRepository();

                StorageLocationInfo StorageLocationInfo = TranslateStorageLocationInfo(entity);

                if (entity.StorageLocationID > 0)
                {
                    StorageLocationInfo.StorageLocationID = entity.StorageLocationID;
                    StorageLocationInfo.ChangeDate        = DateTime.Now;
                    result = mr.ModifyStorageLocation(StorageLocationInfo);
                }
                else
                {
                    StorageLocationInfo.ChangeDate = DateTime.Now;
                    StorageLocationInfo.CreateDate = DateTime.Now;
                    result = mr.CreateNew(StorageLocationInfo);
                }

                List <StorageLocationInfo> miList = mr.GetAllStorageLocation();//刷新缓存
                Cache.Add("StorageLocationALL", miList);
            }
            return(result > 0);
        }
示例#2
0
        /// <summary>
        /// 入库自动分配库位
        /// </summary>
        /// <param name="count"></param>
        public static void InInventoryAutoAllocation(int storageID, int count, List <InvGoodsDetailEntity> listGoods)
        {
            StorageLocationRepository sr = new StorageLocationRepository();

            if (count > 0 && listGoods != null && listGoods.Count > 0)
            {
                List <StorageLocationInfo> listSL = sr.GetAutoAllocationLocation(storageID, count);
            }
        }
示例#3
0
        public static int Remove(long gid)
        {
            StorageLocationRepository mr = new StorageLocationRepository();
            int i = mr.Remove(gid);

            //List<StorageLocationInfo> miList = mr.GetAllStorageLocation();//刷新缓存
            //Cache.Add("StorageLocationALL", miList);
            return(i);
        }
示例#4
0
        public static StorageLocationEntity GetStorageLocationById(long gid)
        {
            StorageLocationEntity     result = new StorageLocationEntity();
            StorageLocationRepository mr     = new StorageLocationRepository();
            StorageLocationInfo       info   = mr.GetStorageLocationByKey(gid);

            result = TranslateStorageLocationEntity(info);
            return(result);
        }
示例#5
0
        public static List <StorageLocationEntity> GetStorageLocationInfoPager(PagerInfo pager)
        {
            List <StorageLocationEntity> all    = new List <StorageLocationEntity>();
            StorageLocationRepository    mr     = new StorageLocationRepository();
            List <StorageLocationInfo>   miList = mr.GetAllStorageLocationInfoPager(pager);

            if (!miList.IsEmpty())
            {
                foreach (StorageLocationInfo mInfo in miList)
                {
                    StorageLocationEntity carEntity = TranslateStorageLocationEntity(mInfo);
                    all.Add(carEntity);
                }
            }
            return(all);
        }
示例#6
0
        public static List <StorageLocationEntity> GetSubAreaNoByStorageAreaNo(string StorageAreaNo, int status)
        {
            List <StorageLocationEntity> all    = new List <StorageLocationEntity>();
            StorageLocationRepository    mr     = new StorageLocationRepository();
            List <StorageLocationInfo>   miList = mr.GetSubAreaNoByStorageAreaNo(StorageAreaNo, status);

            if (!miList.IsEmpty())
            {
                foreach (StorageLocationInfo mInfo in miList)
                {
                    StorageLocationEntity entity = new StorageLocationEntity();
                    entity.StorageSubAreaNo = mInfo.StorageSubAreaNo;
                    all.Add(entity);
                }
            }
            return(all);
        }
示例#7
0
        public static List <StorageLocationEntity> GetStorageLocationInfoByRule(int StorageID, string storageAreaNo, string storagesubareano, int status, PagerInfo pager)
        {
            List <StorageLocationEntity> all    = new List <StorageLocationEntity>();
            StorageLocationRepository    mr     = new StorageLocationRepository();
            List <StorageLocationInfo>   miList = mr.GetStorageLocationInfoByRule(StorageID, storageAreaNo, storagesubareano, status, pager);

            if (!miList.IsEmpty())
            {
                foreach (StorageLocationInfo mInfo in miList)
                {
                    StorageLocationEntity storeEntity = TranslateStorageLocationEntity(mInfo);
                    all.Add(storeEntity);
                }
            }

            return(all);
        }
示例#8
0
        public static List <StorageLocationEntity> GetStorageLocationByKeys(string ids)
        {
            List <StorageLocationEntity> all    = new List <StorageLocationEntity>();
            StorageLocationRepository    mr     = new StorageLocationRepository();
            List <StorageLocationInfo>   miList = mr.GetStorageLocationByKeys(ids);

            if (!miList.IsEmpty())
            {
                foreach (StorageLocationInfo mInfo in miList)
                {
                    StorageLocationEntity entity = TranslateStorageLocationEntity(mInfo);
                    all.Add(entity);
                }
            }

            return(all);
        }
示例#9
0
        public static List <StorageLocationEntity> GetStorageLocationByRule(string name, int storageID, int status)
        {
            List <StorageLocationEntity> all    = new List <StorageLocationEntity>();
            StorageLocationRepository    mr     = new StorageLocationRepository();
            List <StorageLocationInfo>   miList = mr.GetStorageLocationByRule(name, storageID, status);

            if (!miList.IsEmpty())
            {
                foreach (StorageLocationInfo mInfo in miList)
                {
                    StorageLocationEntity StorageLocationEntity = TranslateStorageLocationEntity(mInfo);
                    all.Add(StorageLocationEntity);
                }
            }

            return(all);
        }
示例#10
0
        public static List <StorageLocationEntity> GetStorageLocationAll()
        {
            List <StorageLocationEntity> all    = new List <StorageLocationEntity>();
            StorageLocationRepository    mr     = new StorageLocationRepository();
            List <StorageLocationInfo>   miList = mr.GetAllStorageLocation();//Cache.Get<List<StorageLocationInfo>>("StorageLocationALL");

            //if (miList.IsEmpty())
            //{
            //    miList = mr.GetAllStorageLocation();
            //    Cache.Add("StorageLocationALL", miList);
            //}
            if (!miList.IsEmpty())
            {
                foreach (StorageLocationInfo mInfo in miList)
                {
                    StorageLocationEntity StorageLocationEntity = TranslateStorageLocationEntity(mInfo);
                    all.Add(StorageLocationEntity);
                }
            }

            return(all);
        }