Exemple #1
0
        public ActionResult UpdateOrganisationsOrgUnit(Organisationsenhet orgUnit)
        {
            var org = new Organisation();

            try
            {
                org = _portalAdminService.HamtaOrgForOrganisationsenhet(orgUnit.Id);
                if (ModelState.IsValid)
                {
                    var userName = User.Identity.GetUserName();
                    _portalAdminService.UppdateraOrganisationsenhet(orgUnit, userName);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                ErrorManager.WriteToErrorLog("OrganisationController", "UpdateOrganisationsOrgUnit", e.ToString(), e.HResult,
                                             User.Identity.Name);
                var errorModel = new CustomErrorPageModel
                {
                    Information  = "Ett fel inträffade vid uppdatering av organisationsenhet.",
                    ContactEmail = ConfigurationManager.AppSettings["ContactEmail"],
                };
                return(View("CustomError", errorModel));
            }
            return(RedirectToAction("GetOrganisationsOrgUnits", new { selectedOrgId = org.Id }));
        }