Error executing template "Designs/smyrilline/Paragraph/ProductPackage.cshtml"
System.FormatException: Input string was not in a correct format.
   at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Double.Parse(String s)
   at CompiledRazorTemplates.Dynamic.RazorEngine_fb8c71745723447fadd8bc634a6c9dbe.<>c.b__1_21(Cabin x) in E:\dynamicweb.net\solutions\smyrilline2018.dw9.dynamicweb-cms.com\Files\Templates\Designs\smyrilline\Paragraph\ProductPackage.cshtml:line 536
   at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
   at System.Linq.OrderedEnumerable`1.d__1.MoveNext()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at CompiledRazorTemplates.Dynamic.RazorEngine_fb8c71745723447fadd8bc634a6c9dbe.<>c__DisplayClass1_2.b__8(Departure d) in E:\dynamicweb.net\solutions\smyrilline2018.dw9.dynamicweb-cms.com\Files\Templates\Designs\smyrilline\Paragraph\ProductPackage.cshtml:line 536
   at CompiledRazorTemplates.Dynamic.RazorEngine_fb8c71745723447fadd8bc634a6c9dbe.Execute() in E:\dynamicweb.net\solutions\smyrilline2018.dw9.dynamicweb-cms.com\Files\Templates\Designs\smyrilline\Paragraph\ProductPackage.cshtml:line 630
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System 2 @using System.IO 3 @using System.Linq 4 @using System.Xml.Serialization 5 @using System.Collections.Generic 6 @using Smyrilline.Web.Types 7 8 @{ 9 bool noImageGradient = GetBoolean("Item.Don_tAddGradient"); 10 bool dontShowFirstLetter = false; 11 } 12 13 @foreach (var product in GetLoop("Item.Product").OrderBy(x => x.GetInteger("Ecom:Product.Number")).ToList()) { 14 dontShowFirstLetter = product.GetBoolean("Ecom:Product:Field.PackageDontShowFirstLetter"); 15 string letter = ""; 16 17 if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.LongDescriptionHeader"))) { 18 letter = product.GetString("Ecom:Product:Field.LongDescriptionHeader").Substring(0,1); 19 } else if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.MetaTitle"))) { 20 letter = product.GetString("Ecom:Product.MetaTitle").Substring(0,1); 21 } 22 23 int width = 277; 24 int height = 315; 25 string letterTmp = letter.ToLower(); 26 int y = 0; 27 28 if ( 29 letterTmp == "a" || 30 letterTmp == "c" || 31 letterTmp == "g" || 32 letterTmp == "o" || 33 letterTmp == "q" || 34 letterTmp == "y" || 35 letterTmp == "å" 36 ) { 37 width = 225; 38 height = 450; 39 40 if ( 41 letterTmp == "a" || 42 letterTmp == "g" || 43 letterTmp == "o" || 44 letterTmp == "q" 45 ) { 46 y = 320; 47 } else if (letterTmp == "å") { 48 y = 420; 49 } else { 50 y = 300; 51 } 52 } 53 54 if ( 55 letterTmp == "b" || 56 letterTmp == "d" 57 ) { 58 width = 180; 59 height = 320; 60 y = 300; 61 } 62 63 if ( 64 letterTmp == "l" || 65 letterTmp == "s" || 66 letterTmp == "p" 67 ) { 68 width = 200; 69 height = 340; 70 y = 320; 71 72 if (letterTmp == "l") { 73 y = 310; 74 } 75 } 76 77 if ( 78 letterTmp == "f" || 79 letterTmp == "h" || 80 letterTmp == "i" || 81 letterTmp == "r" || 82 letterTmp == "j" || 83 letterTmp == "v" || 84 letterTmp == "x" 85 ) { 86 width = 240; 87 height = 410; 88 y = 330; 89 90 if ( 91 letterTmp == "r" || 92 letterTmp == "v" 93 ) { 94 y = 320; 95 } 96 97 if ( 98 letterTmp == "i" || 99 letterTmp == "j" 100 ) { 101 y = 300; 102 } 103 104 if (letterTmp == "h") { 105 y = 320; 106 } 107 108 if ( 109 letterTmp == "f" || 110 letterTmp == "x" 111 ) { 112 y = 310; 113 } 114 } 115 116 if ( 117 letterTmp == "e" || 118 letterTmp == "k" || 119 letterTmp == "u" || 120 letterTmp == "z" || 121 letterTmp == "ø" 122 ) { 123 width = 265; 124 height = 380; 125 y = 330; 126 127 if (letterTmp == "e") { 128 y = 310; 129 } 130 131 if (letterTmp == "u") { 132 y = 300; 133 } 134 135 if ( 136 letterTmp == "z" || 137 letterTmp == "ø" 138 ) { 139 y = 320; 140 } 141 } 142 143 if ( 144 letterTmp == "n" || 145 letterTmp == "t" 146 ) { 147 width = 280; 148 height = 340; 149 y = 325; 150 } 151 152 if ( 153 letterTmp == "m" || 154 letterTmp == "w" 155 ) { 156 width = 350; 157 height = 360; 158 y = 320; 159 } 160 161 if (letterTmp == "å") { 162 width = 380; 163 height = 370; 164 y = 340; 165 } 166 167 if (letterTmp == "þ") { 168 width = 225; 169 height = 450; 170 y = 390; 171 } 172 173 if (letterTmp == "é") { 174 width = 300; 175 height = 450; 176 y = 400; 177 } 178 179 if (letterTmp == "à") { 180 width = 250; 181 height = 450; 182 y = 400; 183 } 184 185 if (letterTmp == "î") { 186 width = 250; 187 height = 450; 188 y = 400; 189 } 190 191 if (letterTmp == "ü") { 192 width = 300; 193 height = 450; 194 y = 400; 195 } 196 197 if (letterTmp == "1") { 198 width = 300; 199 height = 450; 200 y = 300; 201 } 202 203 if (letterTmp == "2") { 204 width = 300; 205 height = 450; 206 y = 300; 207 } 208 209 bool noEcomHeader = false; 210 211 if (System.Web.HttpContext.Current.Items["NoEcomHeader"] != null) { 212 noEcomHeader = Convert.ToBoolean(System.Web.HttpContext.Current.Items["NoEcomHeader"].ToString()); 213 } 214 215 if (!noEcomHeader) { 216 string headerCssClass = ""; 217 218 if (product.GetBoolean("Ecom:Product:Field.PageHeaderShowWave.Value")) { 219 headerCssClass += "header-wave "; 220 } 221 222 if (product.GetBoolean("Ecom:Product:Field.PageHeaderAddGradient.Value")) { 223 headerCssClass += "header-gradient "; 224 } 225 226 if (product.GetBoolean("Ecom:Product:Field.PageHeaderAddImageOverlay.Value")) { 227 headerCssClass += "overlay "; 228 } 229 230 string headerStyle = "background-image: url(" + product.GetString("Ecom:Product.ImageMedium.Clean") + ");"; 231 232 <header id="header" class='@headerCssClass' style="@headerStyle"><h1>@product.GetString("Ecom:Product:Field.PageHeaderHeadline.Value")</h1> 233 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.PageHeaderVideo.Value.FullPath")) && (GetGlobalValue("Global:Device.IsDesktop").ToString().ToLower() == "true" || GetGlobalValue("Global:Device.IsTablet").ToString().ToLower() == "true")) { 234 <div id="headerVideo"><video autobuffer autoplay muted loop playsinline><source src='@product.GetString("Ecom:Product:Field.PageHeaderVideo.Value.FullPath")' type="video/mp4" /></video></div> 235 } 236 @if (product.GetBoolean("Ecom:Product:Field.PageHeaderShowWave.Value")) { 237 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/smyrilline/images/icon-wave-2.svg"))) { 238 <span class="icon icon-wave"> 239 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/smyrilline/images/icon-wave-2.svg")) 240 </span> 241 } 242 } 243 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.ShortDescription"))) { 244 <text>@product.GetString("Ecom:Product.ShortDescription")</text> 245 } 246 @if (product.GetBoolean("Ecom:Product:Field.PageHeaderShowCTA.Value")) { 247 bool isPhone = false; 248 string subheader = product.GetString("Ecom:Product:Field.PageHeaderCTASubheader.Value").Replace(" ",""); 249 int phone = 0; 250 251 try { 252 phone = Convert.ToInt32(subheader); 253 isPhone = true; 254 } catch { 255 // 256 } 257 258 if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.PageHeaderCTATeaser.Value"))) { 259 <p>@product.GetString("Ecom:Product:Field.PageHeaderCTATeaser.Value")</p> 260 } 261 262 <span class="subheader"> 263 @if (isPhone) { 264 <a href="tel:@subheader">@product.GetString("Ecom:Product:Field.PageHeaderCTASubheader.Value")</a> 265 } else { 266 <text>@product.GetString("Ecom:Product:Field.PageHeaderCTASubheader.Value")</text> 267 } 268 </span><a class="button button-primary" href="@product.GetString("Ecom:Product:Field.PageHeaderCTALink.Value")" @if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.PageHeaderCTALinkTitle.Value"))) {<text>title='@product.GetString("Ecom:Product:Field.PageHeaderCTALinkTitle.Value")'</text>}> 269 @if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.PageHeaderCTALinkText.Value"))) { 270 <text>@product.GetString("Ecom:Product:Field.PageHeaderCTALinkText.Value")</text> 271 } else { 272 <text>@Translate("Translate_Read_more")</text> 273 } 274 </a> 275 } 276 @if (product.GetBoolean("Ecom:Product:Field.PageHeaderShowBooking.Value")) { 277 <p>@product.GetString("Ecom:Product:Field.PageHeaderBookingText.Value")</p><div ng-app="app"><booking-calendar locale="com" class="book"></booking-calendar></div> 278 279 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/smyrilline/images/icon-arrow-long-down.svg"))) { 280 <span class="icon icon-arrow-long-down"> 281 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/smyrilline/images/icon-arrow-long-down.svg")) 282 </span> 283 } 284 285 @SnippetStart("jsbottom") 286 if (System.Web.HttpContext.Current.Items["bookformassetsloaded"] != "true") { 287 <link rel="stylesheet" href="//book.smyrilline.com/app/wwwroot/lib/jquery-ui/themes/base/jquery-ui.css"><link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" rel="stylesheet"><link href="//book.smyrilline.com/app/external/calendar.css" rel="stylesheet"><script src="//book.smyrilline.com/app/wwwroot/lib/jquery/dist/jquery.js"></script><script src="//book.smyrilline.com/app/wwwroot/lib/jquery-ui/jquery-ui.js"></script><script src="//book.smyrilline.com/app/wwwroot/lib/angular/angular.js"></script><script src="//book.smyrilline.com/app/wwwroot/lib/angular-translate/angular-translate.min.js"></script><script src="//book.smyrilline.com/app/wwwroot/lib/angular-ui-date/dist/date.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script><script src="//book.smyrilline.com/app/external/calendar.js"></script> 288 289 System.Web.HttpContext.Current.Items["bookformassetsloaded"] = "true"; 290 } 291 @SnippetEnd("jsbottom") 292 } 293 @if (product.GetBoolean("Ecom:Product:Field.PageHeaderShowArrowDown.Value")) { 294 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/smyrilline/images/icon-arrow-long-down.svg"))) { 295 <span class="icon icon-arrow-long-down"> 296 @System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/files/templates/designs/smyrilline/images/icon-arrow-long-down.svg")) 297 </span> 298 } 299 } 300 </header> 301 } else { 302 @SnippetStart("ProductHeader") 303 @product.GetString("Ecom:Product.Name") 304 @SnippetEnd("ProductHeader") 305 306 if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.ShortDescription"))) { 307 @SnippetStart("HeaderListTeaser") 308 @product.GetString("Ecom:Product.ShortDescription") 309 @SnippetEnd("HeaderListTeaser") 310 } 311 } 312 <section class="section section-text section-dark @if(noImageGradient) {<text>no-image-gradient</text>}" @if(!dontShowFirstLetter) {<text>data-letter='@letterTmp'</text>}><div class="content"> 313 @if(!dontShowFirstLetter) { 314 <canvas class="canvas" id='@("canvas")@GetString("ParagraphID")' width='@width' height='@height'></canvas> 315 } 316 <div class="content-inner"><h2>@product.GetString("Ecom:Product:Field.LongDescriptionHeader")</h2><div class="LongDescription"> 317 @product.GetString("Ecom:Product.LongDescription") 318 </div> 319 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ExtraDescription.Value"))) { 320 <div class="see-more-content"> 321 @product.GetString("Ecom:Product:Field.ExtraDescription.Value") 322 </div><a class="see-more" data-opened-text='@Translate("Translate_Read_less")' data-closed-text='@Translate("Translate_Read_more")'>@Translate("Translate_Read_more")</a> 323 } 324 </div> 325 @SnippetStart("jsbottom") 326 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.LongDescriptionHeader"))) { 327 string[] files = Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath("/files/images/smyrilline_2018/letter_backgrounds/")); 328 329 if (Pageview.Area.Item["LetterBackgroundFolder"].ToString().ToLower() != "/files/") { 330 files = Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(Pageview.Area.Item["LetterBackgroundFolder"].ToString())); 331 } 332 333 Random rnd = new Random(); 334 int randomIndex = rnd.Next(0,files.Length); 335 string randomImage = files[randomIndex]; 336 randomImage = randomImage.Substring(randomImage.IndexOf("\\Files")).Replace("\\","/"); 337 338 string fontSize = "420px"; 339 int iLetter = -1; 340 341 try { 342 iLetter = Convert.ToInt32(letter); 343 } catch { 344 // 345 } 346 347 if (iLetter != -1) { 348 fontSize = "620px"; 349 } 350 351 <script> 352 canvasLetters.push({ 353 id: '@("canvas")@GetString("ParagraphID")', 354 image: '@randomImage', 355 letter: '@letter', 356 fontSize: '@fontSize', 357 position: { 358 x: 0, 359 y: @y 360 } 361 }); 362 </script> 363 } 364 @SnippetEnd("jsbottom") 365 </div></section> 366 if(product.GetString("Ecom:Product.CategoryField.travel.ShowPriceArea.Value") == "show") { 367 string cssStyle = "style='"; 368 369 if (!product.GetBoolean("Ecom:Product.CategoryField.travel.Dont_show_gradient_and_image_on_productpackage_paragraph.Value")) { 370 cssStyle += "background-image: url(" + product.GetString("Ecom:Product.ImageLarge.Clean") + ");"; 371 } 372 373 cssStyle += "'"; 374 375 <section class="section section-prices @if (!product.GetBoolean("Ecom:Product.CategoryField.travel.Dont_show_gradient_and_image_on_productpackage_paragraph.Value")) {<text>gradient</text>} @if (!product.GetBoolean("Ecom:Product.CategoryField.travel.Dont_show_gradient_bottom_on_productpackage_paragraph.Value")) {<text>gradient-bottom</text>}" @cssStyle><div class="content"><h2>@product.GetString("Ecom:Product:Field.PricesHeader.Value")</h2><div class="prices"><div class="prices-inner"> 376 @product.GetString("Ecom:Product:Field.Prices.Value") 377 @if(product.GetBoolean("Ecom:Product.CategoryField.excursions.Show_Facts.Value")) { 378 <h3>@Translate("Translate_Facts")</h3><table class="facts"><tbody> 379 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.ExcursionPlace.Value"))) { 380 <tr><td>@Translate("Translate_ExcursionPlace")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.ExcursionPlace.Value")</td></tr> 381 } 382 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Period_text.Value"))) { 383 <tr><td>@Translate("Translate_Period")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.Period_text.Value")</td></tr> 384 } 385 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Day_of_week.Value"))) { 386 <tr><td>@Translate("Translate_Day_of_week")</td><td> 387 @{ 388 Func<string, string> getday = (d) => 389 { 390 switch (d) 391 { 392 case "1": return "Mon"; 393 case "2": return "Tue"; 394 case "3": return "Wed"; 395 case "4": return "Thu"; 396 case "5": return "Fri"; 397 case "6": return "Sat"; 398 case "7": return "Sun"; 399 default: return ""; 400 } 401 }; 402 } 403 @foreach(string exDay in product.GetString("Ecom:Product.CategoryField.excursions.Day_of_week.Value").Split(new char[] { ',' })) { 404 <span>@Translate("Translate_Day_"+getday(exDay))</span> 405 } 406 </td></tr> 407 } 408 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Time.Value"))) { 409 <tr><td>@Translate("Translate_Time")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.Time.Value")</td></tr> 410 } 411 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Duration.Value"))) { 412 <tr><td>@Translate("Translate_Duration")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.Duration.Value")</td></tr> 413 } 414 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Included.Value"))) { 415 <tr><td>@Translate("Translate_Included")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.Included.Value")</td></tr> 416 } 417 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Available_in_season.Value"))) { 418 <tr><td>@Translate("Translate_Available_in_season_label")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.Available_in_season.Value")</td></tr> 419 } 420 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.PickUp.Value"))) { 421 <tr><td>@Translate("Translate_PickUp")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.PickUp.Value")</td></tr> 422 } 423 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.LevelOfDifficulty.Value"))) { 424 <tr><td>@Translate("Translate_LevelOfDifficulty")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.LevelOfDifficulty.Value")</td></tr> 425 } 426 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Conditions.Value"))) { 427 <tr><td>@Translate("Translate_Conditions")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.Conditions.Value")</td></tr> 428 } 429 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.What_to_wear.Value"))) { 430 <tr><td>@Translate("Translate_What_to_wear")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.What_to_wear.Value")</td></tr> 431 } 432 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Languages.Value"))) { 433 <tr><td>@Translate("Translate_Languages")</td><td>@product.GetString("Ecom:Product.CategoryField.excursions.Languages.Value")</td></tr> 434 } 435 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Price_amount.Value")) || !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.CategoryField.excursions.Price_text.Value"))) { 436 <tr><td>@Translate("Translate_Prices")</td><td> 437 @product.GetString("Ecom:Product.CategoryField.excursions.Price_amount.Value") 438 @product.GetString("Ecom:Product.CategoryField.excursions.Price_text.Value") 439 @if(product.GetBoolean("Ecom:Product.CategoryField.excursions.Show_HikingFee.Value")) { 440 @Translate("Translate_HikingFee") 441 } 442 </td></tr> 443 } 444 </tbody></table> 445 } 446 @if(product.GetString("Ecom:Product.CategoryField.travel.ShowPrice.Value") == "pricelist") { 447 <span>@using System 448 @using System.IO 449 @using System.Linq 450 @using System.Xml.Serialization 451 @using System.Collections.Generic 452 @using System.Text.RegularExpressions 453 @using Smyrilline.Web.Types 454 @{ 455 Pricetablespackages root = (Pricetablespackages)new XmlSerializer(typeof(Pricetablespackages)) 456 .Deserialize(new StreamReader(System.Web.HttpContext.Current.Server.MapPath("~/Files/Files/Data/Prices2020Packages.xml"))); 457 458 Dynamicweb.Ecommerce.Products.ProductService ps = new Dynamicweb.Ecommerce.Products.ProductService(); 459 460 string ptlang = GetGlobalValue("Global:Area.Lang"); 461 462 Func<string, string> CabinMapping = (x) => 463 { 464 if(ptlang == "fo") { 465 switch (x.ToUpper()) 466 { 467 case "B4": return "PROD313"; 468 case "B2": return "PROD322"; 469 default: return x.ToUpper(); 470 } 471 } 472 switch (x.ToUpper()) 473 { 474 case "B2L": return "PROD3578"; 475 case "A2L": return "PROD3577"; 476 case "A2D": return "PROD3576"; 477 case "DLX": return "PROD3575"; 478 case "B4": return "PROD3574"; 479 case "A4": return "PROD3573"; 480 default: return x.ToUpper(); 481 } 482 }; 483 484 Func<string, long> getUnixTime = (d) => 485 { 486 long dt = 0; 487 try 488 { 489 List<int> nums = new List<int>(); 490 var matches = Regex.Matches(d, @"\d+"); 491 foreach(Match m in matches) 492 { 493 494 int num = int.Parse(m.Value); 495 if(num > 0) 496 { 497 nums.Add(num); 498 } 499 } 500 int year = nums.Last().ToString().Length == 2 ? 2000 + nums.Last() : nums.Last(); 501 int month = nums[1]; 502 int day = nums[0]; 503 DateTime ndt = new DateTime(year, month, day); 504 dt = ndt.Ticks; 505 } 506 catch { 507 // unable to parse (extract dates) from string/ 508 } 509 return dt; 510 }; 511 512 Func<string, string> getday = (d) => 513 { 514 switch (d) 515 { 516 case "1": return "Mon"; 517 case "2": return "Tue"; 518 case "3": return "Wed"; 519 case "4": return "Thu"; 520 case "5": return "Fri"; 521 case "6": return "Sat"; 522 case "7": return "Sun"; 523 default: return ""; 524 } 525 }; 526 527 Func<Departure, string> GetPriceOfDep = (d) => 528 { 529 bool total = d.Selection.Segment.Any(x => x.Type.ToLower().Contains("total")); 530 string result = ""; 531 if((ptlang == "da" || ptlang == "fo" || ptlang == "nb" || ptlang == "sv") && d.Selection.Segment.Where(x => string.IsNullOrEmpty(x.DoNotFeature)).SelectMany(x => x.Cabin).Where(x => x.Dkk != "").Any()) { 532 if(total) { 533 var collectedPrices = d.Selection.Segment.Where(x => string.IsNullOrEmpty(x.DoNotFeature)).SelectMany(x => x.Cabin).Where(x => x.Dkk != "").OrderBy(x => double.Parse(x.Dkk)).Select(x => x.Dkk + (ptlang == "da" ? " DKK" : " kr.")); 534 result += string.Join(" / ", collectedPrices); 535 } else { 536 result = d.Selection.Segment.Where(x => string.IsNullOrEmpty(x.DoNotFeature)).SelectMany(x => x.Cabin).Where(x => x.Dkk != "").OrderBy(x => double.Parse(x.Dkk)).First().Dkk; 537 result += (ptlang == "da" || ptlang == "nb" || ptlang == "sv" ? " DKK" : " kr."); 538 } 539 } else if(d.Selection.Segment.Where(x => string.IsNullOrEmpty(x.DoNotFeature)).SelectMany(x => x.Cabin).Where(x => x.Eur != "").Any()) { 540 result = "&euro; "; 541 result += d.Selection.Segment.Where(x => string.IsNullOrEmpty(x.DoNotFeature)).SelectMany(x => x.Cabin).Where(x => x.Eur != "").OrderBy(x => double.Parse(x.Eur)).First().Eur; 542 } 543 return result; 544 }; 545 546 bool departuresHaveHotels = false; 547 string productId = product.GetString("Ecom:Product.ID"); 548 Product prod = null; 549 foreach (Product p in root.Resorts.Resort.SelectMany(x => x.Products.Product)) 550 { 551 if (p._Code == productId) 552 { 553 prod = p; 554 } 555 else if (p.Code != null && (p.Code.En == productId || p.Code.Dk == productId)) 556 { 557 prod = p; 558 } 559 } 560 List<Departures> priceSection = null; 561 if(prod != null) { 562 prod.Prices.Departures.Departure.Select(x => x.Selection.Season).Distinct(); 563 departuresHaveHotels = prod.Prices.Departures.Departure.Any(x => x.Selection.Hotel != null); 564 } 565 } 566 @if(prod != null) { 567 <table> 568 <thead> 569 <tr> 570 <th>@Translate("Translate_Period")</th> 571 <th>@Translate("Translate_Duration")</th> 572 @if(departuresHaveHotels) { 573 <th>@Translate("Translate_Hotels")</th> 574 } 575 <th>@Translate("Translate_Prices_From")</th> 576 @if(System.Web.HttpContext.Current.Items["_navigationBookLink"] != null) { 577 <th class="product-pricetable-bookbtn">@Translate("Translate_Book")</th> 578 } 579 </tr> 580 </thead> 581 <tbody> 582 @foreach (Departure dep in prod.Prices.Departures.Departure.OrderBy(x => x.Featured).ThenBy(x => getUnixTime(x.Date))) 583 { 584 <tr class="@(string.IsNullOrEmpty(dep.Featured) ? "price-list-unfeatured" : "") @(dep.Offer != null ? "pg-offer" : "") @(dep.Selection.Segment.Any(x => x.Type.ToLower().Contains("total")) ? "" : "departure-row")" name="@(dep.Selection.Season + dep.Date)"> 585 <td data-title="Period"> 586 <div>@string.Join(" & ", dep.Selection.Season.Split(',').Select(x => @Translate("Translate_"+x)))</div> 587 @dep.Date</td><td data-title="Duration">@dep.Selection.Duration.Days @Translate("Translate_Nights") 588 @if(!string.IsNullOrEmpty(dep.Selection.Traveldays.Outbound) || !string.IsNullOrEmpty(dep.Selection.Traveldays.Return)) { 589 @(Translate("Translate_Day_"+getday(dep.Selection.Traveldays.Outbound)) + "-" + @Translate("Translate_Day_"+getday(dep.Selection.Traveldays.Return))) 590 } 591 @if(!string.IsNullOrEmpty(dep.Selection.Duration.Stay)) { 592 <br/><span>(@dep.Selection.Duration.Stay @Translate("Translate_Duration_Stay"))</span> 593 } 594 </td> 595 @if(departuresHaveHotels) { 596 <td>@Translate("Translate_"+@dep.Selection.Hotel.Name)</td> 597 } 598 <td data-title="Prices from"> 599 @if(dep.OfferMessage != null) { 600 <div class="offer-msg">@Translate("Translate_" + dep.OfferMessage)</div> 601 } 602 603 <div class="price"> 604 @if(dep.Selection.Segment.Any(x => x.Type.ToLower().Contains("total"))) { 605 foreach(var seg in dep.Selection.Segment) { 606 foreach(var cab in seg.Cabin) { 607 <div class="departure-info-cabin"> 608 <span class="departure-info-cabin-type"> 609 @if(seg.Type.ToLower().Contains("total")) { 610 <span>@Translate("Translate_" + seg.Type) </span> 611 } else { 612 Dynamicweb.Ecommerce.Products.Product psp = ps.GetProductById(CabinMapping(cab.Type), "", false); 613 if(psp != null) { 614 <span>@psp.Name</span> 615 } else { 616 <span>@Translate("Cabin")</span> 617 } 618 } 619 </span> 620 <span class="departure-info-cabin-price"><span> - </span> 621 @(ptlang == "da" || ptlang == "nb" || ptlang == "sv" ? cab.Dkk + " DKK " : ptlang == "fo" ? cab.Dkk + " kr." : "&euro; " + cab.Eur) 622 @if(!dep.Selection.Segment.Any(x => x.Type.ToLower().Contains("total"))) { 623 <span>@Translate("Translate_PerPerson")</span> 624 } 625 </span> 626 </div> 627 } 628 } 629 } else { 630 <span>@GetPriceOfDep(dep)</span> 631 } 632 633 @if(!dep.Selection.Segment.Any(x => x.Type.ToLower().Contains("total"))) { 634 <span>@Translate("Translate_PerPerson")</span> 635 } 636 </div> 637 @if((ptlang == "da" || ptlang == "fo" || ptlang == "nb" || ptlang == "sv") && dep.SparAmountDKK != null) { 638 <div class="pt-spar-txt">@Translate("Translate_PriceTable_Spar") @dep.SparAmountDKK</div> 639 } 640 @if(!(ptlang == "da" || ptlang == "fo" || ptlang == "nb" || ptlang == "sv") && dep.SparAmountEUR != null) { 641 <div class="pt-spar-txt">@Translate("Translate_PriceTable_Spar") @dep.SparAmountEUR</div> 642 } 643 </td> 644 @if(System.Web.HttpContext.Current.Items["_navigationBookLink"] != null) { 645 <td ata-title="Book" class="product-pricetable-bookbtn"> 646 <a href="@System.Web.HttpContext.Current.Items["_navigationBookLink"]" class="button button-primary"><span class="text">@Translate("Translate_Book_Now")</span></a> 647 </td> 648 } 649 </tr> 650 <tr class="@(string.IsNullOrEmpty(dep.Featured) ? "price-list-unfeatured" : "") departure-info-row" name="@(dep.Selection.Season + dep.Date)"> 651 <td colspan="4"> 652 @foreach(var seg in dep.Selection.Segment) { 653 foreach(var cab in seg.Cabin) { 654 <div class="departure-info-cabin"> 655 <div class="departure-info-cabin-type"> 656 @if(seg.Type.ToLower().Contains("total")) { 657 <span>@Translate("Translate_" + seg.Type) </span> 658 } else { 659 Dynamicweb.Ecommerce.Products.Product psp = ps.GetProductById(CabinMapping(cab.Type), "", false); 660 if(psp != null) { 661 <span>@psp.Name</span> 662 } else { 663 <span>@Translate("Cabin")</span> 664 } 665 } 666 </div> 667 <div class="departure-info-cabin-price"> 668 @(ptlang == "da" || ptlang == "nb" || ptlang == "sv" ? cab.Dkk + " DKK " : ptlang == "fo" ? cab.Dkk + " kr." : "&euro; " + cab.Eur) 669 @if(!dep.Selection.Segment.Any(x => x.Type.ToLower().Contains("total"))) { 670 <span>@Translate("Translate_PerPerson")</span> 671 } 672 </div> 673 </div> 674 } 675 } 676 </td> 677 </tr> 678 <tr></tr> 679 } 680 </tbody> 681 </table> 682 <span id="priceListToggle"> 683 <span id="priceListToggle_show">@Translate("Translate_ProductPrice_Toggle_Show")</span> 684 <span id="priceListToggle_hide">@Translate("Translate_ProductPrice_Toggle_Hide")</span> 685 </span> 686 }</span> 687 } 688 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.PriceIncludes.Value")) || !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.AddOn.Value")) 689 && (product.GetString("Ecom:Product.CategoryField.travel.DisplayPriceIncludes.Value").ToLower().Contains("show") || product.GetString("Ecom:Product.CategoryField.travel.AddOn.Value").ToLower().Contains("show"))) { 690 <ul> 691 @if (product.GetString("Ecom:Product.CategoryField.travel.DisplayPriceIncludes.Value").ToLower().Contains("show")) { 692 <li> 693 @Translate("Translate_Price_includes") 694 @product.GetString("Ecom:Product:Field.PriceIncludes") 695 </li> 696 } 697 @if (product.GetString("Ecom:Product.CategoryField.travel.AddOn.Value").ToLower().Contains("show")) { 698 <li> 699 @Translate("Translate_AddOns") 700 @product.GetString("Ecom:Product:Field.AddOn.Value") 701 </li> 702 } 703 </ul> 704 } 705 <div class="info"> 706 @{ 707 int termsPID = -1; 708 709 try { 710 termsPID = Convert.ToInt32(product.GetString("Ecom:Product:Field.TermsAndConditionsParagaphID.Value")); 711 } catch { 712 713 } 714 } 715 @if (termsPID != -1) { 716 @RenderParagraphContent(termsPID) 717 } 718 @using System.Linq 719 720 @if (System.Web.HttpContext.Current.Items["_pageNavigationBookLink"] == null) { 721 string[] call2Action = product.GetString("Ecom:Product.CategoryField.travel.CallToAction.Value").Split(','); 722 bool PhoneUs = call2Action.Any(x => x.ToLower() == "phoneus"); 723 bool EmailUs = call2Action.Any(x => x.ToLower() == "email"); 724 bool OnlineBooking = call2Action.Any(x => x.ToLower() == "onlinebooking"); 725 bool BookingFormula = call2Action.Any(x => x.ToLower() == "bookingformula"); 726 bool OnlineBookingModule = call2Action.Any(x => x.ToLower() == "onlinebookingmodule"); 727 string plang = GetGlobalValue("Global:Area.Lang"); 728 729 string ctaLink = product.GetString("Ecom:Product.CategoryField.travel.Book.Value"); 730 731 if(string.IsNullOrWhiteSpace(ctaLink)) { 732 if(OnlineBooking) { 733 ctaLink = "https://book.smyrilline.com?line=" + product.GetString("Ecom:Product.CategoryField.travel.Line.Value") + "&tariff=" + product.GetString("Ecom:Product.CategoryField.travel.Tariff.Value"); 734 } else if(BookingFormula) { 735 switch(plang) { 736 case "da": ctaLink = "/bestil-rejsen?tab=forespørgsel"; break; 737 case "de": ctaLink = "/buchung?tab=buchungsanfrage"; break; 738 case "fr": ctaLink = "/comment-reserver?tab=demandedereservation"; break; 739 case "nl": ctaLink = "/hoe-te-boeken/reserveringsmogelijkheden/stuur-een-boekingsaanvraag"; break; 740 case "fo": ctaLink = "/bilegging?tab=samband"; break; 741 case "nb": ctaLink = "/bestill-reisen-din?tab=forespoersel"; break; 742 case "sv": ctaLink = "/boka-din-resa?tab=beställningsformulär"; break; 743 default: ctaLink = "/how-to-book?tab=sendbookingrequest"; break; 744 } 745 } 746 } 747 748 System.Web.HttpContext.Current.Items["_navigationBookLink"] = ctaLink; 749 750 if(PhoneUs) { 751 <span>@Translate("Translate_Call_Phone") @Pageview.Area.Item["Phone"]</span> 752 } 753 if(EmailUs) { 754 <span>@Translate("Translate_Email_us") <a href='mailto:@Pageview.Area.Item["Mail"]'>@Pageview.Area.Item["Mail"]</a></span> 755 } 756 if(OnlineBooking || BookingFormula) { 757 <a href="@ctaLink" target="_blank" class="button button-primary"><span class="text">@Translate("Translate_Book_Trip")</span></a> 758 } 759 } 760 <div class="Favorable-Purchase-Agreement"> 761 @Pageview.Area.Item["Favorable_Purchase_Agreement"] 762 </div></div></div></div></div></section> 763 } 764 @RenderItemList(new { 765 ItemType = "tabs", 766 ListSourceType = "Page", 767 ListSourcePage = Pageview.Page.ID, 768 IncludeAllChildItems = true, 769 ItemFieldsList = "*", 770 ListOrderBy = "Sort", 771 ListTemplate = "itempublisher/list/productpackage.tabs.cshtml", 772 ListPageSize = 1 773 }) 774 }

Bilkarta över Island

Vid beställning av resepaket till Island skickar vi med en bilkarta över Island när totalsumman för resan är betald.

Bilkarta över Island

Utflykter på Island

Traveling in Iceland is a great experience in itself, however to make the trip in Iceland even more exciting you have the option to go on different excursions during your travel around Iceland.

Läs mer
Utflykter på Island

10 idéer till upplevelser på Island

Vill du ha en autentisk naturupplevelse på Island, men är osäker på grund av den växande turismen i och runt om Reykjavik (The Golden Circle)? Vi är experter på att hitta platser där turismen ännu inte har tagit över. Vi har flera tips på var du hittar autentiska, isländska naturupplevelser, där gästfria islänningar med glädje visar dig sitt land. 

10 idéer till upplevelser på Island
10 idéer till upplevelser på Island

Hur man kör på Island

Hur man kör på Island

Bli inspirerad

Vill du få information om bra erbjudanden? Detta är lätt att fixa, du anmäler dig bara till vårt nyhetsbrev så får du ett mail när vi har speciella erbjudanden och nyheter.

Få en kopia skickas gratis

Fyll vänligen i fälten för att ta emot en gratis katalog