Example #1
0
        public IEnumerable ShowHisAuctions()
        {
            IEnumerable <Aukcje.Auction> list;
            string user = View.loggedUser;

            list = AuctionRepo.GetAuctionsByUser(user);
            foreach (Auction auction in list)
            {
                auction.Price = CurrencyConverter.ConvertMoney(auction.Price);
            }
            return(list);
        }
        public IEnumerable ShowHisAuctions()
        {
            IEnumerable <Aukcje.Auction> list;
            string user = view.loggedUser;

            using (var ctx = new bazaEntities())
            {
                list = from auction in ctx.Auctions
                       join _user in ctx.aspnet_Users
                       on auction.seller equals _user.UserName
                       where (_user.UserName == user)
                       select auction;
                list = list.ToList();
            }
            foreach (Auction auction in list)
            {
                auction.Price = CurrencyConverter.ConvertMoney(auction.Price);
            }
            return(list);
        }