Error executing template "Designs/kyner/_partials/header.cshtml"
System.IndexOutOfRangeException: ProductGroupFieldID
at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
at System.Data.SqlClient.SqlDataReader.get_Item(String name)
at Dynamicweb.Ecommerce.Products.ProductGroupField.Fill(IDataReader dataReader)
at Dynamicweb.Ecommerce.Products.ProductGroupFieldCollection.Load(String query)
at Dynamicweb.Ecommerce.Products.ProductGroupField.GetProductGroupFields()
at Dynamicweb.Ecommerce.Common.ApplicationDependencies.GetProductGroupFields()
at Dynamicweb.Ecommerce.Products.GroupService.InitializeCache()
at Dynamicweb.Caching.DictionaryCache`2.InitializeCacheDictionary()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Dynamicweb.Caching.DictionaryCache`2.GetCacheResult(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(TKey key)
at Dynamicweb.Ecommerce.Products.GroupService.GetGroup(String groupId, String languageId, Boolean showUnTranslated)
at Dynamicweb.Ecommerce.Frontend.Navigation.GroupNavigationTreeNodeProvider.GetPrimaryPath(String groupId, String languageId)
at Dynamicweb.Ecommerce.Frontend.Navigation.GroupNavigationTreeNodeProvider.InitializeContext(NavigationContext context)
at Dynamicweb.Frontend.Navigation.NavigationService.GetNavigation(NavigationContext context, NavigationSettings settings)
at Dynamicweb.Frontend.Navigation.NavigationTemplateHelper.GetNavigationViewModel(NavigationSettings settings)
at Dynamicweb.Frontend.Navigation.NavigationTemplateHelper.RenderNavigation(String templatePath, NavigationSettings settings)
at CompiledRazorTemplates.Dynamic.RazorEngine_3b749d159cf248289d511f104682d060.Execute() in E:\Dynamicweb.NET\Solutions\kyner-espresso-4\Files\Templates\Designs\kyner\_partials\header.cshtml:line 83
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits ViewModelTemplate<PageBaseModel>
2 @using Dynamicweb.Rendering
3 @using Co3.Espresso.Website.Models.FrontEnd
4 @using Co3.Espresso.Website.Models.FrontEnd.Elements
5 @using Co3.Espresso.Website.Models.FrontEnd.Pages
6 @using Co3.Espresso.Website.Models.FrontEnd.Settings
7 @using Co3.Espresso.Website.Services
8 @using Co3.Kyner.Website.Frontend.Services
9 @using Dynamicweb.Frontend
10 @using Dynamicweb.Frontend.Navigation
11 @using Dynamicweb.Security.UserManagement
12 @using System.Web
13 @{
14 User currentUser = PageView.Current().User;
15 bool isUserAuthenticated = currentUser != null;
16 string user = "";
17 if (isUserAuthenticated)
18 {
19 user = PageView.Current().User.UserName;
20 }
21 22 23 ClassList headerClasses = new ClassList();
24 headerClasses.AddClasses("e-header js-e-header is-sticky");
25 if (Model.Item.HeaderTransparent == "True")
26 {
27 headerClasses.AddClasses("is-transparent");
28 }
29 30 ClassList logoClasses = new ClassList();
31 logoClasses.AddClasses("e-logo");
32 33 string backButtonLink = Model.Item.BackButtonLink;
34 ClassList backButtonClasses = new ClassList();
35 ClassList backButtonIconClasses = new ClassList();
36 if (Model.Item.BackButton == "True")
37 {
38 backButtonClasses.AddClasses("btn btn-sm btn-secondary my-1 align-self-center");
39 if (backButtonLink == "" || backButtonLink == "/")
40 {
41 backButtonLink = "/";
42 backButtonClasses.AddClasses("js-e-back-link");
43 }
44 backButtonIconClasses.AddClasses("material-icons material-icons-large");
45 if (Model.Item.BackButtonPosition == "right")
46 {
47 backButtonClasses.AddClasses("mr-0 ml-auto order-last");
48 logoClasses.AddClasses("order-first");
49 }
50 else
51 {
52 backButtonClasses.AddClasses("order-first");
53 logoClasses.AddClasses("mr-0 order-last");
54 }
55 if (Model.Item.BackButtonIcon == "arrow_back")
56 {
57 backButtonClasses.AddClasses("arrow-left");
58 backButtonIconClasses.AddClasses("d-none");
59 }
60 else if (Model.Item.BackButtonIcon == "arrow_forward")
61 {
62 backButtonClasses.AddClasses("arrow-right");
63 backButtonIconClasses.AddClasses("d-none");
64 }
65 }
66 67 string companyName = Model.Area.Item.CompanyName;
68 string logoPrimary = Model.Area.Item.LogoPrimary;
69 string logoSecondary = Model.Area.Item.LogoSecondary;
70 string altTag = Model.Area.Item.AltTag;
71 string tagline = Model.Area.Item.Tagline;
72 73 if (string.IsNullOrEmpty(altTag))
74 {
75 altTag = companyName + " - " + tagline;
76 }
77 78 if (string.IsNullOrEmpty(logoSecondary))
79 {
80 logoSecondary = logoPrimary;
81 }
82 83 Dictionary< string, string > navigationHtml = new Dictionary< string, string >
84 {
85 {
86 "global", Navigation.RenderNavigation( "navigation/espresso.cshtml", new NavigationSettings()
87 {
88 StartLevel = 1,
89 StopLevel = 3,
90 ExpandMode = ExpandMode.All,
91 Parameters = new Dictionary< string, object >()
92 {
93 { "id", "global" }
94 }
95 } )
96 },
97 {
98 "utilities-primary", Navigation.RenderNavigation( "navigation/espresso.cshtml", new NavigationSettings()
99 {
100 StartLevel = 4,
101 StopLevel = 5,
102 ExpandMode = ExpandMode.All,
103 RootNavigationTag = "utilitiesprimary",
104 Parameters = new Dictionary< string, object >()
105 {
106 { "id", "utilities-primary" }
107 }
108 } )
109 },
110 {
111 "aside", Navigation.RenderNavigation( "navigation/espresso.cshtml", new NavigationSettings()
112 {
113 StartLevel = 4,
114 StopLevel = 5,
115 ExpandMode = ExpandMode.All,
116 RootNavigationTag = "aside",
117 Parameters = new Dictionary< string, object >()
118 {
119 { "id", "aside" }
120 }
121 } )
122 },
123 {
124 "hamburger-header", Navigation.RenderNavigation( "navigation/espresso.cshtml", new NavigationSettings()
125 {
126 StartLevel = 4,
127 StopLevel = 5,
128 ExpandMode = ExpandMode.All,
129 RootNavigationTag = "hamburgerheader",
130 Parameters = new Dictionary< string, object >()
131 {
132 { "id", "hamburger-header" }
133 }
134 } )
135 }
136 };
137138 @*Dictionary<string, string> navigationHtml = new Dictionary<string, string>
139 {
140 {
141 "global", RenderNavigation(new
142 {
143 id = "dwnav-global",
144 template = "global.xslt",
145 startlevel = 1,
146 endlevel = 8,
147 expandmode = "all"
148 })
149 },
150 {
151 "utilities-primary", RenderNavigation(new
152 {
153 id = "dwnav-utilities-primary",
154 template = "utilities.xslt",
155 startlevel = 4,
156 endlevel = 5,
157 expandmode = "all",
158 parenttag = "utilitiesprimary"
159 })
160 },
161 {
162 "utilities-secondary", RenderNavigation(new
163 {
164 id = "dwnav-utilities-secondary",
165 template = "utilities.xslt",
166 startlevel = 4,
167 endlevel = 5,
168 expandmode = "all",
169 parenttag = "utilitiesecondary"
170 })
171 },
172 {
173 "aside", RenderNavigation(new
174 {
175 id = "dwnav-aside",
176 template = "utilities.xslt",
177 startlevel = 4,
178 endlevel = 5,
179 expandmode = "all",
180 parenttag = "aside"
181 })
182 },
183 {
184 "hamburger-header", RenderNavigation(new
185 {
186 id = "dwnav-hamburger-header",
187 template = "utilities.xslt",
188 startlevel = 4,
189 endlevel = 4,
190 expandmode = "all",
191 parenttag = "hamburgerheader"
192 })
193 }
194 };*@
195 }
196 @if (Model.Item.HeaderHide != "True")
197 {
198 <header class="@headerClasses" data-autohide="true">
199200 <div class="e-header-hamburger">
201 @RenderingService.Instance.SectionStart(new SectionSettings
202 {Classes = new ClassList("e-header-section e-section"), ContentClasses = new ClassList("col-12")})
203 <div class="col-12 e-header-section-content">
204 <div class="@logoClasses">
205 <a class="e-logo-link" href="/">
206 <img alt="" src="@logoPrimary" class="e-logo-img e-logo-img-primary">
207 <img alt="" src="@logoSecondary" class="e-logo-img e-logo-img-secondary">
208 @if (string.IsNullOrEmpty(tagline) == false)
209 {
210 <p class="e-logo-tagline">@tagline</p>
211 }
212 </a>
213 </div>
214 @if (Model.Item.NavigationHide != "True")
215 {
216 <section class="e-nav-hamburger-header">
217 <ul class="nav">
218 @navigationHtml["hamburger-header"]
219 <li class="e-nav-item-hamburger-open nav-item">
220 <a class="nav-link" data-target=".modal.e-nav" data-toggle="modal" href="#">
221 <i class="e-nav-pageicon material-icons">menu</i>
222 <span class="e-nav-pagename">@Translate("Header - Hamburger menu open - Button", "Menu")</span>
223 </a>
224 </li>
225 </ul>
226 </section>
227 }
228 @if (Model.Item.BackButton == "True")
229 {
230 <a class="@backButtonClasses" href="@backButtonLink">
231 @if (Model.Item.BackButtonIcon != "")
232 {
233 <i class="@backButtonIconClasses">@Model.Item.BackButtonIcon</i>
234 }
235 @Model.Item.BackButtonText
236 </a>
237 }
238 </div>
239 @RenderingService.Instance.SectionEnd()
240 </div>
241 <div class="e-nav js-e-nav modal p-0" data-backdrop="false">
242 <div class="navbar">
243244245 @if (Model.Item.NavigationHide != "True")
246 {
247 if (string.IsNullOrEmpty(navigationHtml["utilities-primary"]) == false)
248 {
249250 @RenderingService.Instance.SectionStart(
251 new SectionSettings
252 {
253 Classes = new ClassList("e-header-section e-header-section-secondary e-section "),
254 ContentClasses = new ClassList("col-12")
255 }
256 )
257 @:<div class="col-12 e-header-section-content">
258259 <nav class="e-nav-utilities-primary js-e-nav-utilities-primary">
260 <ul class="nav">
261 @navigationHtml["utilities-primary"]
262 </ul>
263 </nav>
264265 if (isUserAuthenticated)
266 {
267268 string actionInput = HttpContext.Current.Request[ "Action" ];
269 bool hidePricesChecked = KynerProductService.Instance.HidePrices();
270 if ( !string.IsNullOrEmpty(actionInput) )
271 {
272 hidePricesChecked = KynerProductService.Instance.ToggleHidePrices();
273 }
274275 <nav class="e-nav-utilities-secondary">
276 <ul class="nav">
277278279280 <li class="nav-item">
281 <span class="nav-link cursor-default"><span class="font-weight-normal">@Translate("Header - User name text - text", "Du er logget ind som:") </span> @user</span>
282 </li>
283 @*navigationHtml["utilities-secondary"]*@
284285 </ul>
286 </nav>
287 }
288289 @RenderingService.Instance.SectionEnd()
290 }
291 }
292293 @RenderingService.Instance.SectionStart(
294 new SectionSettings
295 {Classes = new ClassList("e-header-section e-header-section-primary e-section"), ContentClasses = new ClassList("col-12")}
296 )
297 <div class="col-12 e-header-section-content">
298 <div class="@logoClasses">
299 <a class="e-logo-link" href="/">
300 <img src="@logoPrimary" class="e-logo-img e-logo-img-primary" alt="@altTag">
301 <img src="@logoSecondary" class="e-logo-img e-logo-img-secondary" alt="">
302 @if (string.IsNullOrEmpty(tagline) == false)
303 {
304 <p class="e-logo-tagline">@tagline</p>
305 }
306 </a>
307 </div>
308309 <div class="kyner-header-search">
310 @if (string.IsNullOrEmpty(navigationHtml["aside"]) == false)
311 {
312 <nav class="e-nav-aside">
313 <ul class="nav">
314 @navigationHtml["aside"]
315 </ul>
316 </nav>
317 }
318 <form action="" class="e-search-form js-e-search-form-inline">
319 <div class="e-search-input-group is-empty js-e-search-input-group">
320 <label class="e-search-label" for="e-search-input">
321 <i class="material-icons">search</i>
322 </label>
323 @{ string translateSearchInputText = Translate("Search - Input Placeholder - Text", "Search"); }
324 <input type="text" class="border-0 e-search-input form-control-plaintext js-e-search-input" name="q" id="e-search-input" placeholder="@translateSearchInputText">
325 <span class="e-search-clear js-e-search-clear">
326 <i class="material-icons">close</i>
327 </span>
328 <button class="d-none btn btn-primary e-search-submit" type="submit">
329 <i class="material-icons">search</i>
330 </button>
331 </div>
332 </form>
333 </div>
334335336 <div class="e-nav-item-hamburger-close">
337 <a class="nav-link" data-target=".modal.e-nav" data-toggle="modal" href="#">
338 <i class="e-nav-pageicon material-icons">close</i>
339 <span class="e-nav-pagename">@Translate("Header - Hamburger menu close - Button", "Close")</span>
340 </a>
341 </div>
342343344 </div>
345346 @RenderingService.Instance.SectionEnd()
347348349350 <section class="e-header-section kyner-header-section-menu e-section">
351 <div class="container-fluid">
352353354 @if (Model.Item.NavigationHide != "True")
355 {
356357 <nav class="e-nav-global js-e-nav-global">
358 <ul class="nav">
359 @navigationHtml["global"]
360 </ul>
361 </nav>
362363 }
364 @if (Model.Item.BackButton == "True")
365 {
366 <a class="@backButtonClasses" href="@backButtonLink">
367 @if (Model.Item.BackButtonIcon != "")
368 {
369 <i class="@backButtonIconClasses">@Model.Item.BackButtonIcon</i>
370 }
371 @Model.Item.BackButtonText
372 </a>
373 }
374 </div>
375376 </section>
377378379380 </div>
381382 </div>
383384 </header>
385 }
386
Error executing template "Designs/kyner/_partials/breadcrumb.cshtml"
System.IndexOutOfRangeException: ProductCreated
at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
at System.Data.SqlClient.SqlDataReader.get_Item(String name)
at Dynamicweb.Ecommerce.Products.ProductRepository.ExtractProductInternal(IDataReader dataReader, Nullable`1& groupProductRelationSortingExists)
at Dynamicweb.Ecommerce.Products.ProductRepository.ExtractProduct(IDataReader dataReader, Nullable`1& groupProductRelationSortingExists)
at Dynamicweb.Ecommerce.Products.ProductRepository.GetProductsBySql(CommandBuilder query, Boolean doRefactoring, Boolean bulkFill, Boolean useAssortments)
at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.TryAddProducts(GroupNavigationItem groupItem, Group group, Int32 currentLevel, Int32 maxLevel, Page productPage, Page currentPage)
at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(IEnumerable`1 groups, Page page, NavigationItem parentNode, Int32 thisLevel, Int32 maxLevel, Page productPage)
at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(Page page, NavigationItem parentNode)
at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.Process(NavigationItem node)
at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.ProcessTree(RootNavigationItem rootNode, NavigationType navigationType)
at Dynamicweb.Frontend.XmlNavigation.MakeXml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, Int32 selectedAreaId)
at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, String name, String xsltPath, Int32 selectedAreaId, Boolean sitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode)
at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes)
at CompiledRazorTemplates.Dynamic.RazorEngine_da43b2e054ea4495837e8af647a46b48.Execute() in E:\Dynamicweb.NET\Solutions\kyner-espresso-4\Files\Templates\Designs\kyner\_partials\breadcrumb.cshtml:line 15
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits ViewModelTemplate< PageBaseModel >
2 @using Co3.Espresso.Website.Models.FrontEnd
3 @using Dynamicweb.Rendering
4 @using Co3.Espresso.Website.Models.FrontEnd.Pages
5 @using Co3.Espresso.Website.Models.FrontEnd.Settings
6 @using Co3.Espresso.Website.Services
7 @using Dynamicweb.Content;
8 @using Dynamicweb.Extensibility;
9 @{
10 ClassList breadcrumbClasses = new ClassList( "e-section e-breadcrumb js-e-breadcrumb d-none d-md-block" );
11 if ( Model.Item.Breadcrumb != "auto" && Model.Item.Breadcrumb != "none" && String.IsNullOrEmpty( Model.Item.Breadcrumb ) == false )
12 {
13 breadcrumbClasses.AddClasses( string.Format( " e-breadcrumb-{0}", Model.Item.Breadcrumb ) );
14 }
15 string navigationHtmlBreadcrumb = RenderNavigation( new
16 {
17 id = "dwnav-breadcrumb",
18 template = "breadcrumb.xslt",
19 startlevel = 1,
20 endlevel = 10,
21 expandmode = "pathonly",
22 sitemapmode = true
23 } );
24 }
25 26 @if ( string.IsNullOrEmpty( navigationHtmlBreadcrumb ) == false && Model.Item.Breadcrumb != "none" && string.IsNullOrEmpty( Model.Item.Breadcrumb ) == false )
27 {
28 @RenderingService.Instance.SectionStart( new SectionSettings()
29 {
30 Classes = breadcrumbClasses,
31 ContentClasses = new ClassList( "col-12" )
32 } )
33 <div class="col-12">
34 <nav class="e-breadcrumb-container">
35 <ol class="breadcrumb nav" itemscope itemtype="https://schema.org/BreadcrumbList">
36 <li class="breadcrumb-item">
37 <a href="/">
38 @ServiceLocator.Current.GetPageService().GetFirstPageForArea( Model.DynamicwebPage.Area.ID ).MenuText
39 </a>
40 </li>
41 @navigationHtmlBreadcrumb
42 </ol>
43 </nav>
44 </div>
45 @RenderingService.Instance.SectionEnd()
46 }
47 48
An error occurred while attaching module (Dynamicweb.Frontend.Content)
System.IndexOutOfRangeException: ProductGroupFieldID
at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
at System.Data.SqlClient.SqlDataReader.get_Item(String name)
at Dynamicweb.Ecommerce.Products.ProductGroupField.Fill(IDataReader dataReader)
at Dynamicweb.Ecommerce.Products.ProductGroupFieldCollection.Load(String query)
at Dynamicweb.Ecommerce.Products.ProductGroupField.GetProductGroupFields()
at Dynamicweb.Ecommerce.Common.ApplicationDependencies.GetProductGroupFields()
at Dynamicweb.Ecommerce.Products.GroupService.InitializeCache()
at Dynamicweb.Caching.DictionaryCache`2.InitializeCacheDictionary()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Dynamicweb.Caching.DictionaryCache`2.GetCacheResult(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(TKey key)
at Dynamicweb.Ecommerce.Products.GroupService.GetGroup(String groupId, String languageId, Boolean showUnTranslated)
at Dynamicweb.Ecommerce.Frontend.Frontend.ValidateGroup()
at Dynamicweb.Ecommerce.Frontend.Frontend.EcomRender()
at Dynamicweb.Ecommerce.Frontend.Frontend.GetContent()
at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)