Rental
Inga produkter valda

Din orderlista är tom

Exception in template (Designs\SkanskaMaskin\Paragraph\_form_sharefavoritelist_confirm.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.eefbbacf.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@using System.Globalization @using Newtonsoft.Json.Linq; @using Softgear.Skanskamaskin.Document.Business @using Softgear.SkanskaMaskin.Communication.Business @using Softgear.Skanskamaskin.Document.Entities.Favorites @using Softgear.SkanskaMaskin.Data.Business @using System.Web @using System.IO @{ string sharelistEmail; string sharelistReceiver; string sharelistMessage; string sharelistName; string sharelistId; try { var input = new StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd(); JObject json = JObject.Parse(input); sharelistEmail = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["sharelist-email"])); sharelistReceiver = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["sharelist-receiver"])); sharelistMessage = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["sharelist-message"])); sharelistName = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["sharelist-name"])); sharelistId = HttpContext.Current.Server.UrlDecode(Convert.ToString(json["sharelist-id"])); var excelFavolista = new ExcelFavorites(); var excelFavolistaHeader = new ExcelFavoritesHeaders(); var excelFavolistaRow = new List<ExcelFavoritesRows>(); //var document = new OrderDocument(); //var header = new OrderDocumentHeader(); //var rows = new List<OrderDocumentRow>(); const string subject = @"Jag har skapat en favoritlista hos Skanska Rental. Ta gärna en titt!"; if (string.IsNullOrEmpty(sharelistMessage) == false) { sharelistMessage = sharelistMessage.Replace("\n", "<br/>"); } var listId = Convert.ToInt16(sharelistId); var favprodlist = WebHelper.GetFavoriteProducts(listId); var userData = Dynamicweb.Modules.UserManagement.User.GetCurrentUser(); excelFavolistaHeader.CompanyName = userData.Company; excelFavolistaHeader.ContactPersonName = userData.Name; excelFavolistaHeader.ContactPersonEmail = userData.Email; foreach (var row in favprodlist) { excelFavolistaRow.Add(new ExcelFavoritesRows { ProductName = row.ProductName, ProductNumber = row.ProductId, ProductCategory = row.ProductCategory }); excelFavolistaHeader.FavoriteListName = row.FavoriteListName; } excelFavolista.ExcelFavoritesHeader = excelFavolistaHeader; excelFavolista.ExcelFavoritesRow = excelFavolistaRow; var service = new ExcelManager(); var fileStream = service.CreateFavoritesExcelStream(excelFavolista); var manager = new MailManager(); manager.SendSharedFavoriteList(fileStream, sharelistReceiver, @"noreply@rental.skanska.se", subject, sharelistMessage); } catch (Exception e) { Console.WriteLine(e); throw; } } <div class="Grid Grid--equalPush Grid--withGutter"> <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> <div class="Type"> <h2 class="Input-aligned">Din favoritlista är delad!</h2> <p>Här är informationen som skickades:</p> </div> </div> <div class="Grid-cell Grid--push u-sizeFull u-md-size1of2 u-lg-size1of2"> <div class="Type"> <h4>Ditt namn</h4> <p>@sharelistName</p> </div> </div> <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> <div class="Type"> <h4>Din-epost</h4> <p>@sharelistEmail</p> </div> </div> <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> <div class="Type"> <h4>Mottagarens-epost</h4> <p>@sharelistReceiver</p> </div> </div> <div class="Grid-cell u-sizeFull"> <h4>Meddelande</h4> <div class="Type u-textNoWrap"> <p>@sharelistMessage</p> </div> </div> </div> <div class="Grid Grid--withGutter"> <div class="Grid-cell u-sizeFull u-textRight"> <button class="Button js-overlayClose">Ok, jag förstår</button> </div> </div>
forEach