public ActionResult Update(MandantDetailsModel mandantDetailsModel) { if (ModelState.IsValid) { mandantDetailsService.UpdateEntity(mandantDetailsModel); return(View("MandantDetailsSpeichernSuccesfull", mandantDetailsModel)); } PrepareViewBag(mandantDetailsModel); return(View("Index", mandantDetailsModel)); }
private void PrepareViewBag(MandantDetailsModel mandantDetailsModel) { ViewBag.GemeindetypDropDownItems = gemeindeKatalogService.GetGemeindeKatalogModels().ToDropDownItemList(m => localizationService.GetLocalizedBelastungskategorieTyp(m.Typ), m => m.Id, mandantDetailsModel.Gemeindetyp, mandantDetailsModel.Gemeindetyp == null ? string.Empty : null); ViewBag.OeffentlicheVerkehrsmittelDropDownItems = oeffentlicheVerkehrsmittelKatalogService.GetOeffentlicheVerkehrsmittelKatalogModels().ToDropDownItemList(m => localizationService.GetLocalizedBelastungskategorieTyp(m.Typ), m => m.Id, mandantDetailsModel.OeffentlicheVerkehrsmittel, mandantDetailsModel.OeffentlicheVerkehrsmittel == null ? string.Empty : null); }