Exemplo n.º 1
0
        // GET: /Manage/Name
        public ActionResult ChangeChosenOrgUnits(int selectedSubdirId = 0)
        {
            var model             = new SubdirViewModel();
            var userId            = User.Identity.GetUserId();
            var subdir            = _portalService.HamtaDelregister(selectedSubdirId);
            var orgId             = _portalService.HamtaUserOrganisationId(userId);
            var availableOrgUnits = _portalService.HamtaDelregistersAktuellaEnheter(selectedSubdirId, orgId).ToList();
            var usersOrgUnits     = _portalService.HamtaAnvandarensValdaEnheterForDelreg(userId, selectedSubdirId).ToList();

            model.Id = selectedSubdirId;
            model.Delregisternamn = subdir.Delregisternamn;
            model.OrgUnitList     = ConvertOrgUnitsToVM(availableOrgUnits, usersOrgUnits);
            return(View(model));
        }