Fiskars

/

55700581

Fiskars Snjóýta SnowXpert Mover

9.295 kr.

Snjóýta sem er mjög afkastamikil og hentar vel þegar þú þarft að moka miklum snjó eða fara með snjó lengri leiðir.
Error executing template "/Designs/Byko/Paragraph/Byko_Opnunartimi_Verslana.cshtml"
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at CompiledRazorTemplates.Dynamic.RazorEngine_43915285c1684c5a9031c4c52bd246fc.IsOpen(String weekdayOpen, String weekDayClosed, String saturdayOpen, String saturdayClosed, String sundayOpen, String sundayClosed, String weekdayNoonClosed, String weekdayNoonOpen, String specialOpen, String specialClosed) in C:\inetpub\wwwroot\Byko\Files\Templates\Designs\Byko\Paragraph\Byko_Opnunartimi_Verslana.cshtml:line 20
   at CompiledRazorTemplates.Dynamic.RazorEngine_43915285c1684c5a9031c4c52bd246fc.Execute() in C:\inetpub\wwwroot\Byko\Files\Templates\Designs\Byko\Paragraph\Byko_Opnunartimi_Verslana.cshtml:line 351
   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 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 3 @functions{ 4 public static string[] IsOpen(string weekdayOpen, string weekDayClosed, string saturdayOpen, string saturdayClosed, string sundayOpen, string sundayClosed, string weekdayNoonClosed, string weekdayNoonOpen, string specialOpen, string specialClosed) 5 { 6 DateTime dt = DateTime.Now; 7 8 var dayOfWeek = dt.DayOfWeek; 9 int hour = (int)dt.Hour; 10 int minutes = (int)dt.Minute; 11 int open = -1, openMinutes = -1, close = -1, closeMinutes = -1, weekdayOpenHour = -1, weekdayOpenMinute = - 1, weekdayClosedHour = -1, weekdayClosedMinute = -1; 12 bool isOpen = false, isOpenMinute = false, isClose = false, isCloseMinute = false; 13 var test = ""; 14 15 // Byrja á að athuga hvort það sé rauðurdagur 16 if (!string.IsNullOrWhiteSpace(specialOpen) || !string.IsNullOrWhiteSpace(specialClosed)) 17 { 18 if(!string.IsNullOrWhiteSpace(specialOpen)) { 19 isOpen = Int32.TryParse(specialOpen.Split(':')[0], out open); 20 isOpenMinute = Int32.TryParse(specialOpen.Split(':')[1], out openMinutes); 21 } 22 23 if(!string.IsNullOrWhiteSpace(specialClosed)) 24 { 25 isClose = Int32.TryParse(specialClosed.Split(':')[0], out close); 26 isCloseMinute = Int32.TryParse(specialClosed.Split(':')[1], out closeMinutes); 27 } 28 29 if(!string.IsNullOrWhiteSpace(weekdayOpen)) 30 { 31 Int32.TryParse(weekdayOpen.Split(':')[0], out weekdayOpenHour); 32 Int32.TryParse(weekdayOpen.Split(':')[1], out weekdayOpenMinute); 33 } 34 35 if(!string.IsNullOrWhiteSpace(weekDayClosed)) 36 { 37 Int32.TryParse(weekDayClosed.Split(':')[0], out weekdayClosedHour); 38 Int32.TryParse(weekDayClosed.Split(':')[1], out weekdayClosedMinute); 39 } 40 41 if(specialOpen == "08:13") 42 { 43 test = "123"; 44 } 45 46 if (isOpen && isClose && isOpenMinute && isCloseMinute) 47 { 48 if (hour == open) 49 { 50 if (openMinutes <= minutes) 51 { 52 return new string[] { "Opið", specialOpen, specialClosed }; 53 } 54 else 55 { 56 return new string[] { "lokað", specialOpen, specialClosed }; 57 } 58 } 59 else if (hour > open && hour < close) 60 { 61 return new string[] { "Opið", specialOpen, specialClosed }; 62 } 63 else if(hour == close) 64 { 65 if(minutes < closeMinutes) 66 { 67 return new string[] { "Opið", weekdayOpen, specialClosed }; 68 } 69 else 70 { 71 return new string[] { "lokað", weekdayOpen, specialClosed }; 72 } 73 } 74 else 75 { 76 return new string[] { "lokað", specialOpen, specialClosed }; 77 } 78 } 79 // If only opening hours have been filled out 80 else if(isOpen && isOpenMinute) 81 { 82 if (hour == open) 83 { 84 if (openMinutes <= minutes) 85 { 86 return new string[] { "Opið", specialOpen, weekDayClosed }; 87 } 88 else 89 { 90 return new string[] { "lokað", specialOpen, weekDayClosed }; 91 } 92 } 93 else if (hour > open && hour < weekdayClosedHour) 94 { 95 return new string[] { "Opið", specialOpen, weekDayClosed }; 96 } 97 else if(hour == close) 98 { 99 if(minutes < closeMinutes) 100 { 101 return new string[] { "Opið", weekdayOpen, weekDayClosed }; 102 } 103 else 104 { 105 return new string[] { "lokað", weekdayOpen, weekDayClosed }; 106 } 107 } 108 else 109 { 110 return new string[] { "lokað", specialOpen, weekDayClosed }; 111 } 112 } 113 // If only closing hours have been filled out 114 else if(isClose && isCloseMinute) 115 { 116 Int32.TryParse(specialClosed.Split(':')[0], out close); 117 if (hour == weekdayOpenHour) 118 { 119 if (openMinutes <= weekdayOpenMinute) 120 { 121 return new string[] { "Opið", weekdayOpen, specialClosed }; 122 } 123 else 124 { 125 return new string[] { "lokað", weekdayOpen, specialClosed }; 126 } 127 } 128 else if (hour > weekdayOpenHour && hour <= close) 129 { 130 return new string[] { "Opið", weekdayOpen, specialClosed }; 131 } 132 else if(hour == close) 133 { 134 if(minutes < closeMinutes) 135 { 136 return new string[] { "Opið", weekdayOpen, specialClosed }; 137 } 138 else 139 { 140 return new string[] { "lokað", weekdayOpen, specialClosed }; 141 } 142 } 143 else 144 { 145 return new string[] { "lokað", weekdayOpen, specialClosed }; 146 } 147 } 148 return new string[] { "lokað", weekdayOpen, weekDayClosed }; 149 } 150 else if (DayOfWeek.Saturday == dt.DayOfWeek) 151 { 152 if (Int32.TryParse(saturdayOpen.Split(':')[0], out open) && Int32.TryParse(saturdayClosed.Split(':')[0], out close) 153 && Int32.TryParse(saturdayOpen.Split(':')[1], out openMinutes) && Int32.TryParse(saturdayClosed.Split(':')[1], out closeMinutes) 154 ) 155 { 156 if (hour == open) 157 { 158 if (openMinutes <= minutes) 159 { 160 return new string[] { "Opið", saturdayOpen, saturdayClosed }; 161 } 162 else 163 { 164 return new string[] { "lokað", saturdayOpen, saturdayClosed }; 165 } 166 } 167 else if (hour > open && hour < close) 168 { 169 return new string[] { "Opið", saturdayOpen, saturdayClosed }; 170 } 171 else if(hour == close) 172 { 173 if(minutes < closeMinutes) 174 { 175 return new string[] { "Opið", saturdayOpen, saturdayClosed }; 176 } 177 else 178 { 179 return new string[] { "lokað", saturdayOpen, saturdayClosed }; 180 } 181 } 182 else 183 { 184 return new string[] { "lokað", saturdayOpen, saturdayClosed }; 185 } 186 } 187 return new string[] { "lokað", saturdayOpen, saturdayClosed }; 188 } 189 else if (DayOfWeek.Sunday == dt.DayOfWeek) 190 { 191 if (Int32.TryParse(sundayOpen.Split(':')[0], out open) && Int32.TryParse(sundayClosed.Split(':')[0], out close) 192 && Int32.TryParse(sundayOpen.Split(':')[1], out openMinutes) && Int32.TryParse(sundayClosed.Split(':')[1], out closeMinutes) 193 ) 194 { 195 if (hour == open) 196 { 197 if (openMinutes <= minutes) 198 { 199 return new string[] { "Opið", sundayOpen, sundayClosed }; 200 } 201 else 202 { 203 return new string[] { "lokað", sundayOpen, sundayClosed }; 204 } 205 } 206 else if (hour > open && hour < close) 207 { 208 return new string[] { "Opið", sundayOpen, sundayClosed }; 209 } 210 else if(hour == close) 211 { 212 if(minutes < closeMinutes) 213 { 214 return new string[] { "Opið", sundayOpen, sundayClosed }; 215 } 216 else 217 { 218 return new string[] { "lokað", sundayOpen, sundayClosed }; 219 } 220 } 221 else 222 { 223 return new string[] { "lokað", sundayOpen, sundayClosed }; 224 } 225 } 226 return new string[] { "lokað", sundayOpen, sundayClosed }; 227 } 228 else 229 { 230 // Ef það er lokað í hádeginu 231 if (!string.IsNullOrWhiteSpace(weekdayNoonClosed) && !string.IsNullOrWhiteSpace(weekdayNoonOpen)) 232 { 233 int noonclose, noonopen, nooncloseMinute, noonopenMinute; 234 if (Int32.TryParse(weekdayOpen.Split(':')[0], out open) && Int32.TryParse(weekDayClosed.Split(':')[0], out close) 235 && Int32.TryParse(weekdayNoonClosed.Split(':')[0], out noonclose) && Int32.TryParse(weekdayNoonOpen.Split(':')[0], out noonopen) 236 && Int32.TryParse(weekdayOpen.Split(':')[1], out openMinutes) && Int32.TryParse(weekDayClosed.Split(':')[1], out closeMinutes) 237 && Int32.TryParse(weekdayNoonClosed.Split(':')[1], out nooncloseMinute) && Int32.TryParse(weekdayNoonOpen.Split(':')[1], out noonopenMinute) 238 ) 239 { 240 if(hour == open) 241 { 242 if (openMinutes <= minutes) 243 { 244 return new string[] { "Opið", weekdayOpen, weekdayNoonClosed, weekdayNoonOpen, weekDayClosed }; 245 } 246 } 247 else if(hour == noonopen) 248 { 249 if (noonopenMinute <= minutes) 250 { 251 return new string[] { "Opið", weekdayOpen, weekdayNoonClosed, weekdayNoonOpen, weekDayClosed }; 252 } 253 } 254 else if ((hour >= open && hour < noonclose) || (hour >= noonopen && hour < close)) 255 { 256 return new string[] { "Opið", weekdayOpen, weekdayNoonClosed, weekdayNoonOpen, weekDayClosed }; 257 } 258 return new string[] { "lokað", weekdayOpen, weekdayNoonClosed, weekdayNoonOpen, weekDayClosed }; 259 } 260 return new string[] { "lokað", weekdayOpen, weekDayClosed }; 261 } 262 else 263 { 264 if (Int32.TryParse(weekdayOpen.Split(':')[0], out open) && Int32.TryParse(weekDayClosed.Split(':')[0], out close) 265 && Int32.TryParse(weekdayOpen.Split(':')[1], out openMinutes) && Int32.TryParse(weekDayClosed.Split(':')[1], out closeMinutes) 266 ) 267 { 268 if(hour == open) 269 { 270 if(openMinutes <= minutes) 271 { 272 return new string[] { "Opið", weekdayOpen, weekDayClosed }; 273 } 274 else 275 { 276 return new string[] { "lokað", weekdayOpen, weekDayClosed }; 277 } 278 } 279 else if (hour > open && hour < close) 280 { 281 return new string[] { "Opið", weekdayOpen, weekDayClosed }; 282 } 283 else if(hour == close) 284 { 285 if(minutes < closeMinutes) 286 { 287 return new string[] { "Opið", weekdayOpen, weekDayClosed }; 288 } 289 else 290 { 291 return new string[] { "lokað", weekdayOpen, weekDayClosed }; 292 } 293 } 294 } 295 return new string[] { "lokað", weekdayOpen, weekDayClosed }; 296 } 297 } 298 } 299 } 300 301 <!-- Desktop Navbar --> 302 <span class="openinghours hidden"> 303 @{ 304 DateTime today = DateTime.Now; 305 306 bool showBorder = false; 307 if (!String.IsNullOrWhiteSpace(GetString("Item.TilkynningarbordiFra.Value")) && !String.IsNullOrWhiteSpace(GetString("Item.TilkynningarbordiTil.Value"))) 308 { 309 var borderDateFrom = (DateTime)GetValue("Item.TilkynningarbordiFra"); 310 var borderDateTo = (DateTime)GetValue("Item.TilkynningarbordiTil"); 311 312 if (borderDateFrom <= today && today <= borderDateTo) 313 { 314 showBorder = true; 315 } 316 } 317 int count = 0; 318 } 319 <a href="/" disabled="" class="hidden">Verslanir</a> 320 321 @foreach (var bud in GetLoop("Item.List")) 322 { 323 count++; 324 <div class="secondLevelItem @(count < 5 && showBorder ? "bannermargin" : "")" > 325 <a class="bold" href="@bud.GetString("Item.List.Verslun.Linkur")"> 326 @bud.GetString("Item.List.Verslun.Nafn") 327 328 @foreach (var item in bud.GetLoop("Item.List.Verslun.List")) 329 { 330 <div class="shopitem"> 331 <p class="shopaddress">@item.GetString("Item.List.Verslun.List.Heimilisfang_Budar.Value")</p> 332 333 <!-- Opið eða lokað --> 334 <!-- Athuga hvort það sé rauður dagur --> 335 @{ 336 string specialOpen = ""; 337 string specialClosed = ""; 338 } 339 @foreach (var raudur in bud.GetLoop("Item.List.Verslun.Raudir")) 340 { 341 DateTime day = (DateTime)raudur.GetValue("Item.List.Verslun.Raudir.Dagur"); 342 343 if (today.Date == day.Date) 344 { 345 specialOpen = raudur.GetString("Item.List.Verslun.Raudir.Opnunartimi").ToLower(); 346 specialClosed = raudur.GetString("Item.List.Verslun.Raudir.Lokunartimi").ToLower(); 347 break; 348 } 349 } 350 @{ 351 var OpenOrClosed = IsOpen(@item.GetString("Item.List.Verslun.List.Virkir_Dagar_Opnunartimi"), @item.GetString("Item.List.Verslun.List.Virkir_Dagar_Lokunartimi"), 352 @item.GetString("Item.List.Verslun.List.Laugardagur_Opnunartimi"), @item.GetString("Item.List.Verslun.List.Laugardagur_Lokunartimi"), 353 @item.GetString("Item.List.Verslun.List.Sunnudagur_Opnunartimi"), @item.GetString("Item.List.Verslun.List.Sunnudagur_Lokunartimi"), 354 @item.GetString("Item.List.Verslun.List.Virkir_Dagar_Hadegislokun"), @item.GetString("Item.List.Verslun.List.Virkir_Dagar_Hadegisopnun"), 355 specialOpen, specialClosed); 356 } 357 358 @if (specialOpen == "lokað" || specialClosed == "lokað") 359 { 360 <p class="open-closed"><span class="closed">Lokað</span></p> 361 } 362 else if (OpenOrClosed[0] == "lokað") 363 { 364 <p class="open-closed"><span class="closed">Lokað</span> @(OpenOrClosed[1] != "" && OpenOrClosed[1] != "lokað" ? OpenOrClosed[1] + " -" : "") @OpenOrClosed[2]</p> 365 } 366 else if (OpenOrClosed.Count() > 4) 367 { 368 // Ef það er lokað í hádeginu 369 <p class="open-closed cac"> 370 @if (OpenOrClosed[0] == "lokað") 371 { 372 <span class="closed">Lokað</span> 373 } 374 else 375 { 376 <span class="open">@OpenOrClosed[0]</span> 377 } 378 @OpenOrClosed[1] - @OpenOrClosed[2] <span class="second-opening">@OpenOrClosed[3] - @OpenOrClosed[4]</span> 379 </p> 380 } 381 else 382 { 383 <p class="open-closed"><span class="open">@OpenOrClosed[0]</span> @OpenOrClosed[1] - @OpenOrClosed[2]</p> 384 } 385 </div> 386 } 387 </a> 388 </div> 389 } 390 391 @if(showBorder) 392 { 393 <span class="alert-banner">@GetString("Item.Tilkynningarbordi")</span> 394 } 395 396 </span> 397 398 399 <!-- Mobile navbar --> 400 <span class="openinghours-mobile hidden"> 401 @foreach (var bud in GetLoop("Item.List")) 402 { 403 <li> 404 <a href="@bud.GetString("Item.List.Verslun.Linkur")" class="mobile-heading"> 405 @bud.GetString("Item.List.Verslun.Nafn") 406 407 @foreach (var item in bud.GetLoop("Item.List.Verslun.List")) 408 { 409 <div class="shopitem"> 410 411 <p class="shopaddress"> 412 @item.GetString("Item.List.Verslun.List.Heimilisfang_Budar.Value") 413 </p> 414 415 <!-- Opið eða lokað --> 416 <!-- Athuga hvort það sé rauður dagur --> 417 @{ 418 string specialOpen = ""; 419 string specialClosed = ""; 420 } 421 422 @foreach (var raudur in bud.GetLoop("Item.List.Verslun.Raudir")) 423 { 424 DateTime day = (DateTime)raudur.GetValue("Item.List.Verslun.Raudir.Dagur"); 425 426 if (today.Date == day.Date) 427 { 428 specialOpen = raudur.GetString("Item.List.Verslun.Raudir.Opnunartimi").ToLower(); 429 specialClosed = raudur.GetString("Item.List.Verslun.Raudir.Lokunartimi").ToLower(); 430 break; 431 } 432 } 433 434 @{ 435 var OpenOrClosed = IsOpen(@item.GetString("Item.List.Verslun.List.Virkir_Dagar_Opnunartimi"), @item.GetString("Item.List.Verslun.List.Virkir_Dagar_Lokunartimi"), 436 @item.GetString("Item.List.Verslun.List.Laugardagur_Opnunartimi"), @item.GetString("Item.List.Verslun.List.Laugardagur_Lokunartimi"), 437 @item.GetString("Item.List.Verslun.List.Sunnudagur_Opnunartimi"), @item.GetString("Item.List.Verslun.List.Sunnudagur_Lokunartimi"), 438 @item.GetString("Item.List.Verslun.List.Virkir_Dagar_Hadegislokun"), @item.GetString("Item.List.Verslun.List.Virkir_Dagar_Hadegisopnun"), 439 specialOpen, specialClosed); 440 } 441 442 @if (specialOpen == "lokað" || specialClosed == "lokað") 443 { 444 <p class="open-closed"><span class="closed">Lokað</span></p> 445 } 446 else if (OpenOrClosed[0] == "lokað") 447 { 448 <p class="open-closed"><span class="closed">Lokað</span> @(OpenOrClosed[1] != "" && OpenOrClosed[1] != "lokað" ? OpenOrClosed[1] + " -" : "") @OpenOrClosed[2]</p> 449 } 450 else if (OpenOrClosed.Count() > 4) 451 { 452 // Ef það er lokað í hádeginu 453 <p class="open-closed ma"> 454 @if (OpenOrClosed[0] == "lokað") 455 { 456 <span class="closed">Lokað</span> 457 } 458 else 459 { 460 <span class="open">@OpenOrClosed[0]</span> 461 } 462 @OpenOrClosed[1] - @OpenOrClosed[2] <span class="second-opening">@OpenOrClosed[3] - @OpenOrClosed[4]</span> 463 </p> 464 } 465 else 466 { 467 <p class="open-closed mc"><span class="open">@OpenOrClosed[0]</span> @OpenOrClosed[1] - @OpenOrClosed[2]</p> 468 } 469 </div> 470 } 471 </a> 472 </li> 473 } 474 </span> 475

Vefkökur

Velkomin í vefverslun Byko. Þessi síða notar vafrakökur (e. Cookies). Það er til þess að tryggja eðlilega virkni og notendaupplifun. Með því að halda áfram notkun síðunnar, samþykkir þú notkun vafrakaka.