コード例 #1
0
        public ActionResult GetOrgtypesForSubDirectory(RegisterViewModels.RegisterViewModel model, int delregId = 0)
        {
            var subdirId = model.SelectedSubDirectoryId;

            if (subdirId == 0 && delregId != 0)
            {
                subdirId = delregId;
            }

            if (subdirId != 0)
            {
                var delregsOrgtyper = _portalSosService.HamtaDelRegistersOrganisationstyper(subdirId);
                var allaOrgtyper    = _portalSosService.HamtaAllaOrganisationstyper();
                model.DelRegistersOrganisationstyper = ConvertAdmUppgiftsskyldighetOrganisationstypToVM(delregsOrgtyper, allaOrgtyper);
                model.SelectedDirectoryId            = subdirId;
            }

            // Ladda drop down lists.
            var delregisterList = _portalSosService.HamtaAllaDelregisterForPortalen().ToList();

            this.ViewBag.DelregisterList = CreateDelRegisterDropDownList(delregisterList);

            return(View("EditSubDirectorysOrgtypes", model));
        }