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

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