Пример #1
0
 public void RemoveInterested(Event @event)
 {
     if (!Interests.Any(ui => ui.EventId == @event.EventId))
     {
         throw new Exception("Event not in 'Interested'");
     }
     else
     {
         UserInterested userInterested = Interests.SingleOrDefault(ui => ui.EventId == @event.EventId);
         Interests.Remove(userInterested);
     }
 }
Пример #2
0
 public IEnumerable <(Tax tax, decimal taxValue)> CalcInterestsTaxes()
 {
     if (!Interests.Any())
     {
         return(null);
     }
     else
     {
         var result     = Interests.Sum(x => x.ConvertedBasis);
         var taxProfile = ReportOptions.Profile.TaxesProfiles[TaxClassCodes.General];
         return(taxProfile.ApplyTaxes(result));
     }
 }
Пример #3
0
 public void AddGoing(Event @event)
 {
     if (Goings.Any(ug => ug.EventId == @event.EventId))
     {
         throw new Exception("Event already in 'Going'");
     }
     else if (Interests.Any(ui => ui.EventId == @event.EventId))
     {
         UserInterested userInterested = Interests.SingleOrDefault(ui => ui.EventId == @event.EventId);
         Interests.Remove(userInterested);
         UserGoing userGoing = new UserGoing(this, @event);
         Goings.Add(userGoing);
     }
     else
     {
         UserGoing userGoing = new UserGoing(this, @event);
         Goings.Add(userGoing);
     }
 }