public virtual void CreateCampaign(DateTime now, Demographic demographic, DateTime start, DateTime end)
        {
            if (LatestCampaign != null && LatestCampaign.GetStatus(now) != CampaignStatus.Ended)
            {
                throw new InvalidOperationException("You can't start a campaign until the existing one has ended.");
            }

            var campaign = new Campaign(demographic, start, end);

            _campaigns.Add(campaign);
            LatestCampaign = campaign;
        }
示例#2
0
 public Campaign(Demographic demographic, DateTime startDate, DateTime endDate)
 {
     Demographic = demographic;
     StartDate   = startDate;
     EndDate     = endDate;
 }