0
Exception in template (Designs/Outwell/Paragraph/FindDealerRibbonItem.cshtml): System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','. à System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) à System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) à System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) à System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() à System.Data.SqlClient.SqlDataReader.get_MetaData() à System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) à System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) à System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) à System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) à System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) à Dynamicweb.Data.Database.CreateDataReader(IDbCommand command, CommandBehavior behavior) à Dynamicweb.Data.Database.CreateDataReader(String sql, IDbConnection connection, IDbTransaction transaction, CommandBehavior behavior, Int32 commandTimeout, Dictionary`2 sqlParams) à Dynamicweb.Data.Database.CreateDataReader(String sql, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout, Dictionary`2 sqlParams) à Dynamicweb.Ecommerce.Products.ProductRepository.GetBySql(String query, Boolean doRefactoring, Boolean bulkFill, Boolean useAssortments) à Dynamicweb.Ecommerce.Products.Product.GetProductBySql(String query, Boolean doRefactoring, Boolean useAssortments) à CompiledRazorTemplates.Dynamic.bdedfabfdfba.Execute() à RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context) dans c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateBase.cs:ligne 126 à RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag) dans c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:ligne 608 à RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName) dans c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:ligne 439 à RazorEngine.Razor.Parse[T](String razorTemplate, T model, DynamicViewBag viewBag, String cacheName) dans c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Razor.cs:ligne 290 à Dynamicweb.Rendering.Template.RenderRazorTemplate() ClientConnectionId :74308f5e-ac3b-473c-883c-e11a53add3ab Error Number :102,State :1,Class :15
@using System.Web; @using Dynamicweb.Extensibility; @using Dynamicweb.Frontend; @using Dynamicweb.Rendering; @using Dynamicweb.Ecommerce.Products @using OaseOutdoors.Components.Shared.Paragraphs.FindDealerRibbon.ModelBuilders @using OaseOutdoors.Components.Shared.Modules.Ecom.ModelBuilders @using OaseOutdoors.Services.DictionaryService.Initialization @using OaseOutdoors.Services.StaticResourceService.Initialization @using OaseOutdoors.Services.EcomUrlService.Initialization @using OaseOutdoors.Services.ImageService.Enums @inherits ViewModelTemplate<ParagraphViewModel> @{ var viewModelService = new FindDealerRibbonViewModelBuilder(); var viewModel = viewModelService.GetViewModel(Model); var dictionaryService = ServiceLocator.Current.GetDictionaryService(); var staticResourceService = ServiceLocator.Current.GetStaticResourceService(); // get product if find dealer from product page Product product = null; var productId = HttpContext.Current.Request.QueryString["DealersProductNumber"]; var languageId = HttpContext.Current.Request.QueryString["DealersLanguageId"]; if (productId != null && languageId != null) { var CurrentShopId = PageView.Current().Area.EcomShopId; //product = Product.GetProductByNumber(productId, languageId); product = Product.GetProductBySql(string.Format( "SELECT * FROM EcomProducts WHERE ProductNumber = {0} AND ProductLanguageId = '{1}' AND ProductActive = 'True' AND ProductDefaultShopId = '{2}'" , productId, languageId, CurrentShopId)).FirstOrDefault(); } string DataAreaId = PageView.Current().AreaID.ToString(); bool RibbonAssortment = string.IsNullOrWhiteSpace(viewModel.AssortmentsText) == false; if (RibbonAssortment) { DataAreaId += "&assortments=,"+ viewModel.AssortmentsText + ","; DataAreaId += "&DealersProductNumber=0"; DataAreaId += "&DealersLanguageId=" + PageView.Current().Area.EcomLanguageId; } } <section class="find-dealer container-ribbon" data-module="find-dealer" data-areaid="@DataAreaId" data-countrycode="@viewModel.CountryCode" data-apikeymap="@viewModel.ApiKeyMap"> <article class="container"> @if (!string.IsNullOrEmpty(viewModel.Headline)) { <h1>@viewModel.Headline</h1> } @if (RibbonAssortment == false) { if (product != null) { var viewModelProductService = new ProductViewModelBuilder(); var viewModelProduct = viewModelProductService.GetViewModel(product); var urlService = ServiceLocator.Current.GetEcomUrlService(); <article class="find-dealer__product" itemscope="" itemtype="https://schema.org/Product"> <a itemprop="url" href="@urlService.GetUrl(viewModelProduct.GroupId, viewModelProduct.Id)"> <figure class="find-dealer__product-image"> <img src="@viewModelProduct.MainImage.SetWidth(500).SetHeight(300).SetCrop(CropType.KeepAspectRatio).SetCompression(50).GetCrop()" itemprop="image" content="@viewModelProduct.MainImage" alt=""> </figure> <div class="find-dealer__product-info"> <div class="find-dealer__product-header"> <h3 class="find-dealer__product-name" itemprop="name">@viewModelProduct.Name</h3> </div> <div class="find-dealer__product-description" itemprop="description"> @viewModelProduct.ShortDescription </div> <div itemprop="offers" itemscope itemtype="https://schema.org/Offer" class="find-dealer__product-price"> <div class="price"><span itemprop="priceCurrency" content="@viewModelProduct.Currency">@viewModelProduct.CurrencySymbol</span> <span itemprop="price" content="@viewModelProduct.UnformatedPrice">@viewModelProduct.Price</span></div> </div> </div> </a> </article> } <div class="find-dealer__display-selector"> <ul> <li><label for="tents-btn"><input type="checkbox" id="tents-btn" class="tents-input trigger" /> <span></span> <img src="@staticResourceService.AddTimeStamp("/static/dist/img/outwell/Bought-into-Tents.png")" /> @Translate("Tents", "Tents")</label></li> <li><label for="motorhomes-btn"><input type="checkbox" id="motorhomes-btn" class="motorhomes-input trigger" /> <span></span> <img src="@staticResourceService.AddTimeStamp("/static/dist/img/outwell/Bought-into-Motorhome-Awnings.png")" /> @Translate("Motorhomes Awnings", "Motorhomes Awnings")</label></li> </ul> </div> } <div class="find-dealer__content"> <div class="find-dealer__map"></div> <div class="find-dealer__dealers"> <div class="find-dealer__search"> <div> <div class="find-dealer__close-fullscreen"> <button> <svg aria-hidden="true"><use xlink:href="@staticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-left"></use></svg> </button> </div> <div class="find-dealer__search-input"> <input type="search" placeholder="@Translate("MapSearchPlaceHolder", "Address, country, city or zip")"> </div> <div class="find-dealer__search-button"> <button> <svg aria-hidden="true"><use xlink:href="@staticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#search-simple"></use></svg> <svg aria-hidden="true"><use xlink:href="@staticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#close"></use></svg> </button> </div> </div> </div> <div class="find-dealer__list"> <div class="spinner"></div> <div> <div class="find-dealer__error"> <p>@Translate("ErrorOccured", "An error occured")</p> <button class="btn"> <span class="btn__icon"><svg aria-hidden="true"><use xlink:href="@staticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use></svg></span> <span class="btn__text">@Translate("ErrorTryAgain", "Try again")</span> </button> </div> </div> </div> </div> <div class="find-dealer__content-trigger-fullscreen"></div> </div> <div class="find-dealer__content-spaceholder"></div> @if(RibbonAssortment == false) { <div class="find-dealer__help" aria-hidden="true"> <section class="find-dealer__help-item find-dealer__help-item--tents"> <div class="find-dealer__help-icon"> <img src="@staticResourceService.AddTimeStamp("/static/dist/img/outwell/On-Display-Tents.png")" /> </div> <div class="find-dealer__help-text"> <div class="h-1">@Translate("TentsOnDisplay", "With tents on display")</div> <p>@Translate("CallDealerBeforeVisit", "We kindly advise you to call the dealer and check display models prior to visiting.")</p> </div> </section> <section class="find-dealer__help-item find-dealer__help-item--motorhomes"> <div class="find-dealer__help-icon"> <img src="@staticResourceService.AddTimeStamp("/static/dist/img/outwell/On-Display-Motorhome-Awnings.png")" /> </div> <div class="find-dealer__help-text"> <div class="h-1">@Translate("MotorhomesOnDisplay", "With motorhomes on display")</div> <p>@Translate("CallDealerBeforeVisit", "We kindly advise you to call the dealer and check display models prior to visiting.")</p> </div> </section> </div> } </article> </section>