public override void Update(TrackResult e) { Workaholic ev = e as Workaholic; if (ev == null) { return; } ev.Habits.AddLogsHabit(1, DateTime.Now); }
public override void Update(Trigger e) { if (badgeRepository == null) { return; } Workaholic ev = e as Workaholic; if (ev == null) { return; } Badge badge = _gainer.Gain(); Badge b = badgeRepository.FindByName(badge.Name); if (b == null) { badgeRepository.Create(badge); b = badgeRepository.FindByName(badge.Name); } badgeRepository.AddUser(b, ev.User_id); }