private ActionResult SaveChanges(List <CheckList> viewModels)
        {
            TempData[CommonConstants.FlashMessageTypeInfo] = string.Format(@"CheckList(s): 0 record saved");

            if (viewModels.Any())
            {
                foreach (var viewModel in viewModels)
                {
                    viewModel.CreatedBy = User.Identity.Name.RemoveDomain();
                    viewModel.CreatedOn = DateTime.Now;
                    viewModel.UpdatedBy = User.Identity.Name.RemoveDomain();
                    viewModel.UpdatedOn = DateTime.Now;

                    PatService.SaveCheckList(viewModel);
                }

                var reviewIds = string.Join(", ", viewModels.Select(c => c.ReviewID));
                TempData[CommonConstants.FlashMessageTypeInfo] = string.Format(@"CheckList(s): {0} saved successfully", reviewIds);
            }

            // clear the session
            AppHelper.ClearSessionCheckLists(Session);

            // must exit to the caller otherwise the session will become dirty again.
            return(RedirectToPreviousAction());
        }
        /// <summary>
        /// Save all the checklists value with the current-user-modified checklist
        /// </summary>
        /// <param name="selections">the list of selected reviews</param>
        /// <returns></returns>
        private ActionResult SaveAll(int[] selections)
        {
            TempData[CommonConstants.FlashMessageTypeInfo] = string.Format(@"CheckList(s): 0 record saved");

            if (selections.Any())
            {
                var currentCheckList = AppHelper.GetSessionCheckList(Session);
                if (currentCheckList != null)
                {
                    foreach (var reviewId in selections)
                    {
                        var checklist = new CheckList
                        {
                            ReviewID = reviewId,
                            IsClaimDuplicateOverlapping = currentCheckList.IsClaimDuplicateOverlapping,
                            IsClaimIncludedInDeedNonPayableOutcomeList  = currentCheckList.IsClaimIncludedInDeedNonPayableOutcomeList,
                            DoesDocEvidenceMeetGuidelineRequirement     = currentCheckList.DoesDocEvidenceMeetGuidelineRequirement,
                            IsDocEvidenceConsistentWithESS              = currentCheckList.IsDocEvidenceConsistentWithESS,
                            IsDocEvidenceSufficientToSupportPaymentType = currentCheckList.IsDocEvidenceSufficientToSupportPaymentType,
                            Comment   = (currentCheckList.Comment ?? string.Empty).Trim(),
                            CreatedBy = User.Identity.Name.RemoveDomain(),
                            CreatedOn = DateTime.Now,
                            UpdatedBy = User.Identity.Name.RemoveDomain(),
                            UpdatedOn = DateTime.Now
                        };

                        PatService.SaveCheckList(checklist);
                    }

                    var reviewIds = string.Join(", ", selections.Select(id => id));
                    TempData[CommonConstants.FlashMessageTypeInfo] = string.Format(@"CheckList(s): {0} saved successfully", reviewIds);
                }
            }

            // clear the session
            AppHelper.ClearSessionCheckLists(Session);

            // must exit to the caller otherwise the session will become dirty again.
            return(RedirectToPreviousAction());
        }