public Sale(string name, Lot lot, Series series, Seller seller, double startPrice, double increment, TimeSpan duration, Category category) { Name = name; Number = 0; Lot = lot; Series = series; StartPrice = startPrice; Increment = increment; Seller = seller; Duration = duration; Category = category; }
public Sale(string name, Lot lot, Seller seller, double startPrice, double increment, TimeSpan duration, Category category) { Name = name; Number = 0; Lot = lot; StartTime = DateTime.Now; _bids = new List<Bid>(); StartPrice = startPrice; Increment = increment; Seller = seller; if (duration < TimeSpan.FromMinutes(1)) { duration = TimeSpan.FromSeconds(1); //исправить! FromMinutes(1) } Duration = duration; Category = category; }
public double GetPriceByCategory(Category category) { return _sales.Where(l => l.Category.Name == category.Name).Select(l => l.CurrentPrice).Sum(); }
public void AddCategory(Category category) { if (!_categories.Any(c => c.Name == category.Name)) { _categories.Add(category); } }
public double GetSummaryPriceByCategory(Category category) { return _series.Select(s => s.GetPriceByCategory(category)).Sum(); }