public async Task <IActionResult> CountryEdit( Guid?countryId, int returnPageNumber = 1 ) { GeoCountryViewModel model; if ((countryId != null) && (countryId.Value != Guid.Empty)) { ViewData["Title"] = sr["Edit Country"]; var country = await dataManager.FetchCountry(countryId.Value); model = GeoCountryViewModel.FromIGeoCountry(country); var currentCrumbAdjuster = new NavigationNodeAdjuster(Request.HttpContext); currentCrumbAdjuster.KeyToAdjust = "CountryEdit"; currentCrumbAdjuster.AdjustedText = sr["Edit Country"]; currentCrumbAdjuster.ViewFilterName = NamedNavigationFilters.Breadcrumbs; // this is default but showing here for readers of code currentCrumbAdjuster.AddToContext(); } else { ViewData["Title"] = sr["New Country"]; model = new GeoCountryViewModel(); } model.ReturnPageNumber = returnPageNumber; return(View(model)); }
public async Task <IActionResult> CountryEdit( Guid?guid, int returnPageNumber = 1, bool partial = false) { ViewBag.Title = "Edit Country"; GeoCountryViewModel model; if ((guid != null) && (guid.Value != Guid.Empty)) { IGeoCountry country = await dataManager.FetchCountry(guid.Value); model = GeoCountryViewModel.FromIGeoCountry(country); NavigationNodeAdjuster currentCrumbAdjuster = new NavigationNodeAdjuster(Request.HttpContext); currentCrumbAdjuster.KeyToAdjust = "CountryEdit"; currentCrumbAdjuster.AdjustedText = "Edit Country"; currentCrumbAdjuster.ViewFilterName = NamedNavigationFilters.Breadcrumbs; // this is default but showing here for readers of code currentCrumbAdjuster.AddToContext(); } else { ViewBag.Title = "New Country"; model = new GeoCountryViewModel(); } model.ReturnPageNumber = returnPageNumber; if (partial) { return(PartialView("CountryEditPartial", model)); } return(View(model)); }