public bool CanStillBidOn(BidsPart bidsPart) { var bidsettings = _orchardServices.WorkContext.CurrentSite.As <BidSettingsPart>(); if (bidsettings == null) { return(false); } if (bidsettings.ClosedBidsDelay > 0) { var commonPart = bidsPart.As <CommonPart>(); if (bidsPart == null) { return(false); } if (!commonPart.CreatedUtc.HasValue) { return(false); } if (commonPart.CreatedUtc.Value.AddDays(bidsettings.ClosedBidsDelay) < _clock.UtcNow) { return(false); } } return(true); }
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()); }
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()); }
public BidCountViewModel(BidsPart part) { Item = part.ContentItem; //BidCount = part.Bids.Count; }
public bool CanStillBidOn(BidsPart bidsPart) { var bidsettings = _orchardServices.WorkContext.CurrentSite.As<BidSettingsPart>(); if (bidsettings == null) { return false; } if (bidsettings.ClosedBidsDelay > 0) { var commonPart = bidsPart.As<CommonPart>(); if (bidsPart == null) { return false; } if (!commonPart.CreatedUtc.HasValue) { return false; } if (commonPart.CreatedUtc.Value.AddDays(bidsettings.ClosedBidsDelay) < _clock.UtcNow) { return false; } } return true; }