Error executing template "/Designs/SkanskaMaskin/Paragraph/_form_customerservice.cshtml"
Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Path '', line 0, position 0.
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
   at CompiledRazorTemplates.Dynamic.RazorEngine_dbfc750e23f54db583d4e0740aa8de65.Execute() in D:\wwwroot\rental.skanska.se\Files\Templates\Designs\SkanskaMaskin\Paragraph\_form_customerservice.cshtml:line 16
   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 Softgear.SkanskaMaskin.Data.Helper 2 @using Newtonsoft.Json; 3 @using Newtonsoft.Json.Linq; 4 @using Softgear.SkanskaMaskin.Data.Business 5 @using System.IO; 6 @using System.Web; 7 @using Dynamicweb 8 @using Softgear.SkanskaMaskin.Data.Entities.Common 9 @using Attribute = Softgear.SkanskaMaskin.Data.Entities.Common.Attribute 10 @using Input = Softgear.SkanskaMaskin.Data.Entities.Common.Input 11 12 @{ 13 var hbh = new HandleBarsHelper(); 14 var inputAttrs = new List<object>(); 15 var input = new System.IO.StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd(); 16 var json = JObject.Parse(input); 17 var selectedStoreId = Convert.ToInt16(json["store"]); 18 var selectedStore = Dynamicweb.Security.UserManagement.User.GetUserByID(selectedStoreId); 19 var total = 0; 20 var customerCenters = CacheManager.GetFromCache<Dynamicweb.Security.UserManagement.UserCollection>(60, "customerCentersGroup4", () => Dynamicweb.Security.UserManagement.User.GetUsers(false, true, true, "AccessUserName", true, 0, 100, string.Empty, 4, ref total)); 21 var storeItem = Services.Items.GetItem(selectedStore.ItemType, selectedStore.ItemId); 22 23 var storesData = new { 24 baseUrl = "/service/storeinfo?storeid=", 25 className = "Control--light", 26 name = "selectedStore", 27 updateRegion = "#js-id-controlUpdateRegion", 28 redirect = "false", 29 items = from user in customerCenters 30 select new { 31 value = user.ID, 32 text = user.Name, 33 selected = user.ID == selectedStoreId 34 } 35 }; 36 37 38 var inputNameData = new Input{ 39 type = "text", 40 label = "Ditt Namn", 41 uid = "sharelist-name", 42 name = "sharelist-name", 43 isFullWidth = true, 44 attrs = new List<Attribute> 45 { 46 new Attribute { prop = "required"} 47 } 48 }; 49 50 var nameInputHtml = hbh.render("form-input/index.hbs", inputNameData); 51 52 53 var inputCompanyData = new Input { 54 type = "text", 55 label = "Företagsnamn", 56 uid = "sharelist-company", 57 name = "sharelist-company", 58 isFullWidth = true, 59 attrs = new List<Attribute> 60 { 61 new Attribute { prop = "required"} 62 } 63 }; 64 65 var companyInputHtml = hbh.render("form-input/index.hbs", inputCompanyData); 66 67 68 var inputEmailData = new Input 69 { 70 type = "email", 71 label = "Din e-post", 72 uid = "sharelist-email", 73 name = "sharelist-email", 74 isFullWidth = true, 75 attrs = new List<Attribute> 76 { 77 new Attribute { prop = "required"} 78 } 79 }; 80 81 var emailInputHtml = hbh.render("form-input/index.hbs", inputEmailData); 82 83 84 85 var inputPhoneData = new Input{ 86 type = "tel", 87 label = "Mobilnummer", 88 uid = "sharelist-phone", 89 name = "sharelist-phone", 90 isFullWidth = true, 91 attrs = new List<Attribute> 92 { 93 new Attribute { prop = "required"} 94 } 95 }; 96 97 var phoneInputHtml = hbh.render("form-input/index.hbs", inputPhoneData); 98 99 var orgNrInputHtml = hbh.render("form-input/index.hbs", new Input("Organisationsnummer", "order-orgnr", "", false)); 100 var projectNrInputHtml = hbh.render("form-input/index.hbs", new Input("Kundnummer (projektnummer)", "order-projectnr", AccountManager.getActiveProjectCode(), false)); 101 102 var invoiceAdressInputHtml = hbh.render("form-input/index.hbs", new Input("Adress", "invoice-adress", "", false)); 103 var invoiceZipInputHtml = hbh.render("form-input/index.hbs", new Input("Postnr", "invoice-zip", "", false)); 104 var invoiceCityInputHtml = hbh.render("form-input/index.hbs", new Input("Ort", "invoice-city", "", false)); 105 106 var deliveryAdressInputHtml = hbh.render("form-input/index.hbs", new Input("Adress", "invoice-adress", "", false)); 107 var deliveryZipInputHtml = hbh.render("form-input/index.hbs", new Input("Postnr", "invoice-zip", "", false)); 108 var deliveryCityInputHtml = hbh.render("form-input/index.hbs", new Input("Ort", "invoice-city", "", false)); 109 110 var referenceInputHtml = hbh.render("form-input/index.hbs", new Input("Referens", "order-reference", "", false)); 111 var deliveryDateInputHtml = hbh.render("form-input/index.hbs", new Input("Önskad leveransdatum, -tid", "order-delivery-date", "", false)); 112 var invoiceTagInputHtml = hbh.render("form-input/index.hbs", new Input("Fakturamärkning", "order-invoice-tag", "", false)); 113 114 /*Message*/ 115 var templates = new List<object>(); 116 inputAttrs.Add( 117 new { 118 prop = "required" 119 } 120 ); 121 122 var inputMessageData = new { 123 type = "text", 124 label = "Meddelande", 125 uid = "sharelist-message", 126 name = "sharelist-message", 127 isTextarea = true, 128 isFullWidth = true, 129 attrs = inputAttrs, 130 template = templates 131 }; 132 var partialPathList = new List<string> { "form-input/textarea.hbs" }; 133 var messageInputHtml = hbh.render("form-input/index.hbs", partialPathList, inputMessageData); 134 } 135 <!--<form action="/customerservice_confirm" method="post">--> 136 <form action="/default.aspx?id=32" method="post"> 137 <div class="Grid Grid--equalPush"> 138 <div class="Grid-cell"> 139 <div class="Grid Grid--withGutter"> 140 <div class="Grid-cell u-sizeFull"> 141 <h2 class="Type-h1">Skicka orderförfrågan</h2> 142 </div> 143 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 144 <p>Fyll i dina kontaktuppgifter så återkommer vi till dig nästa vardag med prisuppgifter och leveranstider.</p> 145 </div> 146 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 147 @hbh.render("control/index.hbs", storesData) 148 </div> 149 </div> 150 </div> 151 <div class="Grid-cell"> 152 <div class="Grid Grid--withGutter" id="js-id-controlUpdateRegion"> 153 <div class="Grid-cell u-sizeFull u-md-size1of3 u-lg-size1of3"> 154 <h4>Besöksadress</h4> 155 <p class="Type-paragraph">@selectedStore.Address</p> 156 </div> 157 <div class="Grid-cell u-sizeFull u-md-size1of3 u-lg-size1of3"> 158 <h4>Öppettider</h4> 159 <p class="Type-paragraph">@storeItem["Opening_Hours"]</p> 160 </div> 161 <div class="Grid-cell u-sizeFull u-md-size1of3 u-lg-size1of3"> 162 <h4>Telefon</h4> 163 <p class="Type-paragraph">@selectedStore.Phone</p> 164 </div> 165 </div> 166 </div> 167 <div class="Grid-cell"> 168 <div class="Grid Grid--withGutter"> 169 <div class="Grid-cell u-sizeFull"> 170 <div class="Type"> 171 <h3 class="Type-h3">Kontaktuppgifter</h3> 172 </div> 173 </div> 174 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 175 @nameInputHtml 176 </div> 177 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 178 @companyInputHtml 179 </div> 180 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 181 @emailInputHtml 182 </div> 183 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 184 @phoneInputHtml 185 </div> 186 187 </div> 188 </div> 189 <div class="Grid-cell"> 190 <div class="Grid Grid--withGutter"> 191 <div class="Grid-cell u-sizeFull"> 192 <div class="Type"> 193 <h3 class="Type-h3">Fakturaadress</h3> 194 </div> 195 </div> 196 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 197 @invoiceAdressInputHtml 198 </div> 199 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 200 @invoiceZipInputHtml 201 </div> 202 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 203 @invoiceCityInputHtml 204 </div> 205 </div> 206 </div> 207 <div class="Grid-cell"> 208 <div class="Grid Grid--withGutter"> 209 <div class="Grid-cell u-sizeFull"> 210 <div class="Type"> 211 <h3 class="Type-h3">Leveransadress</h3> 212 </div> 213 </div> 214 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 215 @deliveryAdressInputHtml 216 </div> 217 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 218 @deliveryZipInputHtml 219 </div> 220 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 221 @deliveryCityInputHtml 222 </div> 223 </div> 224 </div> 225 <div class="Grid-cell"> 226 <div class="Grid Grid--withGutter"> 227 <div class="Grid-cell u-sizeFull"> 228 <div class="Type"> 229 <h3 class="Type-h3">Övrigt</h3> 230 </div> 231 </div> 232 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 233 @referenceInputHtml 234 </div> 235 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 236 @deliveryDateInputHtml 237 </div> 238 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 239 @invoiceTagInputHtml 240 </div> 241 <div class="Grid-cell u-sizeFull"> 242 @messageInputHtml 243 </div> 244 </div> 245 </div> 246 <div class="Grid-cell"> 247 <div class="Grid Grid--withGutter"> 248 <div class="Grid-cell u-sizeFull u-textRight"> 249 <button class="Button" type="submit">Skicka förfrågan</button> 250 </div> 251 </div> 252 </div> 253 </div> 254 </form>