Error executing template "Designs/Swift/Paragraph/DSC_Shop_Info.cshtml"
System.ArgumentNullException: Value cannot be null.
Parameter name: input
   at System.Text.RegularExpressions.Regex.IsMatch(String input)
   at System.Text.RegularExpressions.Regex.IsMatch(String input, String pattern)
   at CompiledRazorTemplates.Dynamic.RazorEngine_35404f086205485dbb0767b0db338d35.Execute() in D:\dynamicweb.net\Solutions\NexusOne\DanskeShoppingcentre.cloud.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DSC_Shop_Info.cshtml:line 61
   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.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Frontend 3 @using DSCBackend.Services; 4 @using DSCBackend.ViewModels; 5 @using System.Text.RegularExpressions; 6 @using DSCBackend.TemplateHelpers; 7 8 @functions { public string getWeekday(int dayNumber) 9 { 10 switch (dayNumber) 11 { 12 case 1: 13 return Translate("Mandag", "Mandag"); 14 case 2: 15 return Translate("Tirsdag", "Tirsdag"); 16 case 3: 17 return Translate("Onsdag", "Onsdag"); 18 case 4: 19 return Translate("Torsdag", "Torsdag"); 20 case 5: 21 return Translate("Fredag", "Fredag"); 22 case 6: 23 return Translate("Lørdag", "Lørdag"); 24 case 7: 25 return Translate("Søndag", "Søndag"); 26 default: 27 return ""; 28 } 29 } 30 public bool hasExternalLinkInPath(string incomingURL) 31 { 32 return incomingURL.Contains("//"); 33 } 34 35 } 36 37 38 @{ string CrmShopId = null; 39 ShopInfoViewModel viewModel = new ShopInfoViewModel(); 40 viewModel.WeekOpenings = new Dictionary<int, string>(); 41 try 42 { 43 object CRM_Shop_ID; 44 Pageview.Page.Item.TryGetValue("CRM_Shop_ID", out CRM_Shop_ID); 45 CrmShopId = (string)CRM_Shop_ID; 46 viewModel = ShopInfoService.GetShopInfoFromID(CrmShopId); 47 } 48 catch (Exception ex) 49 { 50 51 } 52 } 53 54 @{ if (CrmShopId != null) 55 { 56 <div class="dsc-row dsc-shopinfo-container dsc-m-column "> 57 <div class="dsc-column dsc-shopinfo-column"> 58 <p class="dsc-shop-info-bold">@Translate("Denne uge", "Denne uge")</p> 59 @foreach (var keyValuePair in viewModel?.WeekOpenings) 60 { 61 var val = Regex.IsMatch(keyValuePair.Value, @"^[a-zA-Z]+$"); 62 string openinhoursValue = keyValuePair.Value; 63 if (val) 64 { 65 openinhoursValue = UtilityHelper.GetTranslationForMatch(keyValuePair.Value, Pageview.Area.CultureInfo.Name); 66 } 67 <div class="dsc-row dsc-shop-opening dsc-max-width75"> 68 <p>@getWeekday(keyValuePair.Key)</p> <p>@openinhoursValue</p> 69 </div> 70 } 71 72 @{ var linkModel = Model.Item.GetValue("Opening_Hours_Link") as Dynamicweb.Frontend.LinkViewModel; } 73 <a style="margin-top: 20px;" class="dsc-row dsc-shop-info-button " href="@linkModel?.Url"> 74 <span class="dsc-hero-button1 btn-primary dsc-branding-button-primary dsc-btn-primary-colors"> 75 @Model.Item.GetString("Opening_Hours_Text") 76 </span> 77 </a> 78 79 <div class="dsc-shop-contact-info"> 80 81 <p class="dsc-shop-info-bold">@Translate("Butiksside.KontaktOs", "Kontakt Os")</p> 82 83 <div class="dsc-column"> 84 @if (!string.IsNullOrEmpty(viewModel.PhoneNumber)) 85 { 86 87 <div class="dsc-shop-info-contact-padding"> 88 <img class="dsc-shop-icon" src="~/Files/Icons/DSC Ikoner/20-Telefon.svg"> 89 <a href="tel:@viewModel.PhoneNumber"> 90 <span>@viewModel.PhoneNumber</span> 91 </a> 92 </div> 93 } 94 @if (!string.IsNullOrEmpty(viewModel.Email)) 95 { 96 <div class="dsc-shop-info-contact-padding"> 97 <img class="dsc-shop-icon" src="~/Files/Icons/DSC Ikoner/21-Mail.svg"> 98 <a target="_blank" href="mailto:@viewModel.Email"> 99 100 <span class="dsc-break-word">@viewModel.Email</span> 101 </a> 102 </div> 103 } 104 @if (!string.IsNullOrEmpty(viewModel.Website)) 105 { 106 var externalPrefix = hasExternalLinkInPath(viewModel.Website) ? "" : "//"; 107 <div class="dsc-shop-info-contact-padding"> 108 <img class="dsc-shop-icon" src="~/Files/Icons/DSC Ikoner/08-Link-URL-Hjemmeside.svg"> 109 <a target="_blank" href="@externalPrefix@viewModel.Website"> 110 <span class="dsc-break-word">@viewModel.Website</span> 111 </a> 112 </div> 113 } 114 </div> 115 </div> 116 117 <div class="dsc-row dsc-center-footer-social"> 118 119 @if (!string.IsNullOrEmpty(viewModel.FacebookLink)) 120 { 121 var externalPrefix = hasExternalLinkInPath(viewModel.FacebookLink) ? "" : "//"; 122 <a target="_blank" href="@externalPrefix@viewModel.FacebookLink"> 123 <img style="margin-left:0px; margin-right: 10px; height: 30px;" src="~/Files/Icons/FACEBOOOK_dsc.svg" /> 124 </a> 125 126 } 127 @if (!string.IsNullOrEmpty(viewModel.InstagramLink)) 128 { 129 var externalPrefix = hasExternalLinkInPath(viewModel.InstagramLink) ? "" : "//"; 130 <a target="_blank" href="@externalPrefix@viewModel.InstagramLink"> 131 <img style="height: 30px;" src="~/Files/Icons/INSTAGRAM_dsc.svg" /> 132 </a> 133 } 134 </div> 135 136 </div> 137 138 <div class=""> 139 @Model.Item.GetString("Shop_Presentation") 140 </div> 141 </div> 142 143 <input hidden data-wayfindershopid="@viewModel.WayFinderId" /> 144 <input hidden data-shoplogourl="@viewModel.LogoColorUrl" /> 145 } 146 else 147 { 148 149 <h3>Missing CRM data. Must be added to page item</h3> 150 } } 151

Tilbud fra butikken

Pris:

Før:

Spar:

Pris:

Før:

Spar:

Pris:

Før:

Spar:

Pris:

Før:

Spar: