Posted on 04/02/2019 14:40:09
Here's the full error message:
Exception in template (Designs/-----/_parsed/OrderFlow.parsed.cshtml): System.MissingMethodException: Method not found: Dynamicweb.Ecommerce.Orders.OrderLine Dynamicweb.Ecommerce.Orders.OrderLineService.Create(Dynamicweb.Ecommerce.Orders.Order, Dynamicweb.Ecommerce.Products.Product, Double, Dynamicweb.Ecommerce.Stocks.StockUnit, Dynamicweb.Ecommerce.Prices.PriceInfo).
vid -----.DW.Data.Repositories.OrderRepository.CopyOrderLinesToOrder(Order order, List`1 orderlines)
vid CompiledRazorTemplates.Dynamic.acabeccbbcd.Execute()
vid RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
vid RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
vid RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
vid RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
vid Dynamicweb.Rendering.Template.RenderRazorTemplate()
@inherits RazorTemplateBase<RazorTemplateModel<Template>>
@using System.Diagnostics
@using System.Linq
@using System.Web
@using System.Xml
@using ------.DW.Helpers
@using Dynamicweb.Content
@using Dynamicweb.Core
@using Dynamicweb.Ecommerce.Integration
@using Dynamicweb.Ecommerce.LiveIntegration
@using Dynamicweb.Ecommerce.Notifications
@using Dynamicweb.Ecommerce.Orders
@using Dynamicweb.Rendering
@using Dynamicweb.Security
@using Dynamicweb.Security.UserManagement
@using Extensions = -----.DW.Helpers.Extensions
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="">
@*<link rel="shortcut icon" href="/Files/Templates/Designs/------/favicon.ico">*@
<link rel="icon" href="/Files/Templates/Designs/------/Images/favicon.ico">
<title>@GetValue("Title")</title>
@GetValue("MetaTags")
@GetValue("CopyRightNotice")
<!-- jQuery -->
<script src="/Files/Templates/Designs/------/libs/jquery.js"></script>
<script src="/Files/Templates/Designs/------/libs/jquery-ui-1.12.1/jquery-ui.min.js"></script>
<link href="/Files/Templates/Designs/------/libs/jquery-ui-1.12.1/jquery-ui.css" rel="stylesheet">
<link href="/Files/Templates/Designs/------/libs/jquery-ui-1.12.1/jquery-ui.theme.min.css" rel="stylesheet">
<!-- Custom Fonts -->
<link type="text/css" rel="stylesheet" href="//fast.fonts.net/cssapi/b5236ebc-c9d4-4f42-8aac-fc69d65315ac.css">
<!-- Bootstrap Core -->
<script src="/Files/Templates/Designs/-------/libs/bootstrap/bootstrap.min.js"></script>
<link href="/Files/Templates/Designs/-------/libs/bootstrap/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap Table -->
<script src="/Files/Templates/Designs/------/libs/bootstrap-table/bootstrap-table.js"></script>
<script src="/Files/Templates/Designs/------/libs/bootstrap-table/bootstrap-table-filter-control.js"></script>
<link href="/Files/Templates/Designs/------/libs/bootstrap-table/bootstrap-table.css" rel="stylesheet">
<!-- Chosen -->
<script src="/Files/Templates/Designs/------/libs/chosen_v1.8.7/chosen.jquery.js"></script>
<!-- Font awesome -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Validator JS -->
<script src="/Files/Templates/Designs/------/libs/validator.js"></script>
<!-- Custom JS -->
<script src="/Files/Templates/Designs/------/js/xml2obj.js"></script>
<script src="/Files/Templates/Designs/-----/js/products.js"></script>
<script src="/Files/Templates/Designs/-----/js/inputfields.js"></script>
<script src="/Files/Templates/Designs/-----/js/mypage.js"></script>
<script src="/Files/Templates/Designs/-----/js/show-hide-alarm-receivers.js"></script>
<script src="/Files/Templates/Designs/-----/js/redirecter.js"></script>
<script src="/Files/Templates/Designs/-----/js/platform-checker.js"></script>
<script src="/Files/Templates/Designs/-----/js/orderTemplates.js"></script>
<!-- Latest compiled and minified CSS -->
@*<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/locale/bootstrap-table-zh-CN.min.js"></script>*@
<!-- Custom CSS -->
<link href="/Files/Templates/Designs/-----/css/main.css" rel="stylesheet">
<link href="/Files/Templates/Designs/-----/fonts/Icomoon/style.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
@GetValue("Stylesheets")
@GetValue("Javascripts")
</head>
@{
string baseUrl = GetValue("DwAreaName").ToString().ToLower().Replace(" ", "");
string currentCulture = "";
string languageNr = "";
foreach (var language in GetLoop("Languages"))
{
string culture = language.GetString("Culture");
if (language.GetBoolean("IsCurrent"))
{
currentCulture = culture;
languageNr = (culture.Substring(0, 2) == "en") ? "-1" : "";
}
}
string homeUrl = baseUrl + "/home" + languageNr;
string fullName = GetString("DW_extranet_AccessUserName");
var names = fullName.Split(' ');
var user = User.get_Current(PagePermissionLevels.Frontend);
string logoutId = "";
var c = GetGlobalValue("Global:Area.LongLang");
logoutId = Extensions.GetResultBasedOffLang(c, "9", "46", "36", "56");
string loginUrl = baseUrl + "/login" + languageNr;
string accessDeniedUrl = baseUrl + "/accessdenied" + languageNr;
if (string.IsNullOrWhiteSpace(GetString("DW_extranet_AccessUserName")))
{
Dynamicweb.Context.Current.Response.Redirect("~/" + loginUrl);
}
//if (!string.IsNullOrWhiteSpace(GetGlobalValue("Global:Page.IsProtected")))
//{
// Dynamicweb.Context.Current.Response.Redirect("~/" + accessDeniedUrl);
//}
if (c == "sv-SE" || c == "en-GB")
{
if (user.Country.ToLower() == "norway" || user.Country.ToLower() == "no")
{
if (string.IsNullOrEmpty(GetString("Item.Area.Norwegian_Url")))
{
<text>Set the norwegian URL in adminsite</text>
}
else
{
Dynamicweb.Context.Current.Response.Redirect("/" + (string.IsNullOrEmpty(GetString("Item.Area.Norwegian_Url")) ? "-----norge" : GetString("Item.Area.Norwegian_Url")));
}
}
}
else if (c == "nb-NO" || c == "en-US")
{
if (user.Country.ToLower() == "sweden" || user.Country.ToLower() == "se")
{
if (string.IsNullOrEmpty(GetString("Item.Area.Swedish_Url")))
{
<text>Set the swedish URL in adminsite</text>
}
else
{
Dynamicweb.Context.Current.Response.Redirect("/" + (string.IsNullOrEmpty(GetString("Item.Area.Swedish_Url")) ? "-------norge" : GetString("Item.Area.Swedish_Url")));
}
}
}
if (user.Country.ToLower() != "sweden" && user.Country.ToLower() != "norway" && user.Country.ToLower() != "se" && user.Country.ToLower() != "no")
{
Dynamicweb.Context.Current.Response.Redirect("/Admin/Public/ExtranetLogoff.aspx");
}
}
<!-- Top Header Menu -->
@{
@*if (User.get_Current(PagePermissionLevels.Frontend).)
{
//work in progress
}
<div class="container2" style="
margin-left: auto;
display: block;
background: darkred;">
Du har redan en korg
<div><a href="/removecart?id=CART">remove cart</a></div>
</div>*@
/*impersonate*/
if (GetGlobalValue("Global:Extranet.SecondaryUser.ID").IsNullOrEmpty() == false)
{
<div class="impersonate-container">
<div class="impersonating-line"></div>
<div class="impersonating">
<b>@Translate("Impersonating", "Imiterar"):</b>
@user.Email, @user.Name, @user.Company
<form method="get">
<input type="hidden" name="DwExtranetRemoveSecondaryUser" id="DwExtranetRemoveSecondaryUser" value="1">
<input type="submit" value='@Translate("Stop impersonating", "Sluta imitera")' class="btn btn--yellow big-mini">
</form>
</div>
</div>
<div style="padding: 5px;"></div>
}
}
<div class="top-header-menu">
<div class="container">
@* this button is for testing purposes *@
@*<button id="removeCart" onclick="removeCart();">Ta bort cart</button>*@
@*<script>console.log("@User.get_Current(PagePermissionLevels.Frontend).ID")</script>*@
@{@*
var hej = new OrderContext().Id;
@hej*@
//var os = new OrderService();
//os.Delete("CART506");
//os.Delete("CART388");
// ErpResponseCache.ClearAllCaches();
@*@User.GetCurrentExtranetUser().GetSuperAdmin().Name
<br> @User.GetCurrentExtranetUser().GetSuperAdmin().ID*@
}
<ul class="nav navbar-nav">
@foreach (var language in GetLoop("Languages"))
{
string culture = language.GetString("Culture");
//string linkText = (culture.Substring(3).ToLower() == "se") ? "svenska" : (culture.Substring(3).ToLower() == "us") ? "english" : "norsk";
string linkText = "";
linkText = Extensions.GetResultBasedOffLang(culture, "svenska", "english", "norsk", "english");
var queryParams = HttpContext.Current.Request.Url.Query;
if (!language.GetBoolean("IsCurrent"))
{
string languagePage = language.GetString("PageID");
<li class="flags @culture.Substring(3).ToLower() "><a class="language" href="/Default.aspx?ID=@languagePage@queryParams" hreflang="@culture.Substring(0, 2)">@linkText</a></li>
}
else
{
<li class="flags active @culture.Substring(3).ToLower() "><a class="language">@linkText</a></li>
}
}
</ul>
<ul class="nav navbar-nav pull-right">
@if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_AccessUserName")))
{
string linkUrl = baseUrl + "/my-profile" + languageNr;
@*<li>
<a class="" href="@linkUrl" hreflang="@currentCulture.Substring(0, 2)">@Translate("My Page")</a>
</li>*@
<li>
<a class="log-out" href="/Admin/Public/ExtranetLogoff.aspx?ID=@logoutId">@Translate("Logout")</a>
</li>
<li>
@*<a class="name-tag" href="@linkUrl" hreflang="@currentCulture.Substring(0, 2)">@GetValue("DW_extranet_AccessUserName")</a>*@
<a href="" class="name-tag">
@GetValue("DW_extranet_AccessUserName")
</a>
</li>
<li>
@if (names.Length > 1)
{
string initials = names[0].Substring(0, 1) + names[1].Substring(0, 1);
<span class="initials-badge">@initials.ToUpper()</span>
}
else
{
string initials = names[0].Substring(0, 1);
<span class="initials-badge">@initials.ToUpper()</span>
}
</li>
}
else
{
string linkUrl = baseUrl + "/login" + languageNr;
<li>
<a class="" href="@linkUrl" hreflang="@currentCulture.Substring(0, 2)">@Translate("Login")</a>
</li>
}
</ul>
</div>
</div>
<!-- Top Navigation Menu -->
<nav class="navbar top-navigation-menu" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="glyphicon glyphicon-remove"></span>
</button>
<a class="navbar-brand" href="@homeUrl">
<img class="img-responsive" src="/Files/Templates/Designs/-----/Images/-----Logo.png">
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<div class="visible-xs row mobile-nav-top">
<div class="col-xs-12 mobile-menu-name">
@{
if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_AccessUserName")))
{
if (names.Length > 1)
{
string initials = names[0].Substring(0, 1) + names[1].Substring(0, 1);
<span class="initials-tag">@initials</span>
}
else
{
string initials = names[0].Substring(0, 1);
<span class="initials-tag">@initials</span>
}
<span class="name-tag">@GetValue("DW_extranet_AccessUserName")</span>
<a href="/Admin/Public/ExtranetLogoff.aspx?ID=@logoutId">@Translate("Logout")</a>
}
}
</div>
</div>
<div class="hidden-mobile">
@GetValue("DwNavigation(navbar)")
</div>
<div class="visible-mobile">
@GetValue("DwNavigation(navbar2)")
</div>
<div class="row">
<div class="col-xs-12 visible-xs mobile-menu-languages">
@foreach (var language in GetLoop("Languages"))
{
string culture = language.GetString("Culture");
string linkText = (culture.Substring(3).ToLower() == "se") ? "svenska" : (culture.Substring(3).ToLower() == "us") ? "english" : "norsk";
if (!language.GetBoolean("IsCurrent"))
{
string languagePage = language.GetString("PageID");
<div class="flags @culture.Substring(3).ToLower() "><a class="language" href="/Default.aspx?ID=@languagePage" hreflang="@culture.Substring(0, 2)">@linkText</a></div>
}
else
{
<div class="flags active @culture.Substring(3).ToLower() "><a class="language">@linkText</a></div>
}
}
</div>
</div>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container-fluid">
<section class="center-container content-container dw-mod" id="content">
@inherits RazorTemplateBase<RazorTemplateModel<Template>>
@using System.Collections.Generic
@using System.Net.Http
@using System.Web
@using Dynamicweb.Rendering
@using ------.DW.Data.Repositories;
@using Dynamicweb.Ecommerce;
@using Dynamicweb.Ecommerce.Orders;
@using Dynamicweb.Ecommerce.Stocks;
@using ------.DW.Data.ViewModels;
@using Dynamicweb.Ecommerce.Notifications
@using Dynamicweb.Ecommerce.Orders
@using Context = Dynamicweb.Ecommerce.Common.Context
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
@{
//TODO: Hämta orderflowtype från URLen, dvs avkommentera raden nedan när funktionen är färdig.
//var orderflowtype = "materials";
var orderflowtype = HttpContext.Current.Request.Url.ParseQueryString()["orderflowtype"] ?? "";
<div>@*@orderflowtype*@</div>
var templateId = HttpContext.Current.Request.Url.ParseQueryString()["templateId"] ?? "";
Order template = null;
List<OrderLine> templateOrderLines = new List<OrderLine>();
if (!string.IsNullOrEmpty(templateId))
{
OrderService oService = new OrderService();
OrderLineService olService = new OrderLineService();
template = OrderRepository.GetTemplate(templateId);
templateOrderLines = OrderRepository.GetTemplateOrderLinesByOrderId(templateId);
oService.DowngradeToCart(template);
OrderRepository.CopyOrderLinesToOrder(template, templateOrderLines);
Context.SetCart(template);
}
}
<pre>
TemplateId: @templateId
TemplateOrderLineCount: @templateOrderLines.Count
-----------------------
@if (Context.Cart != null)
{
<text>Cart.Id: @Context.Cart.Id</text>
if(Context.Cart.OrderLines != null)
{
<text>OrderlineCount: @Context.Cart.OrderLines.Count</text>
<text>-----------------------</text>
foreach(var orderline in Context.Cart.OrderLines)
{
<text>@orderline.ProductName</text>
}
}
}
</pre>
<div class="order-flow-nav row">
<div class="order-step" id="material-step">
<div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">✔</span></div>
<p class="step-name">Hårdvara och tillbehör</p>
<hr class="order-step-line">
</div>
@if (System.Web.HttpContext.Current.Session["OrderflowSession"] == "LinkGo")
{
<div class="order-step" id="router-step">
<div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">✔</span></div>
<p class="step-name">Routerkonfiguration</p>
<hr class="order-step-line">
</div>
}
else if (System.Web.HttpContext.Current.Session["OrderflowSession"] == "Alarms")
{
<div class="order-step" id="alarmreciever-step">
<div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">✔</span></div>
<p class="step-name">@Translate("Alarm reciever")</p>
<hr class="order-step-line">
</div>
}
@if (System.Web.HttpContext.Current.Session["OrderflowSession"] == "LinkGo")
{
<div class="order-step" id="service-step">
<div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">✔</span></div>
<p class="step-name">Tjänstekonfiguration</p>
<hr class="order-step-line">
</div>
}
<div class="order-step" id="information-step">
<div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">✔</span></div>
<p class="step-name">Uppgifter</p>
<hr class="order-step-line">
</div>
<div class="order-step" id="confirm-step">
<div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">✔</span></div>
<p class="step-name">Bekräfta order</p>
</div>
</div>
<div id="content">@GetValue("DwContent(content)")</div>
<div class="order-flow-footer row">
<h2>
Behöver du hjälp med din beställning? <br>
Kontakta kundtjänst: 08-1234567
</h2>
</div>
<script>
var counter = 1;
var readMore= '@Translate("Read more")';
var readLess = '@Translate("Read less")';
$('.order-step').each(function (i, obj) {
$(this).find('.step-nr').text(counter);
counter++;
});
$('.readmore-link').click(function () {
if ($(this).html().trim().indexOf(readMore) >= 0) {
$(this).html(readLess + " ▲");
} else {
$(this).html(readMore + " ▼");
}
});
</script>
</section>
</div>
<!-- Footer -->
<div id="footer-full">
<footer>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-3">
<h2 class="footer-header">@Translate("Customer service")</h2>
<div class="footer-sub-header">
<span class="icon-telephone"></span>
<span class="">@GetValue("Item.Area.Phone_Support")</span>
</div>
</div>
<div class="col-xs-12 col-sm-3">
<h2 class="footer-header">@Translate("Phone operator")</h2>
<div class="footer-sub-header">
<span class="icon-telephone"></span>
<span>
@GetValue("Item.Area.Phone_Other")
</span>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<img src="/Files/Templates/Designs/------/Images/WhiteLogo/-------white-logo@2x.png" class="white-logo">
</div>
</div>
<hr>
<div class="row">
<div class="col-xs-12 col-sm-3">
@if (!string.IsNullOrEmpty(GetString("Item.Area.Parent_Page_1")))
{
var parent1_idString = GetString("Item.Area.Parent_Page_1").Split('=')[1];
int parent1_id = 0;
int.TryParse(parent1_idString, out parent1_id);
string parent1_pageName = Dynamicweb.Services.Pages.GetPage(parent1_id).MenuText;
var parent1_pageList = Dynamicweb.Services.Pages.GetPagesByParentID(parent1_id).ToList();
<h2 class="footer-header"> @parent1_pageName</h2>
for (int i = 0; i < parent1_pageList.Count; i++)
{
if (i < 5)
{
<a class="footer-link" href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(parent1_pageList[i].ID)">
@parent1_pageList[i].MenuText
</a>
}
else
{
break;
}
}
}
</div>
<div class="col-xs-12 col-sm-3">
@if (!string.IsNullOrEmpty(GetString("Item.Area.Parent_Page_2")))
{
var parent2_idString = GetString("Item.Area.Parent_Page_2").Split('=')[1];
int parent2_id = 0;
int.TryParse(parent2_idString, out parent2_id);
string parent2_pageName = Dynamicweb.Services.Pages.GetPage(parent2_id).MenuText;
var parent2_pageList = Dynamicweb.Services.Pages.GetPagesByParentID(parent2_id).ToList();
<h2 class="footer-header"> @parent2_pageName</h2>
for (int i = 0; i < parent2_pageList.Count; i++)
{
if (i < 5)
{
<a class="footer-link" href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(parent2_pageList[i].ID)">
@parent2_pageList[i].MenuText
</a>
}
else { break; }
}
}
</div>
<div class="col-xs-12 col-sm-6">
<h2 class="footer-header">@Translate("About -----")</h2>
<p class="about-text">@GetValue("Item.Area.About_Text")</p>
<h2 class="footer-header">@Translate("Privacy Policy")</h2>
<p class="about-text">@GetValue("Item.Area.Privacy_Policy")</p>
</div>
</div>
</div>
</footer>
<div class="footer-bottom">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-3">
<h2 class="footer-city">@GetValue("Item.Area.Office_1_Name")</h2>
<p>@GetValue("Item.Area.Office_1_Address_1")</p>
<p>@GetValue("Item.Area.Office_1_Address_2")</p>
</div>
<div class="col-xs-12 col-sm-3">
<h2 class="footer-city">@GetValue("Item.Area.Office_2_Name")</h2>
<p>@GetValue("Item.Area.Office_2_Address_1")</p>
<p>@GetValue("Item.Area.Office_2_Address_2")</p>
</div>
<div class="col-xs-12 col-sm-3">
<h2 class="footer-city">@GetValue("Item.Area.Office_3_Name")</h2>
<p>@GetValue("Item.Area.Office_3_Address_1")</p>
<p>@GetValue("Item.Area.Office_3_Address_2")</p>
</div>
<div class="col-xs-12 col-sm-3">
<h2 class="footer-city">@GetValue("Item.Area.Office_4_Name")</h2>
<p>@GetValue("Item.Area.Office_4_Address_1")</p>
<p>@GetValue("Item.Area.Office_4_Address_2")</p>
</div>
</div>
</div>
</div>
</div>
<!-- /.container -->
</html>