Hyra maskiner Göteborg
Rental
Inga produkter valda
Error executing template "Designs/SkanskaMaskin/Paragraph/apply_course_attendants.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_74756c1755c140bfbac38131b610238e.Execute() in D:\wwwroot\rental.skanska.se\Files\Templates\Designs\SkanskaMaskin\Paragraph\apply_course_attendants.cshtml:line 29
   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 2 @using Newtonsoft.Json; 3 @using Newtonsoft.Json.Linq; 4 @using System.IO; 5 @using System.Web; 6 @using Softgear.SkanskaMaskin.Data.Business 7 @{ 8 var hbh = new HandleBarsHelper(); 9 String input = new StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd(); 10 11 HttpContext.Current.Response.Cookies.Add(new HttpCookie("applyCourse", input)); 12 13 JObject json = new JObject(); 14 15 try 16 { 17 json = JObject.Parse(input); 18 } 19 catch (Exception e) 20 { 21 @e.Source <br /> @e.Message <br /> @e.StackTrace 22 } 23 24 var courseCompany = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["course-company"])); 25 var orgnrCompany = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["orgnr-company"])); 26 var courseContact = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["course-contact"])); 27 var courseEmail = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["course-email"])); 28 var coursePhone = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["course-phone"])); 29 var numOfAttendants = Convert.ToInt16(HttpContext.Current.Server.UrlDecode(Convert.ToString(json["att-num"]))); 30 var courseMessage = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["course-message"])); 31 var courseName = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["selectedCourse"])); 32 var selectedStore = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["selectedStore"])); 33 34 } 35 36 <form action="/form/apply_course/confirm" class="js-overlayForm" method="post"> 37 <input type="hidden" name="course-company" value="@courseCompany"/> 38 <input type="hidden" name="orgnr-company" value="@orgnrCompany" /> 39 <input type="hidden" name="course-contact" value="@courseContact" /> 40 <input type="hidden" name="course-email" value="@courseEmail" /> 41 <input type="hidden" name="course-phone" value="@coursePhone" /> 42 <input type="hidden" name="att-num" value="@numOfAttendants" /> 43 <input type="hidden" name="course-message" value="@courseMessage" /> 44 <input type="hidden" name="course-name" value="@courseName" /> 45 <input type="hidden" name="selectedStore" value="@selectedStore" /> 46 47 <div class="Grid Grid--equalPush"> 48 <div class="Grid-cell"> 49 <div class="Grid Grid--withGutter"> 50 <div class="Grid-cell u-sizeFull"> 51 <h2 class="Type-h1">Uppgifter om deltagare</h2> 52 </div> 53 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 54 <p>Fyll i uppgifter om deltagarna för att snabba på anmälan.</p> 55 </div> 56 </div> 57 </div> 58 59 <div class="Grid-cell"> 60 <div class="Grid Grid--withGutter"> 61 <div class="Grid-cell u-sizeFull"> 62 <div class="Type"> 63 <h3 class="Type-h3">Deltagare</h3> 64 </div> 65 </div> 66 @for (var i = 0; i < numOfAttendants; i++) 67 { 68 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 69 @hbh.createInputHtml(string.Format("attendant-name-{0}", i + 1), "Namn", "text", false) 70 </div> 71 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 72 @hbh.createInputHtml(string.Format("attendant-pnr-{0}", i + 1), "Personnummer (8-10 siffror)", "text", false) 73 </div> 74 } 75 </div> 76 </div> 77 <div class="Grid-cell"> 78 <div class="Grid Grid--withGutter"> 79 <div class="Grid-cell u-sizeFull u-textRight"> 80 <button class="Button" type="submit">Anmäl intresse</button> 81 </div> 82 </div> 83 </div> 84 </div> 85 </form>