Пример #1
0
        private void OnVacationRequested(VacationIsRequested message)
        {
            var datesPeriod   = new DatesPeriod(message.StartDate, message.EndDate);
            var calendarEvent = new CalendarEvent(message.EventId, CalendarEventTypes.Vacation, datesPeriod, VacationStatuses.Requested, this.EmployeeId);

            this.EventsById[message.EventId] = calendarEvent;
        }
Пример #2
0
 private void OnVacationDatesEdit(VacationDatesAreEdited message)
 {
     if (this.EventsById.TryGetValue(message.EventId, out var calendarEvent))
     {
         var newDates = new DatesPeriod(message.StartDate, message.EndDate);
         this.EventsById[message.EventId] = new CalendarEvent(message.EventId, calendarEvent.Type, newDates, calendarEvent.Status, this.EmployeeId);
     }
 }
Пример #3
0
 private void OnSickLeaveProlonged(SickLeaveIsProlonged message)
 {
     if (this.EventsById.TryGetValue(message.EventId, out var calendarEvent))
     {
         var dates = new DatesPeriod(calendarEvent.Dates.StartDate, message.EndDate);
         this.EventsById[message.EventId] = new CalendarEvent(message.EventId, calendarEvent.Type, dates, calendarEvent.Status, this.EmployeeId);
     }
 }
Пример #4
0
        private void OnChangeRequested(WorkHoursChangeIsRequested message)
        {
            var eventType = message.IsDayoff ? CalendarEventTypes.Dayoff : CalendarEventTypes.Workout;

            var datesPeriod   = new DatesPeriod(message.Date, message.Date, message.StartHour, message.EndHour);
            var calendarEvent = new CalendarEvent(message.EventId, eventType, datesPeriod, WorkHoursChangeStatuses.Requested, this.EmployeeId);

            this.EventsById[message.EventId] = calendarEvent;
        }
Пример #5
0
        private void OnSickLeaveRequested(SickLeaveIsRequested message)
        {
            var datesPeriod = new DatesPeriod(message.StartDate, message.EndDate);

            this.eventsById[message.EventId] = new CalendarEvent(
                message.EventId,
                CalendarEventTypes.Sickleave,
                datesPeriod,
                SickLeaveStatuses.Requested,
                this.employeeId);
        }
 public SendNotificationEnd(EmployeesQuery.Response response, DatesPeriod datesPeriod)
 {
     this.DatesPeriod = datesPeriod;
     this.Employee    = response.Employees.FirstOrDefault();
 }