Error executing template "/Designs/SkanskaMaskin/Paragraph/_service_storeinfo.cshtml"
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Int16.Parse(String s, NumberStyles style, NumberFormatInfo info)
   at System.Convert.ToInt16(String value)
   at CompiledRazorTemplates.Dynamic.RazorEngine_75c241bc60f547358500d2373c85c927.Execute() in D:\wwwroot\rental.skanska.se\Files\Templates\Designs\SkanskaMaskin\Paragraph\_service_storeinfo.cshtml:line 7
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using Dynamicweb 2 @using Dynamicweb.Environment 3 @{ 4 var address = string.Empty; 5 var phone = string.Empty; 6 var openingHours = string.Empty; 7 var storeId = Convert.ToInt16(Dynamicweb.Context.Current.Request.GetString("storeid")); 8 9 var selectedStore = Dynamicweb.Security.UserManagement.User.GetUserByID(storeId); 10 11 if (selectedStore!=null){ 12 address = selectedStore.Address; 13 phone = selectedStore.Phone; 14 15 var userItem = Services.Items.GetItem(selectedStore.ItemType, selectedStore.ItemId); 16 17 openingHours = userItem["Opening_Hours"].ToString(); 18 } 19 } 20 21 <div class="Grid-cell u-sizeFull u-md-size1of3 u-lg-size1of3"> 22 <h4>Besöksadress</h4> 23 <p class="Type-paragraph">@address</p> 24 </div> 25 <div class="Grid-cell u-sizeFull u-md-size1of3 u-lg-size1of3"> 26 <h4>Telefon</h4><p class="Type-paragraph">@phone</p> 27 </div> 28 <div class="Grid-cell u-sizeFull u-md-size1of3 u-lg-size1of3"> 29 <h4>Öppettider</h4> 30 <p class="Type-paragraph">@openingHours</p> 31 </div>