public ActionResult AdvancedCreate(string Tab) { NavBarItem navBarItem = GStoreDb.NavBarItems.Create(); navBarItem.SetDefaultsForNew(CurrentStoreFrontOrThrow); NavBarItemEditAdminViewModel viewModel = new NavBarItemEditAdminViewModel(navBarItem, CurrentUserProfileOrThrow, Tab, isCreatePage: true); return(View("AdvancedCreate", viewModel)); }
public ActionResult Create(int?id) { NavBarItem navBarItem = GStoreDb.NavBarItems.Create(); navBarItem.SetDefaultsForNew(CurrentStoreFrontOrThrow); if (id.HasValue) { NavBarItem parentNavBarItem = CurrentStoreFrontOrThrow.NavBarItems.SingleOrDefault(nb => nb.NavBarItemId == id.Value); if (parentNavBarItem != null) { navBarItem.ParentNavBarItem = parentNavBarItem; navBarItem.ParentNavBarItemId = parentNavBarItem.NavBarItemId; } } NavBarItemEditAdminViewModel viewModel = new NavBarItemEditAdminViewModel(navBarItem, CurrentUserProfileOrThrow, null, isCreatePage: true); return(View("Create", viewModel)); }