示例#1
0
        public void RemoveByStoreIdAndItemId(Guid storeId, Guid itemId)
        {
            StoreItem si = _storeItemRepository.FindByStoreIdAndItemId(storeId, itemId);
            ICollection <AvailableSize> sizes = _asService.FindBySIId(si.Id);

            foreach (AvailableSize a in sizes)
            {
                _asService.RemoveBySIIdAndSize(a.SIId, a.Size);
            }
            _storeItemRepository.Remove(si.Id);
        }
示例#2
0
        public ItemVM GetItemByStoreItemId(Guid storeItemId)
        {
            StoreItem            si    = _storeItemService.FindById(storeItemId);
            Item                 item  = _itemService.FindById(si.ItemId);
            Store                store = _storeService.FindById(si.StoreId);
            List <AvailableSize> ases  = (List <AvailableSize>)_availableSizeService.FindBySIId(si.Id);

            ases.Sort((x, y) => x.Size.CompareTo(y.Size));
            ICollection <string> pics = ConvertPictures(_pictureService.FindByItemId(si.ItemId));

            return(ConvertToVM(item, si.Price, store.Name, si.Id, ases, pics));
        }