protected virtual bool HandleTrackWork(TrackWorkAction action) { if (this.CheckGuards(action)) { var e = new WorkEventArgs(action.Hours, action.Date, action.Employee, action.TaskAddress); this.TrackedWork?.Invoke(this, e); } return(true); }
protected virtual void HandleTrackedWork(WorkEventArgs eventArgs) { TimeSpan diffResult = eventArgs.Date.Subtract(this.PeriodDate); if ((decimal)diffResult.TotalDays >= this.HistoryClearPeriodInDays) { this.PeriodDate = eventArgs.Date; this.EventsHistory = new HashSet <WorkEventArgs>(); } this.EventsHistory.Add(eventArgs); }