public ContentResult StoreName()
        {
            ApplicationUser user  = UserManager.FindById(User.Identity.GetUserId());
            Store           store = StoreRepo.Get(x => x.Id == user.StoreId);

            return(Content(store.Name));
        }
Exemplo n.º 2
0
        public PartialViewResult ProductsByStore(Guid id)
        {
            List <OnAuctionVM> AuctionResult = new List <OnAuctionVM>();

            Store          Store    = StoreRepo.Get(x => x.Id == id);
            List <Auction> Auctions = new List <Auction>();

            Auctions = AuctionRepo.GetAll(x => x.Batch.Product.StoreId == id).ToList();

            foreach (var item in Auctions)
            {
                AuctionResult.Add(new OnAuctionVM()
                {
                    Auction = item,
                    Batch   = item.Batch,
                    Product = item.Batch.Product
                });
            }

            ViewBag.storeName = Store.Name;

            ViewBag.categories = AuctionResult.Select(x => x.Product.Category).Distinct().ToList();
            return(PartialView(AuctionResult));
        }