// GET: CompanyLocationGroups
        public async Task <ActionResult> Index()
        {
            AuthorizationState authState   = AuthorizationState.NotAllowed;
            var companyLocationGroupUiDtos = await Task.Run(() => _companyLocationGroupQueries.GetUiDto_CompanyLocationGroups(User.Identity.GetUserId(), out authState));

            if (authState == AuthorizationState.NotAllowed)
            {
                // Insufficient rights, bounce them.
                return(RedirectToAction("Index", "UserCannotAccess"));
            }

            if (companyLocationGroupUiDtos != null && companyLocationGroupUiDtos.Any())
            {
                companyLocationGroupUiDtos = companyLocationGroupUiDtos.OrderBy(i => !i.IsDeleted).ThenByDescending(i => i.CreatedDate).ToList();
            }

            return(View(companyLocationGroupUiDtos));
        }
        // GET: ProfessionalWorkingHours
        public async Task <ActionResult> Index()
        {
            AuthorizationState ignoreAuthstate = AuthorizationState.NotAllowed;

            var proWorkingHoursDtos = await Task.Run(() => _professionalWorkingHoursQueries.GetUiDto_ProfessionalWorkingHoursFromUserGuid(User.Identity.GetUserId()));

            var companyLocationGroupUiDtos = await Task.Run(() => _companyLocationGroupQueries.GetUiDto_CompanyLocationGroups(User.Identity.GetUserId(), out ignoreAuthstate));

            List <ProfessionalWorkingHourVm> workingHourVms = new List <ProfessionalWorkingHourVm>();

            if (proWorkingHoursDtos != null)
            {
                foreach (var row in proWorkingHoursDtos)
                {
                    ProfessionalWorkingHourVm vm = new ProfessionalWorkingHourVm(row, companyLocationGroupUiDtos);
                    workingHourVms.Add(vm);
                }
            }

            return(View(workingHourVms));
        }