Пример #1
0
        public void AddDemand(Demand demand)
        {
            if (demand.IsNull())
            {
                throw new ArgumentNullException(nameof(demand));
            }

            GroupDemands newGroupDemand = new GroupDemands(this, demand, false);

            GroupDemands.Add(newGroupDemand);
        }
Пример #2
0
        /// <summary>
        /// Creates a new group for the demand
        /// </summary>
        /// <param name="demand">First demand to be included in the new group (the lead demand)</param>
        public Group(Demand demand)
        {
            if (demand.IsNull())
            {
                throw new ArgumentNullException(nameof(demand));
            }

            Category = demand.Category;
            Offers   = new List <Offer>(); // No offers at the moment
            GroupDemands newGroupDemand = new GroupDemands(this, demand, true);

            GroupDemands = new List <GroupDemands>()
            {
                newGroupDemand
            };
        }
Пример #3
0
 public int GetNumberOfDemands()
 {
     return(GroupDemands.Count());
 }
Пример #4
0
 /// <summary>
 /// Get the demands included
 /// </summary>
 /// <returns></returns>
 public IEnumerable <Demand> GetDemands()
 {
     return(GroupDemands.Select(gd => gd.Demand));
 }