public async virtual Task<ActionResult> AddMultipleActivities(MultipleActivityViewModel multipleActivityViewModel)
        {
            Arg.IsNotNull(() => multipleActivityViewModel);

            var failedEmployeeIds = new List<int>();
            foreach (var employeeId in multipleActivityViewModel.SelectedEmployeeIds)
            {
                var submittedActivity = SubmitActivity.CreateActivitySubmission(AuthenticatedUser.EmployeeId);
                submittedActivity.ActivityId = multipleActivityViewModel.SelectedActivityId;
                submittedActivity.Notes = multipleActivityViewModel.Notes;
                submittedActivity.EmployeeId = employeeId;

                var activityEdit = await ActivityEdit.GetActivityEditByIdAsync(submittedActivity.ActivityId);
                submittedActivity.EntryType = activityEdit.EntryType;

                if (!await SaveObjectAsync(submittedActivity, false))
                {
                    failedEmployeeIds.Add(submittedActivity.EmployeeId);
                }
            }

            if (failedEmployeeIds.Count > 0)
            {
                var allEmployees = await UserCollection.GetAllAvailabileUsersForCurrentUserAsync();
                var allActivities = await ActivityCollection.GetAllActivitiesAsync(false);
                var employeeNames = new List<string>();
                foreach (var employeeId in failedEmployeeIds)
                {
                    var employee = allEmployees.Where(ui => ui.EmployeeId == employeeId).Single();
                    employeeNames.Add(employee.FullName);
                }

                var employeeNameOutput = String.Join(", ", employeeNames);
                var activity = allActivities.Where(ai => ai.Id == multipleActivityViewModel.SelectedActivityId).Single();
                var errorMessage = String.Format(ApplicationResources.MultipleActivityErrorMessage, activity.Name, employeeNameOutput);
                ModelState.AddModelError("*", errorMessage);
                return await MultipleActivities();
            }

            return RedirectToAction(Mvc.PointsReport.Index().Result);
        }
 public async virtual Task<ActionResult> MultipleActivities()
 {
     var allActivities = await ActivityCollection.GetAllActivitiesAsync(false);
     var allEmployees = await UserCollection.GetAllAvailabileUsersForCurrentUserAsync();
     var multipleActivityViewModel = new MultipleActivityViewModel(allActivities, allEmployees);
     return View(Mvc.BadgeManager.Views.MultipleActivities, multipleActivityViewModel);
 }