Error executing template "Designs/Dwsimple/Paragraph/KalenderListe.cshtml"
System.Net.WebException: The remote server returned an error: (503) Server Unavailable.
   at System.Net.HttpWebRequest.GetResponse()
   at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
   at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   at System.Xml.XmlTextReaderImpl.FinishInitUriString()
   at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
   at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
   at CompiledRazorTemplates.Dynamic.RazorEngine_91d6c9f8be84470c823aba16a1f12872.<kasse>b__24_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Skovbodata\trekirker.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\Paragraph\KalenderListe.cshtml:line 1429
   at CompiledRazorTemplates.Dynamic.RazorEngine_91d6c9f8be84470c823aba16a1f12872.<kalendertype>b__19_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Skovbodata\trekirker.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\Paragraph\KalenderListe.cshtml:line 428
   at CompiledRazorTemplates.Dynamic.RazorEngine_91d6c9f8be84470c823aba16a1f12872.Execute() in D:\dynamicweb.net\Solutions\Skovbodata\trekirker.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\Paragraph\KalenderListe.cshtml:line 274
   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 @using System.Xml.Linq; 2 @using System.Text; 3 @using System.Globalization; 4 @using Dynamicweb.Forms; 5 @using System.Web; 6 @using Dynamicweb.Frontend; 7 8 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 9 @{ 10 init(); 11 } 12 13 @functions { 14 private int columnsWritten { get; set; } 15 private int columns { get; set; } 16 17 public void init() 18 { 19 columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); 20 columns = GetInteger("Item.Width"); 21 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); 22 } 23 24 public void Fluid() 25 { 26 columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); 27 columns = 12; 28 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; 29 } 30 31 public string ColumnClass() 32 { 33 if (GetString("Item.WidthMobile") == "hide"){ 34 return "col-md-" + GetString("Item.Width") + " hidden-xs"; 35 } else { 36 return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); 37 } 38 } 39 40 public string NewRow() 41 { 42 //return columns + " - " + columnsWritten + ">"; 43 44 if (columns + columnsWritten > 12) 45 { 46 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 47 //return "</div><div class=\"row\">"; 48 return "</div><div class=\"flex-container\">"; 49 } 50 else 51 { 52 return string.Empty; 53 } 54 55 } 56 57 public string NewRowParagraphExtended() 58 { 59 if (columns + columnsWritten > 12) 60 { 61 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 62 return "</div><div class=\"flex-container\">"; 63 } 64 else if (columnsWritten == 0) 65 { 66 return "<div class=\"flex-container \">"; 67 } 68 else 69 { 70 return string.Empty; 71 } 72 73 } 74 75 } 76 @using System.Text.RegularExpressions 77 @using System.Web 78 79 80 @functions{ 81 public class WrapMethods 82 { 83 //Gets the contrasting color 84 public static string getContrastYIQ(string hexcolor) 85 { 86 if (hexcolor != "") 87 { 88 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 89 90 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 91 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 92 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 93 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 94 95 if (yiq >= 128) 96 { 97 return "black"; 98 } 99 else 100 { 101 return "white"; 102 } 103 } 104 else 105 { 106 return "black"; 107 } 108 } 109 110 111 //Truncate text 112 public static string Truncate (string value, int count, bool strip=true) 113 { 114 if (strip == true){ 115 value = StripHtmlTagByCharArray(value); 116 } 117 118 if (value.Length > count) 119 { 120 value = value.Substring(0, count + 1) + "..."; 121 } 122 123 return value; 124 } 125 126 127 //Strip text from HTML 128 public static string StripHtmlTagByCharArray(string htmlString) 129 { 130 char[] array = new char[htmlString.Length]; 131 int arrayIndex = 0; 132 bool inside = false; 133 134 for (int i = 0; i < htmlString.Length; i++) 135 { 136 char let = htmlString[i]; 137 if (let == '<') 138 { 139 inside = true; 140 continue; 141 } 142 if (let == '>') 143 { 144 inside = false; 145 continue; 146 } 147 if (!inside) 148 { 149 array[arrayIndex] = let; 150 arrayIndex++; 151 } 152 } 153 return new string(array, 0, arrayIndex); 154 } 155 156 //Make the correct count of columns 157 public static string ColumnMaker(int Col, string ScreenSize) 158 { 159 string Columns = ""; 160 161 switch (Col) 162 { 163 case 1: 164 Columns = "col-"+ScreenSize+"-12"; 165 break; 166 167 case 2: 168 Columns = "col-"+ScreenSize+"-6"; 169 break; 170 171 case 3: 172 Columns = "col-"+ScreenSize+"-4"; 173 break; 174 175 case 4: 176 Columns = "col-"+ScreenSize+"-3"; 177 break; 178 179 default: 180 Columns = "col-"+ScreenSize+"-3"; 181 break; 182 } 183 184 return Columns; 185 } 186 187 188 private string Custom(string firstoption, string secondoption) 189 { 190 if (firstoption == "custom") 191 { 192 return secondoption; 193 } 194 else 195 { 196 return firstoption; 197 } 198 } 199 } 200 } 201 202 <script type="text/javascript" src="/Files/Templates/Designs/Dwsimple/js/pagination.js"></script> 203 <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script> 204 <script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script> 205 <script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js'></script> 206 <script src='https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.1/js/bootstrap-datepicker.min.js'></script> 207 @{ 208 209 210 <style> 211 212 .datobgcolor { 213 background-color: @GetString("Item.DatoBGColor.Color"); 214 } 215 216 </style> 217 } 218 219 @functions 220 { 221 222 string StartFormdate = HttpContext.Current.Request.Form["dato-start"]; 223 string StartQsdate = HttpContext.Current.Request.QueryString["startd"]; 224 string EndDate = ""; 225 string StartDate = ""; 226 } 227 228 229 @NewRowParagraphExtended() 230 231 <div class="@ColumnClass() dist2nxtblk"> 232 233 @if (@GetString("Item.EqualContentHeight")=="True") 234 { 235 <text> 236 <div class="@GetString("Item.ContentStyle") Special-Col-Style Special-Col-height" style="background-color: @GetString("Item.BackgroundColor.Color")"> 237 </text> 238 } 239 else 240 { 241 <text> 242 <div class="@GetString("Item.ContentStyle") Special-Col-Style" style="background-color: @GetString("Item.BackgroundColor.Color")"> 243 </text> 244 245 } 246 247 @if (GetString("Item.Order") == "title-first" || GetString("Item.Order") == "") 248 { 249 string plac=GetString("Item.TitlePlacement"); 250 251 if (plac=="") 252 { 253 plac="left"; 254 } 255 256 if (GetBoolean("Item.VisTitel") != false){ 257 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 258 <h1 class="dw-section-title" style="text-align: @plac"> 259 <span>@GetString("Item.Titel")</span> 260 </h1> 261 <br> 262 } 263 } else { 264 <h1 class="dw-section-title" style="text-align: @plac"><span></span></h1> 265 } 266 267 268 @RenderImage() 269 270 if (GetBoolean("Item.CalendarSearch") != false){ 271 @daterange()<!-- @daterange() --> 272 } 273 274 @kalendertype() 275 } 276 277 @if (GetString("Item.Order") == "image-first") 278 { 279 string plac=GetString("Item.TitlePlacement"); 280 281 if (plac=="") 282 { 283 plac="left"; 284 } 285 286 @RenderImage() 287 if (GetBoolean("Item.VisTitel") != false){ 288 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 289 <h1 class="dw-section-title" style="text-align: @plac"> 290 <span>@GetString("Item.Titel")</span> 291 </h1> 292 <br> 293 } 294 } else { 295 <h1 class="dw-section-title" style="text-align: @plac"><span></span></h1> 296 } 297 298 299 @kalendertype() 300 } 301 302 303 304 @if (GetString("Item.Order") == "icon-xs") 305 { 306 307 string plac=GetString("Item.TitlePlacement"); 308 309 if (plac=="") 310 { 311 plac="left"; 312 } 313 314 <div class="col-md-2"> 315 @RenderImage() 316 </div> 317 318 <div class="col-md-10"> 319 @if (GetBoolean("Item.VisTitel") != false){ 320 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 321 <h1 class="dw-section-title" style="text-align: @plac"> 322 <span>@GetString("Item.Titel")</span> 323 </h1> 324 <br> 325 } 326 } else { 327 <h1 class="dw-section-title" style="text-align: @plac"><span></span></h1> 328 } 329 330 331 </div> 332 @kalendertype() 333 } 334 335 @if (GetString("Item.Order") == "icon-sm") 336 { 337 338 string plac=GetString("Item.TitlePlacement"); 339 340 if (plac=="") 341 { 342 plac="left"; 343 } 344 345 <div class="col-md-3"> 346 @RenderImage() 347 </div> 348 349 <div class="col-md-9"> 350 @if (GetBoolean("Item.VisTitel") != false){ 351 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 352 <h1 class="dw-section-title" style="text-align: @plac"> 353 <span>@GetString("Item.Titel")</span> 354 <br> 355 </h1> 356 <br> 357 } 358 } else { 359 <h1 class="dw-section-title" style="text-align: @plac"><span></span></h1> 360 } 361 </div> 362 @kalendertype() 363 } 364 365 @if (GetString("Item.Order") == "icon-md") 366 { 367 368 string plac=GetString("Item.TitlePlacement"); 369 370 if (plac=="") 371 { 372 plac="left"; 373 } 374 375 <div class="col-md-4"> 376 @RenderImage() 377 </div> 378 379 <div class="col-md-8"> 380 @if (GetBoolean("Item.VisTitel") != false){ 381 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 382 <h1 class="dw-section-title" style="text-align: @plac"> 383 <span>@GetString("Item.Titel")</span> 384 </h1> 385 <br> 386 } 387 } else { 388 <h1 class="dw-section-title" style="text-align: @plac"><span></span></h1> 389 } 390 391 </div> 392 @kalendertype() 393 } 394 </div> 395 </div> 396 397 @helper daterange(){ 398 399 string pathx=""; 400 <script type="text/javascript">@pathx = window.location.href.split('?')[0] + "/?Purge=True"</script> 401 402 <form method="post" action="@pathx" id="myForm" name="myForm"> 403 <table> 404 <tr> 405 <td><input type="text" id="dato-start" name="dato-start" class="start-date form-control ic-input-small" placeholder="Dato fra" value="" ></td> 406 <td><input type="text" id="dato-slut" name="dato-slut" class="end-date form-control ic-input-small" placeholder="Dato til" value=""></td> 407 <td><button type="submit" class="btn btn-primary fa fa-search ic-button"></button></td> 408 </tr> 409 </table> 410 <br> 411 </form> 412 413 <script type="text/javascript" src="/Files/Templates/Designs/Dwsimple/js/DateRange.js"></script> 414 } 415 416 @helper kalendertype(){ 417 if (@GetString("Item.LayoutMode") == "ballon") { 418 @Ballon() 419 } 420 421 if (@GetString("Item.LayoutMode") == "list") { 422 <p class="list-item-info nomargin">(Tryk på aktiviten for at se detaljer)</p><p></p> 423 424 @List() 425 } 426 427 if (@GetString("Item.LayoutMode") == "kasse") { 428 @kasse() 429 } 430 431 if (@GetString("Item.LayoutMode") == "kompliste") { 432 @kompliste() 433 } 434 435 if (@GetString("Item.LayoutMode") == "billeder") { 436 @Billeder() 437 } 438 } 439 440 @helper Billeder(){ 441 <ul class="list-listings blog-list"> 442 <div class="calendar-view u-flex u-justify-content-center"> 443 <div class="ui link items ui-width"> 444 @{ 445 string sognekode = GetString("Item.Sognekode"); 446 string kalenderkonto = GetString("Item.AccountNumber"); 447 String Limit = int.Parse(GetString("Item.Days"), NumberStyles.AllowThousands).ToString(); 448 449 int StartSide = 1; 450 451 if(string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-start"]) || string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-slut"])){ 452 StartSide = Convert.ToInt32(HttpContext.Current.Request.QueryString["PageNum"]); 453 } 454 455 if (GetBoolean("Item.StartDateNow") == false){ 456 EndDate = GetDate("Item.Start_Dato").AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 457 } 458 459 460 if(DateTime.Now.ToString("dd/MM/yyyy") == HttpContext.Current.Request.QueryString["startd"]){ 461 462 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 463 464 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["startd"])){ 465 466 StartDate=HttpContext.Current.Request.QueryString["startd"]; 467 468 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-start"])){ 469 470 StartDate=HttpContext.Current.Request.Form["dato-start"]; 471 472 }else{ 473 474 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 475 476 } 477 478 if (StartDate!=DateTime.Now.ToString("dd/MM/yyyy")){ 479 480 <script type="text/javascript">document.getElementById("dato-start").value = "@StartDate"</script> 481 } 482 483 if (!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-slut"])){ 484 EndDate=HttpContext.Current.Request.Form["dato-slut"]; 485 }else{ 486 EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 487 } 488 489 if (EndDate!=DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy")){ 490 491 <script type="text/javascript">document.getElementById("dato-slut").value = "@EndDate"</script> 492 } 493 494 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+kalenderkonto+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate+"&InSognekode="+sognekode; 495 496 if (GetString("Item.Show.Filter") != "alle"){ 497 linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); 498 } 499 500 int tael=0; 501 int antalRecs=1; 502 int rk=1; 503 int skiprecs = 0; 504 505 skiprecs=(StartSide-1)*int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 506 507 XDocument xdoc = XDocument.Load(linkstring); 508 var elements = xdoc.Element("DATA").Elements("AFTALE"); 509 510 foreach (var el in elements.Skip(skiprecs)) 511 { 512 string id = "0"; 513 string type = "alle"; 514 DateTime date; 515 string title = "Title"; 516 string description = "Description"; 517 string fulldate = "Date"; 518 string cleanDate = ""; 519 string day = ""; 520 string month = ""; 521 string location = ""; 522 string document = GetString("Item.StdImage"); 523 string document_type = "OFFENTLIGT_AFTALE_BILLEDE"; 524 525 526 antalRecs=int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 527 528 529 530 switch (GetString("Item.Width")){ 531 case "12": 532 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 533 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 534 }else{ 535 rk = 15; 536 } 537 break; 538 case "9": 539 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 540 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 541 }else{ 542 rk = 15; 543 } 544 break; 545 case "6": 546 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 10){ 547 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 548 }else{ 549 rk = 10; 550 } 551 break; 552 case "3": 553 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 554 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 555 }else{ 556 rk = 5; 557 } 558 break; 559 case "8": 560 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 561 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 562 }else{ 563 rk = 15; 564 } 565 break; 566 case "4": 567 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 568 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 569 }else{ 570 rk = 5; 571 } 572 break; 573 } 574 575 tael+=1; 576 577 if (tael > antalRecs){ 578 break; 579 } 580 581 if (el.Elements("ID").Any()){ 582 id = el.Element("ID").Value; 583 } 584 585 if (el.Elements("AFTALETYPE").Any()){ 586 type = el.Element("AFTALETYPE").Value; 587 } 588 589 if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { 590 date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); 591 cleanDate = date.ToString("dddd 'd.' d. MMMM kl. HH:mm", new CultureInfo("da-DK")); 592 day = date.ToString(" d", new CultureInfo("da-DK")); 593 month = date.ToString("MMM", new CultureInfo("da-DK")); 594 } 595 596 if (el.Elements("OVERSKRIFT").Any()){ 597 title = el.Element("OVERSKRIFT").Value; 598 } 599 600 if (el.Elements("BESKRIVELSE").Any()){ 601 description = el.Element("BESKRIVELSE").Value; 602 } 603 604 if (el.Elements("DATO_FORMATERET").Any()){ 605 fulldate = el.Element("DATO_FORMATERET").Value; 606 } 607 608 if (el.Elements("STED").Any()){ 609 location = el.Element("STED").Value; 610 } 611 612 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ 613 document = "https://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; 614 } 615 616 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ 617 document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; 618 } 619 620 <a class="item u-align-items-center page-1 row-1 " id="node-10075788" href="Kalenderaftale?kalenderkonto=@kalenderkonto&aftaleid=@id" style="display: flex;"> 621 622 <div class="ui medium image"> 623 624 @if (document != ""){ 625 if (document_type == "OFFENTLIGT_AFTALE_BILLEDE"){ 626 <img class="img-responsive" src="@document" alt="" id="@(id)_img" style="max-height: 200px; float:right; position: relative;"></img> 627 }else{ 628 <img class="img-responsive" src="@GetString("Item.StdImage")" alt="" id="@(id)_img" style="max-height: 200px; float:right; position: relative;"></img> 629 } 630 } 631 632 <div class="blockdate" style="background-color: @GetString("Item.DatoBGColor.Color")"> 633 <div class="ui header"> 634 <div class="date__day">@day</div> 635 <div class="sub header">@month</div> 636 </div> 637 </div> 638 </div> 639 640 <div class="ic-textelm"> 641 642 <span class="ic-heading">@title</span> 643 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @cleanDate</p> 644 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> 645 @if (!string.IsNullOrEmpty(description)) 646 { 647 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-bookmark"></i> @WrapMethods.Truncate(description, int.Parse(TruncateLength()))</p> 648 } 649 </div> 650 </a> 651 } 652 } 653 </div> 654 </div> 655 </ul> 656 657 if (GetBoolean("Item.Pagination") != false){ 658 659 string OrigUrl=@GetGlobalValue("Global:Pageview.Url"); 660 string[] urlSplit = OrigUrl.Split('?'); 661 662 <!-- Find side indeling --> 663 @RenderPagination(@urlSplit[0] + "?Purge=True", @rk, @StartSide, @StartDate, @EndDate) 664 } 665 } 666 667 @helper Ballon(){ 668 <ul class="list-listings blog-list"> 669 <div class="calendar-view u-flex u-justify-content-center"> 670 <div class="ui link items ui-width"> 671 @{ 672 string sognekode = GetString("Item.Sognekode"); 673 string kalenderkonto = GetString("Item.AccountNumber"); 674 String Limit = int.Parse(GetString("Item.Days"), NumberStyles.AllowThousands).ToString(); 675 676 int StartSide = 1; 677 678 if(string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-start"]) || string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-slut"])){ 679 StartSide = Convert.ToInt32(HttpContext.Current.Request.QueryString["PageNum"]); 680 } 681 682 if (GetBoolean("Item.StartDateNow") == false){ 683 EndDate = GetDate("Item.Start_Dato").AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 684 } 685 686 687 if(DateTime.Now.ToString("dd/MM/yyyy") == HttpContext.Current.Request.QueryString["startd"]){ 688 689 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 690 691 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["startd"])){ 692 693 StartDate=HttpContext.Current.Request.QueryString["startd"]; 694 695 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-start"])){ 696 697 StartDate=HttpContext.Current.Request.Form["dato-start"]; 698 699 }else{ 700 701 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 702 703 } 704 705 if (StartDate!=DateTime.Now.ToString("dd/MM/yyyy")){ 706 707 <script type="text/javascript">document.getElementById("dato-start").value = "@StartDate"</script> 708 } 709 710 if (!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-slut"])){ 711 EndDate=HttpContext.Current.Request.Form["dato-slut"]; 712 }else{ 713 EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 714 } 715 716 if (EndDate!=DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy")){ 717 718 <script type="text/javascript">document.getElementById("dato-slut").value = "@EndDate"</script> 719 } 720 721 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+kalenderkonto+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate+"&InSognekode="+sognekode; 722 723 if (GetString("Item.Show.Filter") != "alle"){ 724 linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); 725 } 726 727 int tael=0; 728 int antalRecs=1; 729 int rk=1; 730 int skiprecs = 0; 731 732 skiprecs=(StartSide-1)*int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 733 734 XDocument xdoc = XDocument.Load(linkstring); 735 var elements = xdoc.Element("DATA").Elements("AFTALE"); 736 737 foreach (var el in elements.Skip(skiprecs)) 738 { 739 string id = "0"; 740 string type = "alle"; 741 DateTime date; 742 string title = "Title"; 743 string description = "Description"; 744 string fulldate = "Date"; 745 string cleanDate = ""; 746 string day = ""; 747 string month = ""; 748 string location = ""; 749 string document = GetString("Item.StdImage"); 750 string document_type = "OFFENTLIGT_AFTALE_BILLEDE"; 751 string ShowInfo = "Closed"; 752 antalRecs=int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 753 string filnavn= ""; 754 Dictionary<string, string> domains = new Dictionary<string, string>(); 755 756 757 758 switch (GetString("Item.Width")){ 759 case "12": 760 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 761 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 762 }else{ 763 rk = 15; 764 } 765 break; 766 case "9": 767 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 768 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 769 }else{ 770 rk = 15; 771 } 772 break; 773 case "6": 774 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 10){ 775 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 776 }else{ 777 rk = 10; 778 } 779 break; 780 case "3": 781 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 782 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 783 }else{ 784 rk = 5; 785 } 786 break; 787 case "8": 788 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 789 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 790 }else{ 791 rk = 15; 792 } 793 break; 794 case "4": 795 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 796 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 797 }else{ 798 rk = 5; 799 } 800 break; 801 } 802 803 tael+=1; 804 805 if (tael > antalRecs){ 806 break; 807 } 808 809 if (el.Elements("ID").Any()){ 810 id = el.Element("ID").Value; 811 } 812 813 if (el.Elements("AFTALETYPE").Any()){ 814 type = el.Element("AFTALETYPE").Value; 815 } 816 817 if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { 818 date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); 819 cleanDate = date.ToString("dddd 'd.' d. MMMM kl. HH:mm", new CultureInfo("da-DK")); 820 day = date.ToString(" d", new CultureInfo("da-DK")); 821 month = date.ToString("MMM", new CultureInfo("da-DK")); 822 } 823 824 if (el.Elements("OVERSKRIFT").Any()){ 825 title = el.Element("OVERSKRIFT").Value; 826 } 827 828 if (el.Elements("BESKRIVELSE").Any()){ 829 description = el.Element("BESKRIVELSE").Value; 830 } 831 832 if (el.Elements("DATO_FORMATERET").Any()){ 833 fulldate = el.Element("DATO_FORMATERET").Value; 834 } 835 836 if (el.Elements("STED").Any()){ 837 location = el.Element("STED").Value; 838 } 839 840 841 842 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ 843 document = "https://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; 844 } 845 846 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ 847 document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; 848 } 849 <!-- 850 IEnumerable<XElement> allGrandChildren = from elx in elements.Elements("OFFENTLIGE_DOKUMENTER").Elements() select elx; 851 foreach (XElement elx in allGrandChildren){ 852 853 document = "https://kalender.brandsoft.dk/bska/" + elx.Element("URL").Value; 854 filnavn=elx.Element("ORG_FILNAVN").Value; 855 856 if (document_type == "OFFENTLIGT_DOKUMENT"){ 857 domains.Add(@filnavn, @document); 858 } 859 860 } 861 862 --> 863 864 <a href="javascript:void(0);" onclick="toggle_visibility('@id');"> 865 866 <div class="row"> 867 <div class="media col-md-12"> 868 <div class="media-left"> 869 <div class="media-object calendar-date text-center" style="background-color: @GetString("Item.DatoBGColor.Color")"><span>@day</span> @month</div> 870 871 </div> 872 <div class="media-body"> 873 <h2 class="ic-heading">@title</h2> 874 <p class="ic-list-item-info">@type</p> 875 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @cleanDate</p> 876 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> 877 878 @{ 879 string isHidden = ""; 880 if (ShowInfo == "Closed" || ShowInfo == "Hidden"){ 881 isHidden = "style=\"display:none;\""; 882 } 883 } 884 885 <div id="@id" @isHidden> 886 <p>@description</p> 887 </div> 888 889 890 </div> 891 892 <div class="media-right" style="width: 33%;"> 893 @if (document != ""){ 894 if (document_type == "OFFENTLIGT_AFTALE_BILLEDE"){ 895 <img class="img-responsive" src="@document" alt="" id="@(id)_img" style="max-height: 100px; float:right; position: relative;"></img> 896 } 897 } 898 </div> 899 900 </div> 901 @if (domains.Count>0) { 902 <p style="font-weight: 700; margin-bottom: -3px">Dokumenter til download:</p> 903 <br> 904 905 foreach (KeyValuePair<string, string> kvp in domains){ 906 <div class="pull-left"> 907 <a href="@kvp.Value" class="btn btn-info pull-right" download>@kvp.Key</a> 908 </div> 909 <br><br><br> 910 } 911 } 912 913 @if (!string.IsNullOrWhiteSpace(description) || !string.IsNullOrWhiteSpace(document)){ 914 if (ShowInfo == "Open"){ 915 <p id="@(id)_chevron" class="text-center chevron"></p> 916 } else if (ShowInfo == "Closed") { 917 <p id="@(id)_chevron" class="text-center chevron bottom"></p> 918 } 919 } 920 </div> 921 </a> 922 <hr> 923 924 925 } 926 } 927 </ul> 928 929 if (GetBoolean("Item.Pagination") != false){ 930 931 string OrigUrl=@GetGlobalValue("Global:Pageview.Url"); 932 string[] urlSplit = OrigUrl.Split('?'); 933 934 <!-- Find side indeling --> 935 @RenderPagination(@urlSplit[0] + "?Purge=True", @rk, @StartSide, @StartDate, @EndDate) 936 } 937 } 938 939 @helper List(){ 940 <ul class="list-listings blog-list"> 941 <div class="calendar-view u-flex u-justify-content-center"> 942 <div class="ui link items ui-width"> 943 @{ 944 string sognekode = GetString("Item.Sognekode"); 945 string kalenderkonto = GetString("Item.AccountNumber"); 946 String Limit = int.Parse(GetString("Item.Days"), NumberStyles.AllowThousands).ToString(); 947 948 int StartSide = 1; 949 950 if(string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-start"]) || string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-slut"])){ 951 StartSide = Convert.ToInt32(HttpContext.Current.Request.QueryString["PageNum"]); 952 } 953 954 if (GetBoolean("Item.StartDateNow") == false){ 955 EndDate = GetDate("Item.Start_Dato").AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 956 } 957 958 959 if(DateTime.Now.ToString("dd/MM/yyyy") == HttpContext.Current.Request.QueryString["startd"]){ 960 961 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 962 963 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["startd"])){ 964 965 StartDate=HttpContext.Current.Request.QueryString["startd"]; 966 967 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-start"])){ 968 969 StartDate=HttpContext.Current.Request.Form["dato-start"]; 970 971 }else{ 972 973 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 974 975 } 976 977 if (StartDate!=DateTime.Now.ToString("dd/MM/yyyy")){ 978 979 <script type="text/javascript">document.getElementById("dato-start").value = "@StartDate"</script> 980 } 981 982 if (!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-slut"])){ 983 EndDate=HttpContext.Current.Request.Form["dato-slut"]; 984 }else{ 985 EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 986 } 987 988 if (EndDate!=DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy")){ 989 990 <script type="text/javascript">document.getElementById("dato-slut").value = "@EndDate"</script> 991 } 992 993 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+kalenderkonto+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate+"&InSognekode="+sognekode; 994 995 if (GetString("Item.Show.Filter") != "alle"){ 996 linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); 997 } 998 999 int tael=0; 1000 int antalRecs=1; 1001 int rk=1; 1002 int skiprecs = 0; 1003 skiprecs=(StartSide-1)*int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 1004 1005 XDocument xdoc = XDocument.Load(linkstring); 1006 var elements = xdoc.Element("DATA").Elements("AFTALE"); 1007 1008 foreach (var el in elements.Skip(skiprecs)) 1009 { 1010 string id = "0"; 1011 string type = "alle"; 1012 DateTime date; 1013 string title = "Title"; 1014 string description = "Description"; 1015 string fulldate = "Date"; 1016 string cleanDate = ""; 1017 string day = ""; 1018 string month = ""; 1019 string location = ""; 1020 string document = GetString("Item.StdImage"); 1021 string document_type = "OFFENTLIGT_AFTALE_BILLEDE"; 1022 string ShowInfo = "Closed"; 1023 antalRecs=int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 1024 1025 switch (GetString("Item.Width")){ 1026 case "12": 1027 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 1028 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1029 }else{ 1030 rk = 15; 1031 } 1032 break; 1033 case "9": 1034 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 1035 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1036 }else{ 1037 rk = 15; 1038 } 1039 break; 1040 case "6": 1041 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 10){ 1042 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1043 }else{ 1044 rk = 10; 1045 } 1046 break; 1047 case "3": 1048 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 1049 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1050 }else{ 1051 rk = 5; 1052 } 1053 break; 1054 case "8": 1055 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 1056 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1057 }else{ 1058 rk = 15; 1059 } 1060 break; 1061 case "4": 1062 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 1063 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1064 }else{ 1065 rk = 5; 1066 } 1067 break; 1068 } 1069 1070 tael+=1; 1071 1072 if (tael > antalRecs){ 1073 break; 1074 } 1075 1076 if (el.Elements("ID").Any()){ 1077 id = el.Element("ID").Value; 1078 } 1079 1080 if (el.Elements("AFTALETYPE").Any()){ 1081 type = el.Element("AFTALETYPE").Value; 1082 } 1083 1084 if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { 1085 date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); 1086 cleanDate = date.ToString("dddd 'd.' d. MMMM kl. HH:mm", new CultureInfo("da-DK")); 1087 day = date.ToString(" d", new CultureInfo("da-DK")); 1088 month = date.ToString("MMM", new CultureInfo("da-DK")); 1089 } 1090 1091 if (el.Elements("OVERSKRIFT").Any()){ 1092 title = el.Element("OVERSKRIFT").Value; 1093 } 1094 1095 if (el.Elements("BESKRIVELSE").Any()){ 1096 description = el.Element("BESKRIVELSE").Value; 1097 } 1098 1099 if (el.Elements("DATO_FORMATERET").Any()){ 1100 fulldate = el.Element("DATO_FORMATERET").Value; 1101 } 1102 1103 if (el.Elements("STED").Any()){ 1104 location = el.Element("STED").Value; 1105 } 1106 1107 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ 1108 document = "https://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; 1109 } 1110 1111 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ 1112 document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; 1113 } 1114 1115 if(GetBoolean("Item.Linjeopdeling")==true){ 1116 <hr> 1117 } 1118 1119 <a href="Kalenderaftale?kalenderkonto=@kalenderkonto&aftaleid=@id" data-toggle="tooltip" data-placement="right" data-html="true" title="@title &#013; &#013Beskrivelse: &#013;@description &#013; &#013;@fulldate"> 1120 <div class="row"> 1121 <div class="media col-md-12"> 1122 <div class="media-body"> 1123 1124 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @cleanDate</p> 1125 <h2 class="ic-heading">@title</h2> 1126 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> 1127 1128 </div> 1129 </div> 1130 </div> 1131 </a> 1132 } 1133 } 1134 </ul> 1135 1136 if(GetBoolean("Item.Linjeopdeling")==true){ 1137 <hr> 1138 } 1139 1140 if (GetBoolean("Item.Pagination") != false){ 1141 1142 string OrigUrl=@GetGlobalValue("Global:Pageview.Url"); 1143 string[] urlSplit = OrigUrl.Split('?'); 1144 1145 <!-- Find side indeling --> 1146 @RenderPagination(@urlSplit[0] + "?Purge=True", @rk, @StartSide, @StartDate, @EndDate) 1147 } 1148 } 1149 1150 @helper kompliste(){ 1151 <ul class="list-listings blog-list"> 1152 <div class="calendar-view u-flex u-justify-content-center"> 1153 <div class="ui link items ui-width"> 1154 @{ 1155 string sognekode = GetString("Item.Sognekode"); 1156 string kalenderkonto = GetString("Item.AccountNumber"); 1157 String Limit = int.Parse(GetString("Item.Days"), NumberStyles.AllowThousands).ToString(); 1158 1159 int StartSide = 1; 1160 1161 if(string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-start"]) || string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-slut"])){ 1162 StartSide = Convert.ToInt32(HttpContext.Current.Request.QueryString["PageNum"]); 1163 } 1164 1165 if (GetBoolean("Item.StartDateNow") == false){ 1166 EndDate = GetDate("Item.Start_Dato").AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 1167 } 1168 1169 1170 if(DateTime.Now.ToString("dd/MM/yyyy") == HttpContext.Current.Request.QueryString["startd"]){ 1171 1172 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 1173 1174 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["startd"])){ 1175 1176 StartDate=HttpContext.Current.Request.QueryString["startd"]; 1177 1178 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-start"])){ 1179 1180 StartDate=HttpContext.Current.Request.Form["dato-start"]; 1181 1182 }else{ 1183 1184 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 1185 1186 } 1187 1188 if (StartDate!=DateTime.Now.ToString("dd/MM/yyyy")){ 1189 1190 <script type="text/javascript">document.getElementById("dato-start").value = "@StartDate"</script> 1191 } 1192 1193 if (!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-slut"])){ 1194 EndDate=HttpContext.Current.Request.Form["dato-slut"]; 1195 }else{ 1196 EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 1197 } 1198 1199 if (EndDate!=DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy")){ 1200 1201 <script type="text/javascript">document.getElementById("dato-slut").value = "@EndDate"</script> 1202 } 1203 1204 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+kalenderkonto+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate+"&InSognekode="+sognekode; 1205 1206 if (GetString("Item.Show.Filter") != "alle"){ 1207 linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); 1208 } 1209 1210 int tael=0; 1211 int antalRecs=1; 1212 int rk=1; 1213 int skiprecs = 0; 1214 skiprecs=(StartSide-1)*int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 1215 1216 XDocument xdoc = XDocument.Load(linkstring); 1217 var elements = xdoc.Element("DATA").Elements("AFTALE"); 1218 1219 foreach (var el in elements.Skip(skiprecs)) 1220 { 1221 string id = "0"; 1222 string type = "alle"; 1223 DateTime date; 1224 string title = "Title"; 1225 string description = "Description"; 1226 string fulldate = "Date"; 1227 string cleanDate = ""; 1228 string day = ""; 1229 string month = ""; 1230 string location = ""; 1231 string document = GetString("Item.StdImage"); 1232 string document_type = "OFFENTLIGT_AFTALE_BILLEDE"; 1233 string ShowInfo = "Closed"; 1234 antalRecs=int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 1235 1236 switch (GetString("Item.Width")){ 1237 case "12": 1238 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 1239 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1240 }else{ 1241 rk = 15; 1242 } 1243 break; 1244 case "9": 1245 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 1246 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1247 }else{ 1248 rk = 15; 1249 } 1250 break; 1251 case "6": 1252 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 10){ 1253 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1254 }else{ 1255 rk = 10; 1256 } 1257 break; 1258 case "3": 1259 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 1260 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1261 }else{ 1262 rk = 5; 1263 } 1264 break; 1265 case "8": 1266 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 1267 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1268 }else{ 1269 rk = 15; 1270 } 1271 break; 1272 case "4": 1273 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 1274 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1275 }else{ 1276 rk = 5; 1277 } 1278 break; 1279 } 1280 1281 tael+=1; 1282 1283 if (tael > antalRecs){ 1284 break; 1285 } 1286 1287 if (el.Elements("ID").Any()){ 1288 id = el.Element("ID").Value; 1289 } 1290 1291 if (el.Elements("AFTALETYPE").Any()){ 1292 type = el.Element("AFTALETYPE").Value; 1293 } 1294 1295 if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { 1296 date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); 1297 cleanDate = date.ToString("dddd 'd.' d. MMMM kl. HH:mm", new CultureInfo("da-DK")); 1298 day = date.ToString(" d", new CultureInfo("da-DK")); 1299 month = date.ToString("MMM", new CultureInfo("da-DK")); 1300 } 1301 1302 if (el.Elements("OVERSKRIFT").Any()){ 1303 title = el.Element("OVERSKRIFT").Value; 1304 } 1305 1306 if (el.Elements("BESKRIVELSE").Any()){ 1307 description = el.Element("BESKRIVELSE").Value; 1308 } 1309 1310 if (el.Elements("DATO_FORMATERET").Any()){ 1311 fulldate = el.Element("DATO_FORMATERET").Value; 1312 } 1313 1314 if (el.Elements("STED").Any()){ 1315 location = el.Element("STED").Value; 1316 } 1317 1318 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ 1319 document = "https://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; 1320 } 1321 1322 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ 1323 document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; 1324 } 1325 1326 if(GetBoolean("Item.Linjeopdeling")==true){ 1327 <hr> 1328 } 1329 1330 if(GetBoolean("Item.Listeopdeling")==true){ 1331 <hr> 1332 } 1333 1334 <a href="Kalenderaftale?kalenderkonto=@kalenderkonto&aftaleid=@id" data-toggle="tooltip" data-placement="right" data-html="true" title="@title &#013; &#013Beskrivelse: &#013;@description &#013; &#013;@fulldate"> 1335 <div class="row"> 1336 <div class="media col-md-12"> 1337 <div class="media-body"> 1338 1339 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @cleanDate</p> 1340 <h2 class="ic-heading">@title</h2> 1341 <p class="ic-list-item-info nomargin">@description</p> 1342 1343 </div> 1344 </div> 1345 </div> 1346 </a> 1347 } 1348 } 1349 </ul> 1350 1351 if(GetBoolean("Item.Listeopdeling")==true){ 1352 <hr> 1353 } 1354 1355 if (GetBoolean("Item.Pagination") != false){ 1356 1357 string OrigUrl=@GetGlobalValue("Global:Pageview.Url"); 1358 string[] urlSplit = OrigUrl.Split('?'); 1359 1360 <!-- Find side indeling --> 1361 @RenderPagination(@urlSplit[0] + "?Purge=True", @rk, @StartSide, @StartDate, @EndDate) 1362 } 1363 } 1364 1365 @helper kasse(){ 1366 <div class="sqcalendar"> 1367 @{ 1368 string sognekode = GetString("Item.Sognekode"); 1369 string kalenderkonto = GetString("Item.AccountNumber"); 1370 String Limit = int.Parse(GetString("Item.Days"), NumberStyles.AllowThousands).ToString(); 1371 1372 int StartSide = 1; 1373 1374 if(string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-start"]) || string.IsNullOrEmpty(@HttpContext.Current.Request.Form["dato-slut"])){ 1375 StartSide = Convert.ToInt32(HttpContext.Current.Request.QueryString["PageNum"]); 1376 } 1377 1378 if (GetBoolean("Item.StartDateNow") == false){ 1379 EndDate = GetDate("Item.Start_Dato").AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 1380 } 1381 1382 1383 if(DateTime.Now.ToString("dd/MM/yyyy") == HttpContext.Current.Request.QueryString["startd"]){ 1384 1385 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 1386 1387 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["startd"])){ 1388 1389 StartDate=HttpContext.Current.Request.QueryString["startd"]; 1390 1391 }else if(!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-start"])){ 1392 1393 StartDate=HttpContext.Current.Request.Form["dato-start"]; 1394 1395 }else{ 1396 1397 StartDate=DateTime.Now.ToString("dd/MM/yyyy"); 1398 1399 } 1400 1401 if (StartDate!=DateTime.Now.ToString("dd/MM/yyyy")){ 1402 1403 <script type="text/javascript">document.getElementById("dato-start").value = "@StartDate"</script> 1404 } 1405 1406 if (!string.IsNullOrEmpty(HttpContext.Current.Request.Form["dato-slut"])){ 1407 EndDate=HttpContext.Current.Request.Form["dato-slut"]; 1408 }else{ 1409 EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy"); 1410 } 1411 1412 if (EndDate!=DateTime.Now.AddDays(GetInteger("Item.Days")).ToString("dd/MM/yyyy")){ 1413 1414 <script type="text/javascript">document.getElementById("dato-slut").value = "@EndDate"</script> 1415 } 1416 1417 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+kalenderkonto+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate+"&InSognekode="+sognekode; 1418 1419 if (GetString("Item.Show.Filter") != "alle"){ 1420 linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); 1421 } 1422 1423 int tael=0; 1424 int antalRecs=1; 1425 int rk=1; 1426 int skiprecs = 0; 1427 skiprecs=(StartSide-1)*int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 1428 1429 XDocument xdoc = XDocument.Load(linkstring); 1430 var elements = xdoc.Element("DATA").Elements("AFTALE"); 1431 1432 foreach (var el in elements.Skip(skiprecs)) 1433 { 1434 string id = "0"; 1435 string type = "alle"; 1436 DateTime date; 1437 string title = "Title"; 1438 string description = "Description"; 1439 string fulldate = "Date"; 1440 string cleanDate = ""; 1441 string day = ""; 1442 string month = ""; 1443 string location = ""; 1444 string document = GetString("Item.StdImage"); 1445 string document_type = "OFFENTLIGT_AFTALE_BILLEDE"; 1446 string ShowInfo = "Closed"; 1447 antalRecs=int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands); 1448 1449 switch (GetString("Item.Width")){ 1450 case "12": 1451 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 1452 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1453 }else{ 1454 rk = 15; 1455 } 1456 break; 1457 case "9": 1458 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 1459 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1460 }else{ 1461 rk = 15; 1462 } 1463 break; 1464 case "6": 1465 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 10){ 1466 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1467 }else{ 1468 rk = 10; 1469 } 1470 break; 1471 case "3": 1472 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 1473 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1474 }else{ 1475 rk = 5; 1476 } 1477 break; 1478 case "8": 1479 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 15){ 1480 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1481 }else{ 1482 rk = 15; 1483 } 1484 break; 1485 case "4": 1486 if (elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs) < 5){ 1487 rk=elements.Count()/antalRecs+ Math.Sign(elements.Count() % antalRecs); 1488 }else{ 1489 rk = 5; 1490 } 1491 break; 1492 } 1493 1494 tael+=1; 1495 1496 if (tael > antalRecs){ 1497 break; 1498 } 1499 1500 if (el.Elements("ID").Any()){ 1501 id = el.Element("ID").Value; 1502 } 1503 1504 if (el.Elements("AFTALETYPE").Any()){ 1505 type = el.Element("AFTALETYPE").Value; 1506 } 1507 1508 if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { 1509 date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); 1510 cleanDate = date.ToString("dddd 'd.' d. MMMM kl. HH:mm", new CultureInfo("da-DK")); 1511 day = date.ToString(" d", new CultureInfo("da-DK")); 1512 month = date.ToString("MMM", new CultureInfo("da-DK")); 1513 } 1514 1515 if (el.Elements("OVERSKRIFT").Any()){ 1516 title = el.Element("OVERSKRIFT").Value; 1517 } 1518 1519 if (el.Elements("BESKRIVELSE").Any()){ 1520 description = el.Element("BESKRIVELSE").Value; 1521 } 1522 1523 if (el.Elements("DATO_FORMATERET").Any()){ 1524 fulldate = el.Element("DATO_FORMATERET").Value; 1525 } 1526 1527 if (el.Elements("STED").Any()){ 1528 location = el.Element("STED").Value; 1529 } 1530 1531 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ 1532 document = "https://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; 1533 } 1534 1535 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ 1536 document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; 1537 } 1538 1539 if(GetBoolean("Item.Linjeopdeling")==true){ 1540 <hr> 1541 } 1542 1543 if(GetBoolean("Item.Listeopdeling")==true){ 1544 <hr> 1545 } 1546 1547 <div class="sqcalendar-item sqkalender-liste-item-odd"> 1548 <a class="sqcalendar-link" href="Kalenderaftale?kalenderkonto=@kalenderkonto&aftaleid=@id"> 1549 1550 <div class="sqcalendar-date sqevent-date--hide-year" style="background-color: @GetString("Item.DatoBGColor.Color")"> 1551 <div class="sqdate-center"> 1552 1553 <span class="sqdate">@day</span><span class="sqmonth">@month</span> 1554 1555 </div> 1556 </div> 1557 <div class="sqcalendar-desc"> 1558 <div class="sqcalendar-item-info"> 1559 <span class="sqmedia-heading">@title</span> 1560 1561 1562 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @cleanDate</p> 1563 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> 1564 @if (!string.IsNullOrEmpty(description)) 1565 { 1566 <p class="ic-list-item-info nomargin"><i class="fa fa-fw fa-bookmark"></i> @WrapMethods.Truncate(description, int.Parse(TruncateLength()))</p> 1567 } 1568 1569 </div> 1570 </div> 1571 </a> 1572 </div> 1573 } 1574 } 1575 </div> 1576 if(GetBoolean("Item.Listeopdeling")==true){ 1577 <hr> 1578 } 1579 1580 if (GetBoolean("Item.Pagination") != false){ 1581 1582 string OrigUrl=@GetGlobalValue("Global:Pageview.Url"); 1583 string[] urlSplit = OrigUrl.Split('?'); 1584 1585 <!-- Find side indeling --> 1586 @RenderPagination(@urlSplit[0] + "?Purge=True", @rk, @StartSide, @StartDate, @EndDate) 1587 } 1588 } 1589 1590 1591 1592 @helper RenderPagination(string currentPageLink, int pageCount, int currentPage, string sd, string ed) 1593 { 1594 1595 if(currentPage == 0){ 1596 currentPage=1; 1597 } 1598 1599 <div class="col-xs-12" align="center"> 1600 <ul class="pagination"> 1601 @{string pageHrefTemplate = string.Format("<a class=\"page-link\" href=\"{0}?PageNum={{0}}&startd={{1}}&slutd={{2}}\">{{0}}</a>", currentPageLink);} 1602 @for (int i = 1; i <= pageCount; i++) 1603 { 1604 var css = i == currentPage 1605 ? "page-item active" 1606 : "page-item"; 1607 <li class="@css"> 1608 @string.Format(pageHrefTemplate, i, sd, ed) 1609 </li> 1610 } 1611 </ul> 1612 </div> 1613 1614 1615 if (sd != DateTime.Now.ToString("dd/MM/yyyy")){ 1616 <script type="text/javascript">document.getElementById("dato-start").value = "@sd"</script> 1617 } 1618 1619 } 1620 1621 @helper RenderImage() 1622 { 1623 if (!string.IsNullOrEmpty(GetString("Item.Image"))) 1624 { 1625 var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); 1626 1627 <!-- Choosing the smallest possible width that will work with responsive sizes --> 1628 string optimizedwidth = "1280"; 1629 switch (GetString("Item.Width")){ 1630 case "12": 1631 optimizedwidth = "1280"; 1632 break; 1633 case "9": 1634 optimizedwidth = "960"; 1635 break; 1636 case "6": 1637 optimizedwidth = "722"; 1638 break; 1639 case "3": 1640 optimizedwidth = "722"; 1641 break; 1642 case "8": 1643 optimizedwidth = "960"; 1644 break; 1645 case "4": 1646 optimizedwidth = "722"; 1647 break; 1648 } 1649 1650 if (GetString("Item.ImageStyle") == "ball") { 1651 optimizedwidth = "500&height=500"; 1652 } 1653 1654 1655 if (string.IsNullOrEmpty(GetString("Item.Link"))) 1656 { 1657 <div class="img-responsive dw-std-image"> 1658 <img class="content-image img-responsive img-centered" style="@GetImageBorderCss()" src="/Admin/Public/GetImage.ashx?width=@optimizedwidth&crop=1&Compression=75&image=@image" class="img-responsive" alt=""></img> 1659 </div> 1660 } else { 1661 <a href="@GetString("Item.Link")"> 1662 <div class="img-responsive dw-std-image"> 1663 <img class="content-image img-responsive img-centered" style="@GetImageBorderCss()" src="/Admin/Public/GetImage.ashx?width=@optimizedwidth&crop=1&Compression=75&image=@image" class="img-responsive" alt=""></img> 1664 </div> 1665 </a> 1666 } 1667 } 1668 } 1669 1670 @functions { 1671 1672 private string GetImageBorderCss() 1673 { 1674 if (GetString("Item.ImageStyle") == "cover") 1675 { 1676 return "padding: 8px"; 1677 } 1678 else if (GetString("Item.ImageStyle") == "cover-border") 1679 { 1680 return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 1681 } 1682 else if (GetString("Item.ImageStyle") == "frame") 1683 { 1684 return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 1685 } 1686 else if (GetString("Item.ImageStyle") == "rounded") 1687 { 1688 return "border-radius: 8px !important"; 1689 } 1690 else if (GetString("Item.ImageStyle") == "ball") 1691 { 1692 return "border-radius: 1000px !important"; 1693 } 1694 else if (GetString("Item.ImageStyle") == "shadow") 1695 { 1696 return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; 1697 } 1698 else 1699 { 1700 return string.Empty; 1701 } 1702 } 1703 private string GetParagraphWidth() 1704 { 1705 string PctWidth = "100%"; 1706 switch (GetString("Item.Width")){ 1707 case "12": 1708 PctWidth = "100%"; 1709 break; 1710 case "9": 1711 PctWidth = "75%"; 1712 break; 1713 case "6": 1714 PctWidth = "50%"; 1715 break; 1716 case "3": 1717 PctWidth = "25%"; 1718 break; 1719 case "8": 1720 PctWidth = "66%"; 1721 break; 1722 case "4": 1723 PctWidth = "33%"; 1724 break; 1725 } 1726 return PctWidth; 1727 } 1728 1729 private string TruncateLength() 1730 { 1731 string TruncLen = "100"; 1732 switch (GetString("Item.Width")){ 1733 case "12": 1734 TruncLen = "100"; 1735 break; 1736 case "9": 1737 TruncLen = "72"; 1738 break; 1739 case "6": 1740 TruncLen = "40"; 1741 break; 1742 case "3": 1743 TruncLen = "20"; 1744 break; 1745 case "8": 1746 TruncLen = "62"; 1747 break; 1748 case "4": 1749 TruncLen = "25"; 1750 break; 1751 } 1752 return TruncLen; 1753 } 1754 1755 } 1756 <script type="text/javascript"> 1757 1758 1759 function toggle_visibility(id) { 1760 if($('#' + id + "_chevron").length){ 1761 $('#' + id).stop().slideToggle('slow'); 1762 $('#' + id + "_chevron").toggleClass('bottom'); 1763 1764 1765 if(!$('#' + id + "_img").hasClass('bigPic')){ 1766 1767 var container_width = 269; 1768 var image_height; 1769 var natural_width = document.getElementById(id + "_img").naturalWidth; 1770 var natural_height = document.getElementById(id + "_img").naturalHeight; 1771 1772 if(natural_width < container_width){ //> 1773 container_width = natural_width; 1774 } 1775 1776 var res = container_width / natural_width; 1777 //console.log(res); 1778 1779 image_height = natural_height * res; 1780 //console.log(image_height); 1781 1782 if(image_height > 400){ 1783 image_height = 400; 1784 } 1785 1786 //console.log(natural_width + " x " + natural_height); 1787 //console.log(image_height); 1788 $('#' + id + "_img").addClass('bigPic'); 1789 $('#' + id + "_img").css('max-height', image_height + "px"); 1790 }else{ 1791 $('#' + id + "_img").removeClass('bigPic'); 1792 $('#' + id + "_img").css('max-height', "100px"); 1793 } 1794 } 1795 } 1796 </script> 1797 1798

Kirkekontoret

  • Lille Heddinge - Havnelev - Højerup kirker
  •  

    Lille Heddinge - Havnelev - Højerup kirker

    Sognepræst Lisbeth Bukh Pagh 
    Adresse: Rødvigvej 37,4673 Rødvig Stevns 
    Mail: lbu@km.dk - p.t. sygemeldt

    Vikarpræst Else Suhr træffes på tlf. 30347023 vedr. kirkelige handlinger

    Mandag er fridag

    Kordegn keld Köcher -kek@km.dk - tlf. 29852891 - træffes ved andre henvendelser - mandag fridag

    Kontakt til kirke/Sognehus: Mail:LHH@trekirker.dk

    Fortrolig mail:7493fortrolig@sogn.dk

     

    Menighedsrådet intern


Accepter cookies fra dette website

Dette website bruger cookies til at følge din adfærd og for at forbedre brugeroplevelsen på sitet.

Du kan altid slette gemte cookies i dine browserinstillinger

Mere info Jeg accepterer ikke cookies Jeg accepterer kun funktionelle cookies Jeg accepterer alle cookies