private void OnVacationApproved(VacationIsApproved message) { if (this.EventsById.TryGetValue(message.EventId, out var calendarEvent)) { this.EventsById[message.EventId] = new CalendarEvent(message.EventId, calendarEvent.Type, calendarEvent.Dates, VacationStatuses.Approved, this.EmployeeId); var text = $"Got vacation approved from {calendarEvent.Dates.StartDate.ToLongDateString()} to {calendarEvent.Dates.EndDate.ToLongDateString()}"; var msg = new Message(Guid.NewGuid().ToString(), this.EmployeeId, "Vacation", text, message.TimeStamp.Date); this.employeeFeed.Tell(new PostMessage(msg)); } }
private void OnVacationApproved(VacationIsApproved message) { if (this.eventsById.TryGetValue(message.EventId, out var calendarEvent)) { this.eventsById[message.EventId] = new CalendarEvent( message.EventId, calendarEvent.Type, calendarEvent.Dates, VacationStatuses.Approved, calendarEvent.EmployeeId); } }