Beispiel #1
0
        private void LoadBids(LoadContentContext context, BidsPart part)
        {
            part._bidsFields.Loader(field => {
                var bids = _bidService.GetBidsForBidedContent(context.ContentItem.Id);
                return(bids.List());
            });

            part._heighestBidField.Loader(field => part
                                          ._bidsFields
                                          .Value
                                          .OrderByDescending(b => b.BidPrice)
                                          .FirstOrDefault());
        }
Beispiel #2
0
        public ActionResult Details(int id, BidDetailsOptions options)
        {
            // Default options
            if (options == null)
            {
                options = new BidDetailsOptions();
            }

            // Filtering
            var bids = _bidService.GetBidsForBidedContent(id);

            var entries = bids.List().Select(CreateBidEntry).ToList();
            var model   = new BidsDetailsViewModel {
                Bids    = entries,
                Options = options,
                DisplayNameForBidedItem = _bidService.GetDisplayForBidedContent(id) == null ? "" : _bidService.GetDisplayForBidedContent(id).DisplayText,
                BidedItemId             = id,
                BidsClosedOnItem        = _bidService.BidsDisabledForBidedContent(id),
            };

            return(View(model));
        }