Forgot your password?

Exception in template (Designs\hondamc\Paragraph\ShopTemplatev2.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.fcaaababcbc.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()
@inherits RazorTemplateBase<RazorTemplateModel<Template>> @using System @using System.Web @using Dynamicweb.Rendering; @{ var DealerID = Dynamicweb.Base.ChkInteger(Dynamicweb.Base.Request("dealerid")); var CustomerNumber = String.Empty; var Dealer = Dynamicweb.Modules.UserManagement.User.GetUserByID(DealerID); if (Dealer == null || Dealer.ID == 0) { //System.Web.HttpContext.Current.Response.StatusCode = 404; //System.Web.HttpContext.Current.Response.End(); } else { CustomerNumber = Dealer.CustomerNumber; } var DealerPage = new Firstweb.Custom.CustomCode.Frontend.Helpers.DealerPage(CustomerNumber); var ProductDetailsLink = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("ProductDetailsPage"); string Email = String.Empty; string Hjemmeside = String.Empty; string Billede = String.Empty; string Aabningstider = String.Empty; if (DealerPage.ForhandlersideInfo != null && !String.IsNullOrEmpty(DealerPage.ForhandlersideInfo.Id)) { Email = Firstweb.Custom.CustomCode.Frontend.Helpers.Items.GetValueString(DealerPage.ForhandlersideInfo, "Email"); Hjemmeside = Firstweb.Custom.CustomCode.Frontend.Helpers.Items.GetValueString(DealerPage.ForhandlersideInfo, "Hjemmeside"); Billede = Firstweb.Custom.CustomCode.Frontend.Helpers.Items.GetValueString(DealerPage.ForhandlersideInfo, "Billede"); Aabningstider = Firstweb.Custom.CustomCode.Frontend.Helpers.Items.GetValueString(DealerPage.ForhandlersideInfo, "Aabningstider"); } //Hvis intet billede så vælg standard billede if (String.IsNullOrEmpty(Billede)) { Billede = GetString("Item.StandardBillede"); } bool IsAuthorizedDealer = Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_IsAuthorizedDealer"); bool IsServiceCenter = Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_IsServiceCenter"); string Icon = "/Files/Billeder/HondaMC/map-markers/red-logo.png"; // IsAuthorizedDealer ? " / Files/Billeder/HondaMC/map-markers/red-logo.png" : "/Files/Billeder/HondaMC/map-markers/black-logo.png"; } <div class="full-width-image" style="background-image: url('@Billede')"> <img src="/x.gif" class="hidden" alt="@Dealer.Name" /> </div> <div class="shop-information container"> <h1 class="shop-name">@Dealer.Name</h1> <div class="row"> <div class="col-xs-12 col-sm-7 map-container" > <div class="google-map" id="js-google-maps" data-geolocationlng="@Dealer.GeoLocationLng.ToString().Replace(",",".")" data-geolocationlat="@Dealer.GeoLocationLat.ToString().Replace(",",".")" data-icon="@Icon"></div> </div> <div class="col-xs-12 col-sm-5"> <h5 class="sub-header">Adresse</h5> <p class="text"> @Dealer.Address </p> @if (!String.IsNullOrEmpty(Dealer.Address2)) { <p class="text"> @Dealer.Address2 </p> } <p class="text"> @Dealer.Zip @Dealer.City </p> @if (!String.IsNullOrEmpty(Dealer.Phone)) { <p class="text"> <a href="tel:@Dealer.Phone">@Dealer.Phone</a> </p> } @if (!String.IsNullOrEmpty(Email)) { <p class="text"> Email: <a href="mailto:@Email">@Email</a> </p> } @if (!String.IsNullOrEmpty(Hjemmeside)) { <p class="text"> Web: <a href="http://@Hjemmeside">@Hjemmeside</a> </p> } <h5 class="sub-header mt">Aut. Honda forhandler af</h5> <p class="text"> @if(Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_MC_dealer")) { <div>MC</div> } @if(Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_MX_dealer")) { <div>MX</div> } @if(Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_ATV_dealer")) { <div>ATV</div> } @if(Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_Scooter_dealer")) { <div>Scooter</div> } </p> <h5 class="sub-header mt">Aut. Honda Serviceværkested for</h5> <p class="text"> @if(Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_MC_workshop")) { <div>MC</div> } @if(Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_MX_workshop")) { <div>MX</div> } @if(Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_ATV_workshop")) { <div>ATV</div> } @if(Firstweb.Custom.CustomCode.Frontend.Helpers.User.GetCustomFieldValueBool(Dealer, "AccessUser_Scooter_workshop")) { <div>Scooter</div> } </p> @if (!String.IsNullOrWhiteSpace(Aabningstider)) { <h5 class="sub-header mt">&Aring;bningstider</h5> <p class="text"> @Aabningstider </p> } @*<div class="legends"> @if (IsAuthorizedDealer) { <p class="legend">@Translate("AutDealer", "Aut. Honda forhandler")</p> } @if (IsServiceCenter) { <p class="legend black-legend">@Translate("AutWorkshop", "Aut. Serviceværkested")</p> } </div>*@ </div> </div> @if (DealerPage.GetDealerStockList().Where(cs => cs.DwProduct != null && !String.IsNullOrEmpty(cs.DwProduct.ID)).Any()) { <div class="stock-list"> <h2 class="header">@GetString("Item.Header")</h2> <p class="sub-header"> @GetString("Item.SubHeader") </p> <div class="list"> <p class="list-header">Model</p> @{ string lastProductID = ""; var dealerStockList = DealerPage.GetDealerStockList().Where(cs => cs.DwProduct != null && !String.IsNullOrEmpty(cs.DwProduct.ID)).OrderBy(cs => cs.EngineSize).ThenBy(cs => cs.DwProduct.Name).ThenByDescending(cs => cs.Year_Sorting).ThenByDescending(cs => cs.Year_Start); foreach (var customerStock in dealerStockList) { string thisProductID = customerStock.DwProduct.ID; if (thisProductID != lastProductID) { lastProductID = thisProductID; var mainProductNumber = thisProductID.Replace("-at-SHOP2",""); var PrimaryGroupID = customerStock.DwProduct.Groups.FirstOrDefault() != null ? customerStock.DwProduct.Groups.FirstOrDefault().ID : ""; var Link = ProductDetailsLink + "&GroupID=" + PrimaryGroupID + "&ProductID=" + customerStock.DwProduct.ID + "&VariantID=" + customerStock.DwProduct.DefaultVariantComboID; var YearStart = (customerStock.DwProduct.ProductFieldValues.GetProductFieldValue("FirstwebYearStart").Value.ToString() == "0") ? "" : customerStock.DwProduct.ProductFieldValues.GetProductFieldValue("FirstwebYearStart").Value.ToString(); var YearEnd = (customerStock.DwProduct.ProductFieldValues.GetProductFieldValue("FirstwebYearEnd").Value.ToString() == "0") ? "" : customerStock.DwProduct.ProductFieldValues.GetProductFieldValue("FirstwebYearEnd").Value.ToString(); var YearLabel = (YearStart == YearEnd) ? YearStart : YearStart + " - " + YearEnd; var Image = "/Admin/Public/Getimage.ashx?width=112&height=61&Crop=5&image=/Files/Images/Ecom/HondaMC/Products/" + mainProductNumber + ".jpg"; var Name = (String.IsNullOrEmpty(YearLabel)) ? customerStock.DwProduct.Name : customerStock.DwProduct.Name + " : " + YearLabel; <div class="list-item"> <div class="image-container"> <img src="@Image" alt="@Name" /> </div> <div class="name-container"> <p class="model-name"> @Name </p> @if (dealerStockList.Where(cs => cs.DwProduct.ID == thisProductID && cs.IsDemo).Any()) { <p class="demo">Demo motorcykel</p> } </div> <div class="container-btn"> <a href="@Link" class="btn btn-primary">Se mere <span class="custom-arrow"></span></a> </div> </div> } } } </div> </div> } </div> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyALkwVJTiuxD8T8nfADQK5fLMsuH6j7uNA"></script>

Følg os på Facebook

Loading icon

Accepter cookies fra Honda-MC.dk

For at du får den bedste oplevelse hos Honda-MC bruger vi cookies. Ved brug af sitet accepterer du brugen af cookies

Acceptér