Ejemplo n.º 1
0
        public Task Handle(TimesheetSubmitted notification, CancellationToken cancellationToken)
        {
            ApplicationUser user = _userManager.FindByIdAsync(notification.OwnerId).Result;
            string          msg  = string.Format("Your timesheet for week beginning {0} has been successfully submitted", notification.WeekStarting.ToShortDateString());

            _emailService.SendMail("*****@*****.**", user.Email, "Timesheet Submitted", msg, "", string.Empty, string.Empty);
            return(Task.CompletedTask);
        }
Ejemplo n.º 2
0
        protected override void Handle(Commands.SubmitTimesheet command)
        {
            var dateTime = DateTime.UtcNow;

            var @event = new TimesheetSubmitted(
                command.TimesheetId,
                command.UserId,
                command.StartDate,
                command.EndDate,
                dateTime);

            _saveEventService.SaveEvent(@event, dateTime);
        }