public void UpdateEmployeeNotificationEmailSent(Employee employee, EmployeeTasks employeeNotification)
        {
            try
            {
                UserForAuditing user = null;

                try
                {
                    if (employee.User != null)
                    {
                        user = _userForAuditingRepository.GetByIdAndCompanyId(employee.User.Id, employee.CompanyId);
                    }
                }
                catch (UserNotFoundException ex) 
                {
                    Log.Debug(String.Format("*** User Not Found. Using System User for Auditing *** - UserId: {0} CompanyId: {1} Employee - ID: {2} FullName: {3}", 
                                employee.User.Id, employee.CompanyId, employee.Id, employee.FullName ));               
                }

                if (user == null)
                {
                    user = _userForAuditingRepository.GetSystemUser();
                }

                if (employeeNotification.AnyCompletedTasks(employee))
                {

                    employeeNotification.GeneralRiskAssessmentTasksCompleted
                       .Where(task => EmployeeNotificationsHelper.CanSendTaskCompletedNotification(task, employee))
                       .ForEach(task =>
                       {
                           EmployeeNotificationsHelper.AddEmployeeTaskCompletedNotification(task, employee, user);
                           _tasksRepository.Save(task);
                       });

                    employeeNotification.PersonalRiskAssessmentTasksCompleted
                       .Where(task => EmployeeNotificationsHelper.CanSendTaskCompletedNotification(task, employee))
                       .ForEach(task =>
                       {
                           EmployeeNotificationsHelper.AddEmployeeTaskCompletedNotification(task, employee, user);
                           _tasksRepository.Save(task);
                       });

                    employeeNotification.FireRiskAssessmentTasksCompleted
                        .Where(task => EmployeeNotificationsHelper.CanSendTaskCompletedNotification(task, employee))
                        .ForEach(task =>
                        {
                            EmployeeNotificationsHelper.AddEmployeeTaskCompletedNotification(task, employee, user);
                            _tasksRepository.Save(task);
                        });

                    employeeNotification.HazardousSubstanceTasksCompleted
                        .Where(task => EmployeeNotificationsHelper.CanSendTaskCompletedNotification(task, employee))
                        .ForEach(task =>
                        {
                            EmployeeNotificationsHelper.AddEmployeeTaskCompletedNotification(task, employee, user);
                            _tasksRepository.Save(task);
                        });

                
                    _tasksRepository.Flush();
            }
                  }
            catch (Exception ex)
            {
                Log.Debug("Exception  - UpdateEmployeeNotificationEmailSent() " + ex.Message);
                throw;
            }
        }