Exception in template (Designs/Dwsimple/Paragraph/Kalender.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.affbbbaedb.b__2(TextWriter __razor_helper_writer)
   at RazorEngine.Templating.TemplateWriter.WriteTo(TextWriter writer)
   at RazorEngine.Templating.TemplateBase.WriteTo(TextWriter writer, TemplateWriter helper)
   at CompiledRazorTemplates.Dynamic.affbbbaedb.b__0(TextWriter __razor_helper_writer)
   at RazorEngine.Templating.TemplateWriter.WriteTo(TextWriter writer)
   at RazorEngine.Templating.TemplateBase.Write(TemplateWriter helper)
   at CompiledRazorTemplates.Dynamic.affbbbaedb.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@using System.Xml.Linq; @using System.Text; @using System.Globalization; @{ init(); } @functions { private int columnsWritten { get; set; } private int columns { get; set; } public void init() { columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); columns = GetInteger("Item.Width"); System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); } public void Fluid() { columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); columns = 12; System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; } public string ColumnClass() { if (GetString("Item.WidthMobile") == "hide"){ return "col-md-" + GetString("Item.Width") + " hidden-xs"; } else { return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); } } public string NewRow() { if (columns + columnsWritten > 12) { System.Web.HttpContext.Current.Items["currentColumns"] = columns; return "</div><div class=\"row\">"; } else { return string.Empty; } } public string NewRowParagraphExtended() { if (columns + columnsWritten > 12) { System.Web.HttpContext.Current.Items["currentColumns"] = columns; return "</div><div class=\"flex-container\">"; } else { return string.Empty; } } } @{ <style> .datobgcolor { background-color: @GetString("Item.DatoBGColor.Color"); } </style> } @if (GetParagraphWidth() == "100%"){ @NewRow(); } else { @NewRowParagraphExtended(); } <!-- flex-item; min-width:calc(@GetParagraphWidth() - 10px) --> <div class="@ColumnClass(); dist2nxtblk"> <div class="@GetString("Item.ContentStyle") Special-Col-Style" style="background-color: @GetString("Item.BackgroundColor.Color")"> @if (GetString("Item.Order") == "title-first" || GetString("Item.Order") == "") { if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @RenderImage() @kalendertype() } @if (GetString("Item.Order") == "image-first") { @RenderImage() if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @kalendertype() } @if (GetString("Item.Order") == "icon-xs") { <div class="col-md-2"> @RenderImage() </div> <div class="col-md-10"> if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @kalendertype() </div> } @if (GetString("Item.Order") == "icon-sm") { <div class="col-md-3"> @RenderImage() </div> <div class="col-md-9"> if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> <br> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @kalendertype() </div> } @if (GetString("Item.Order") == "icon-md") { <div class="col-md-4"> @RenderImage() </div> <div class="col-md-8"> if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @kalendertype() </div> } </div> </div> @helper kalendertype(){ if (@GetString("Item.LayoutMode") == "ballon") { @Ballon() } if (@GetString("Item.LayoutMode") == "list") { <p class="list-item-info nomargin">(Tryk på aktiviten for at se detaljer)</p><p></p> @list() } if (@GetString("Item.LayoutMode") == "kasse") { @kasse() } } @helper Ballon(){ <ul class="list-listings blog-list"> @{ DateTime EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")); String StartDate = DateTime.Now.ToString("dd/MM/yyyy"); String Limit = int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands).ToString(); if (GetBoolean("Item.StartDateNow") == false){ EndDate = Convert.ToDateTime(GetString("Item.StartDate")).AddDays(GetInteger("Item.Days")); StartDate = GetString("Item.StartDate"); } string linkstring = GetString("Item.FeedLink")+"&InKontonr="+GetString("Item.AccountNumber")+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy"); if (GetString("Item.Show.Filter") != "alle"){ linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); } XDocument xdoc = XDocument.Load(linkstring); var elements = xdoc.Element("DATA").Elements("AFTALE"); foreach (var el in elements) { string id = "0"; string type = "alle"; DateTime date; string title = "Title"; string description = "Description"; string fulldate = "Date"; string cleanDate = ""; string day = ""; string month = ""; string location = ""; string document = ""; string document_type = "document"; string ShowInfo = "Closed"; if (el.Elements("ID").Any()){ id = el.Element("ID").Value; } if (el.Elements("AFTALETYPE").Any()){ type = el.Element("AFTALETYPE").Value; } if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); day = date.ToString(" d", new CultureInfo("da-DK")); month = date.ToString("MMM", new CultureInfo("da-DK")); } if (el.Elements("OVERSKRIFT").Any()){ title = el.Element("OVERSKRIFT").Value; } if (el.Elements("BESKRIVELSE").Any()){ description = el.Element("BESKRIVELSE").Value; } if (el.Elements("DATO_FORMATERET").Any()){ fulldate = el.Element("DATO_FORMATERET").Value; } if (el.Elements("STED").Any()){ location = el.Element("STED").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ document = "http://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; } <a href="javascript:void(0);" onclick="toggle_visibility('@id');"> <div class="row"> <div class="media col-md-12"> <div class="media-left"> <div class="media-object calendar-date datobgcolor text-center"><span>@day</span> @month</div> </div> <div class="media-body"> <h2 class="media-heading">@title</h2> <p class="list-item-info">@type</p> <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @fulldate</p> <p class="list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> @{ string isHidden = ""; if (ShowInfo == "Closed" || ShowInfo == "Hidden"){ isHidden = "style=\"display:none;\""; } } <div id="@id" @isHidden> <p>@description</p> </div> </div> <div class="media-right" style="width: 33%;"> @if (document != ""){ if (document_type == "OFFENTLIGT_AFTALE_BILLEDE"){ <img class="img-responsive" src="@document" alt="" id="@(id)_img" style="max-height: 100px; float:right; position: relative;"></img> } } </div> </div> </div> @if (!string.IsNullOrWhiteSpace(description) || !string.IsNullOrWhiteSpace(document)){ if (ShowInfo == "Open"){ <p id="@(id)_chevron" class="text-center chevron"></p> } else if (ShowInfo == "Closed") { <p id="@(id)_chevron" class="text-center chevron bottom"></p> } } </a> <hr> } } </ul> } @helper list(){ <ul class="list-listings blog-list"> @{ DateTime EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")); String StartDate = DateTime.Now.ToString("dd/MM/yyyy"); String Limit = int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands).ToString(); String sognekode = GetString("Item.Sognekode"); string kalenderkonto = GetString("Item.AccountNumber"); if (GetBoolean("Item.StartDateNow") == false){ EndDate = Convert.ToDateTime(GetString("Item.StartDate")).AddDays(GetInteger("Item.Days")); StartDate = GetString("Item.StartDate"); } string linkstring = GetString("Item.FeedLink")+"&InKontonr="+kalenderkonto+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy")+"&InSognekode="+sognekode; if (GetString("Item.Show.Filter") != "alle"){ linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); } XDocument xdoc = XDocument.Load(linkstring); var elements = xdoc.Element("DATA").Elements("AFTALE"); foreach (var el in elements) { string id = "0"; string type = "alle"; DateTime date; string title = "Title"; string description = "Description"; string fulldate = "Date"; string cleanDate = ""; string day = ""; string month = ""; string location = ""; string document = ""; string document_type = "document"; if (el.Elements("ID").Any()){ id = el.Element("ID").Value; } if (el.Elements("AFTALETYPE").Any()){ type = el.Element("AFTALETYPE").Value; } if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); day = date.ToString(" d", new CultureInfo("da-DK")); month = date.ToString("MMM", new CultureInfo("da-DK")); } if (el.Elements("OVERSKRIFT").Any()){ title = el.Element("OVERSKRIFT").Value; } if (el.Elements("BESKRIVELSE").Any()){ description = el.Element("BESKRIVELSE").Value; } if (el.Elements("DATO_FORMATERET").Any()){ fulldate = el.Element("DATO_FORMATERET").Value; } if (el.Elements("STED").Any()){ location = el.Element("STED").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ document = "http://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; } <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"> <div class="row"> <div class="media col-md-12"> <div class="media-body"> <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @fulldate</p> <h2 class="media-heading">@title</h2> <p class="list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> </div> <br> </div> </div> </a> } } </ul> } @helper kasse(){ <div class="sqcalendar"> @{ DateTime EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")); String StartDate = DateTime.Now.ToString("dd/MM/yyyy"); String Limit = int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands).ToString(); String kalenderkonto = GetString("Item.AccountNumber"); if (GetBoolean("Item.StartDateNow") == false){ EndDate = Convert.ToDateTime(GetString("Item.StartDate")).AddDays(GetInteger("Item.Days")); StartDate = GetString("Item.StartDate"); } string linkstring = GetString("Item.FeedLink")+"&InKontonr="+GetString("Item.AccountNumber")+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy"); if (GetString("Item.Show.Filter") != "alle"){ linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); } XDocument xdoc = XDocument.Load(linkstring); var elements = xdoc.Element("DATA").Elements("AFTALE"); foreach (var el in elements) { string id = "0"; string type = "alle"; DateTime date; string title = "Title"; string description = "Description"; string fulldate = "Date"; string cleanDate = ""; string day = ""; string month = ""; string location = ""; string document = ""; string document_type = "document"; if (el.Elements("ID").Any()){ id = el.Element("ID").Value; } if (el.Elements("AFTALETYPE").Any()){ type = el.Element("AFTALETYPE").Value; } if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); day = date.ToString(" d", new CultureInfo("da-DK")); month = date.ToString("MMM", new CultureInfo("da-DK")); } if (el.Elements("OVERSKRIFT").Any()){ title = el.Element("OVERSKRIFT").Value; } if (el.Elements("BESKRIVELSE").Any()){ description = el.Element("BESKRIVELSE").Value; } if (el.Elements("DATO_FORMATERET").Any()){ fulldate = el.Element("DATO_FORMATERET").Value; } if (el.Elements("STED").Any()){ location = el.Element("STED").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ document = "http://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; } <div class="sqcalendar-item sqkalender-liste-item-odd"> <a class="sqcalendar-link" href="Kalenderaftale?kalenderkonto=@kalenderkonto&aftaleid=@id" data-toggle="tooltip" data-placement="right" data-html="true" title="@title &#013; &#013Beskrivelse: &#013;@description &#013; &#013;@fulldate"> <div class="sqcalendar-date datobgcolor sqevent-date--hide-year"> <div class="sqdate-center"> <span class="sqdate">@day</span><span class="sqmonth">@month</span> </div> </div> <div class="sqcalendar-desc"> <div class="sqcalendar-item-info"> <span class="sqmedia-heading">@title</span> <p class="list-item-info">(@type)</p> <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @cleanDate</p> <p class="list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> @{ string isHidden = ""; if (GetString("Item.ShowInfo") == "Closed" || GetString("Item.ShowInfo") == "Hidden"){ isHidden = "style=\"display:none;\""; } } <div id="@id" @isHidden> <p>@description</p> </div> </div> </div> <div class="media-right" style="width: 33%;"> @if (document != ""){ if (document_type == "OFFENTLIGT_AFTALE_BILLEDE"){ <img class="img-responsive" src="@document" alt="" id="@(id)_img" style="max-height: 100px; float:right; position: relative;"></img> } } </div> @if (!string.IsNullOrWhiteSpace(description) || !string.IsNullOrWhiteSpace(document)){ if (GetString("Item.ShowInfo") == "Open"){ <p id="@(id)_chevron" class="text-center chevron"></p> } else if (GetString("Item.ShowInfo") == "Closed") { <p id="@(id)_chevron" class="text-center chevron bottom"></p> } } </a> </div> } } </div> } @helper RenderImage() { if (!string.IsNullOrEmpty(GetString("Item.Image"))) { var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); <!-- Choosing the smallest possible width that will work with responsive sizes --> string optimizedwidth = "1280"; switch (GetString("Item.Width")){ case "12": optimizedwidth = "1280"; break; case "9": optimizedwidth = "960"; break; case "6": optimizedwidth = "722"; break; case "3": optimizedwidth = "722"; break; case "8": optimizedwidth = "960"; break; case "4": optimizedwidth = "722"; break; } if (GetString("Item.ImageStyle") == "ball") { optimizedwidth = "500&height=500"; } if (string.IsNullOrEmpty(GetString("Item.Link"))) { <div class="img-responsive dw-std-image"> <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> </div> } else { <a href="@GetString("Item.Link")"> <div class="img-responsive dw-std-image"> <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> </div> </a> } } } @functions { private string GetImageBorderCss() { if (GetString("Item.ImageStyle") == "cover") { return "padding: 8px"; } else if (GetString("Item.ImageStyle") == "cover-border") { return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; } else if (GetString("Item.ImageStyle") == "frame") { return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; } else if (GetString("Item.ImageStyle") == "rounded") { return "border-radius: 8px !important"; } else if (GetString("Item.ImageStyle") == "ball") { return "border-radius: 1000px !important"; } else if (GetString("Item.ImageStyle") == "shadow") { return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; } else { return string.Empty; } } private string GetParagraphWidth() { string PctWidth = "100%"; switch (GetString("Item.Width")){ case "12": PctWidth = "100%"; break; case "9": PctWidth = "75%"; break; case "6": PctWidth = "50%"; break; case "3": PctWidth = "25%"; break; case "8": PctWidth = "66%"; break; case "4": PctWidth = "33%"; break; } return PctWidth; } } <script type="text/javascript"> function toggle_visibility(id) { if($('#' + id + "_chevron").length){ $('#' + id).stop().slideToggle('slow'); $('#' + id + "_chevron").toggleClass('bottom'); if(!$('#' + id + "_img").hasClass('bigPic')){ var container_width = 269; var image_height; var natural_width = document.getElementById(id + "_img").naturalWidth; var natural_height = document.getElementById(id + "_img").naturalHeight; if(natural_width < container_width){ //> container_width = natural_width; } var res = container_width / natural_width; //console.log(res); image_height = natural_height * res; //console.log(image_height); if(image_height > 400){ image_height = 400; } //console.log(natural_width + " x " + natural_height); //console.log(image_height); $('#' + id + "_img").addClass('bigPic'); $('#' + id + "_img").css('max-height', image_height + "px"); }else{ $('#' + id + "_img").removeClass('bigPic'); $('#' + id + "_img").css('max-height', "100px"); } } } </script>

Bliv medlem af Folkekirken

Folkekirken i Agerbæk og Starup er din lokale kirke, brug dem.

Folkekirken tilbyder dig på et lokalt plan en bred vifte af tiltag! Fra gudstjenester, foredrag og fællesskab.

Folkekirken er der i livets glædelige, men også livets svære situationer.

Folkekirken bevare vores allesammen Danmarks historie.

Man kan altid henvende sig til præsten, hvis man har brug for en samtale! Det er gratis.

Hvis du er kommet til at melde dig ud, kan du bruge følgende link.
 

Exception in template (Designs/Dwsimple/Paragraph/Kalender.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.affbbbaedb.b__2(TextWriter __razor_helper_writer)
   at RazorEngine.Templating.TemplateWriter.WriteTo(TextWriter writer)
   at RazorEngine.Templating.TemplateBase.WriteTo(TextWriter writer, TemplateWriter helper)
   at CompiledRazorTemplates.Dynamic.affbbbaedb.b__0(TextWriter __razor_helper_writer)
   at RazorEngine.Templating.TemplateWriter.WriteTo(TextWriter writer)
   at RazorEngine.Templating.TemplateBase.Write(TemplateWriter helper)
   at CompiledRazorTemplates.Dynamic.affbbbaedb.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@using System.Xml.Linq; @using System.Text; @using System.Globalization; @{ init(); } @functions { private int columnsWritten { get; set; } private int columns { get; set; } public void init() { columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); columns = GetInteger("Item.Width"); System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); } public void Fluid() { columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); columns = 12; System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; } public string ColumnClass() { if (GetString("Item.WidthMobile") == "hide"){ return "col-md-" + GetString("Item.Width") + " hidden-xs"; } else { return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); } } public string NewRow() { if (columns + columnsWritten > 12) { System.Web.HttpContext.Current.Items["currentColumns"] = columns; return "</div><div class=\"row\">"; } else { return string.Empty; } } public string NewRowParagraphExtended() { if (columns + columnsWritten > 12) { System.Web.HttpContext.Current.Items["currentColumns"] = columns; return "</div><div class=\"flex-container\">"; } else { return string.Empty; } } } @{ <style> .datobgcolor { background-color: @GetString("Item.DatoBGColor.Color"); } </style> } @if (GetParagraphWidth() == "100%"){ @NewRow(); } else { @NewRowParagraphExtended(); } <!-- flex-item; min-width:calc(@GetParagraphWidth() - 10px) --> <div class="@ColumnClass(); dist2nxtblk"> <div class="@GetString("Item.ContentStyle") Special-Col-Style" style="background-color: @GetString("Item.BackgroundColor.Color")"> @if (GetString("Item.Order") == "title-first" || GetString("Item.Order") == "") { if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @RenderImage() @kalendertype() } @if (GetString("Item.Order") == "image-first") { @RenderImage() if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @kalendertype() } @if (GetString("Item.Order") == "icon-xs") { <div class="col-md-2"> @RenderImage() </div> <div class="col-md-10"> if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @kalendertype() </div> } @if (GetString("Item.Order") == "icon-sm") { <div class="col-md-3"> @RenderImage() </div> <div class="col-md-9"> if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> <br> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @kalendertype() </div> } @if (GetString("Item.Order") == "icon-md") { <div class="col-md-4"> @RenderImage() </div> <div class="col-md-8"> if (GetBoolean("Item.VisTitel") != false){ if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { <h1 class="dw-section-title alignCenter"> <span>@GetString("Item.Titel")</span> </h1> } } else { <h1 class="dw-section-title alignCenter"><span></span></h1> } @kalendertype() </div> } </div> </div> @helper kalendertype(){ if (@GetString("Item.LayoutMode") == "ballon") { @Ballon() } if (@GetString("Item.LayoutMode") == "list") { <p class="list-item-info nomargin">(Tryk på aktiviten for at se detaljer)</p><p></p> @list() } if (@GetString("Item.LayoutMode") == "kasse") { @kasse() } } @helper Ballon(){ <ul class="list-listings blog-list"> @{ DateTime EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")); String StartDate = DateTime.Now.ToString("dd/MM/yyyy"); String Limit = int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands).ToString(); if (GetBoolean("Item.StartDateNow") == false){ EndDate = Convert.ToDateTime(GetString("Item.StartDate")).AddDays(GetInteger("Item.Days")); StartDate = GetString("Item.StartDate"); } string linkstring = GetString("Item.FeedLink")+"&InKontonr="+GetString("Item.AccountNumber")+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy"); if (GetString("Item.Show.Filter") != "alle"){ linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); } XDocument xdoc = XDocument.Load(linkstring); var elements = xdoc.Element("DATA").Elements("AFTALE"); foreach (var el in elements) { string id = "0"; string type = "alle"; DateTime date; string title = "Title"; string description = "Description"; string fulldate = "Date"; string cleanDate = ""; string day = ""; string month = ""; string location = ""; string document = ""; string document_type = "document"; string ShowInfo = "Closed"; if (el.Elements("ID").Any()){ id = el.Element("ID").Value; } if (el.Elements("AFTALETYPE").Any()){ type = el.Element("AFTALETYPE").Value; } if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); day = date.ToString(" d", new CultureInfo("da-DK")); month = date.ToString("MMM", new CultureInfo("da-DK")); } if (el.Elements("OVERSKRIFT").Any()){ title = el.Element("OVERSKRIFT").Value; } if (el.Elements("BESKRIVELSE").Any()){ description = el.Element("BESKRIVELSE").Value; } if (el.Elements("DATO_FORMATERET").Any()){ fulldate = el.Element("DATO_FORMATERET").Value; } if (el.Elements("STED").Any()){ location = el.Element("STED").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ document = "http://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; } <a href="javascript:void(0);" onclick="toggle_visibility('@id');"> <div class="row"> <div class="media col-md-12"> <div class="media-left"> <div class="media-object calendar-date datobgcolor text-center"><span>@day</span> @month</div> </div> <div class="media-body"> <h2 class="media-heading">@title</h2> <p class="list-item-info">@type</p> <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @fulldate</p> <p class="list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> @{ string isHidden = ""; if (ShowInfo == "Closed" || ShowInfo == "Hidden"){ isHidden = "style=\"display:none;\""; } } <div id="@id" @isHidden> <p>@description</p> </div> </div> <div class="media-right" style="width: 33%;"> @if (document != ""){ if (document_type == "OFFENTLIGT_AFTALE_BILLEDE"){ <img class="img-responsive" src="@document" alt="" id="@(id)_img" style="max-height: 100px; float:right; position: relative;"></img> } } </div> </div> </div> @if (!string.IsNullOrWhiteSpace(description) || !string.IsNullOrWhiteSpace(document)){ if (ShowInfo == "Open"){ <p id="@(id)_chevron" class="text-center chevron"></p> } else if (ShowInfo == "Closed") { <p id="@(id)_chevron" class="text-center chevron bottom"></p> } } </a> <hr> } } </ul> } @helper list(){ <ul class="list-listings blog-list"> @{ DateTime EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")); String StartDate = DateTime.Now.ToString("dd/MM/yyyy"); String Limit = int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands).ToString(); String sognekode = GetString("Item.Sognekode"); string kalenderkonto = GetString("Item.AccountNumber"); if (GetBoolean("Item.StartDateNow") == false){ EndDate = Convert.ToDateTime(GetString("Item.StartDate")).AddDays(GetInteger("Item.Days")); StartDate = GetString("Item.StartDate"); } string linkstring = GetString("Item.FeedLink")+"&InKontonr="+kalenderkonto+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy")+"&InSognekode="+sognekode; if (GetString("Item.Show.Filter") != "alle"){ linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); } XDocument xdoc = XDocument.Load(linkstring); var elements = xdoc.Element("DATA").Elements("AFTALE"); foreach (var el in elements) { string id = "0"; string type = "alle"; DateTime date; string title = "Title"; string description = "Description"; string fulldate = "Date"; string cleanDate = ""; string day = ""; string month = ""; string location = ""; string document = ""; string document_type = "document"; if (el.Elements("ID").Any()){ id = el.Element("ID").Value; } if (el.Elements("AFTALETYPE").Any()){ type = el.Element("AFTALETYPE").Value; } if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); day = date.ToString(" d", new CultureInfo("da-DK")); month = date.ToString("MMM", new CultureInfo("da-DK")); } if (el.Elements("OVERSKRIFT").Any()){ title = el.Element("OVERSKRIFT").Value; } if (el.Elements("BESKRIVELSE").Any()){ description = el.Element("BESKRIVELSE").Value; } if (el.Elements("DATO_FORMATERET").Any()){ fulldate = el.Element("DATO_FORMATERET").Value; } if (el.Elements("STED").Any()){ location = el.Element("STED").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ document = "http://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; } <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"> <div class="row"> <div class="media col-md-12"> <div class="media-body"> <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @fulldate</p> <h2 class="media-heading">@title</h2> <p class="list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> </div> <br> </div> </div> </a> } } </ul> } @helper kasse(){ <div class="sqcalendar"> @{ DateTime EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")); String StartDate = DateTime.Now.ToString("dd/MM/yyyy"); String Limit = int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands).ToString(); String kalenderkonto = GetString("Item.AccountNumber"); if (GetBoolean("Item.StartDateNow") == false){ EndDate = Convert.ToDateTime(GetString("Item.StartDate")).AddDays(GetInteger("Item.Days")); StartDate = GetString("Item.StartDate"); } string linkstring = GetString("Item.FeedLink")+"&InKontonr="+GetString("Item.AccountNumber")+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy"); if (GetString("Item.Show.Filter") != "alle"){ linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); } XDocument xdoc = XDocument.Load(linkstring); var elements = xdoc.Element("DATA").Elements("AFTALE"); foreach (var el in elements) { string id = "0"; string type = "alle"; DateTime date; string title = "Title"; string description = "Description"; string fulldate = "Date"; string cleanDate = ""; string day = ""; string month = ""; string location = ""; string document = ""; string document_type = "document"; if (el.Elements("ID").Any()){ id = el.Element("ID").Value; } if (el.Elements("AFTALETYPE").Any()){ type = el.Element("AFTALETYPE").Value; } if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); day = date.ToString(" d", new CultureInfo("da-DK")); month = date.ToString("MMM", new CultureInfo("da-DK")); } if (el.Elements("OVERSKRIFT").Any()){ title = el.Element("OVERSKRIFT").Value; } if (el.Elements("BESKRIVELSE").Any()){ description = el.Element("BESKRIVELSE").Value; } if (el.Elements("DATO_FORMATERET").Any()){ fulldate = el.Element("DATO_FORMATERET").Value; } if (el.Elements("STED").Any()){ location = el.Element("STED").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ document = "http://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; } if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; } <div class="sqcalendar-item sqkalender-liste-item-odd"> <a class="sqcalendar-link" href="Kalenderaftale?kalenderkonto=@kalenderkonto&aftaleid=@id" data-toggle="tooltip" data-placement="right" data-html="true" title="@title &#013; &#013Beskrivelse: &#013;@description &#013; &#013;@fulldate"> <div class="sqcalendar-date datobgcolor sqevent-date--hide-year"> <div class="sqdate-center"> <span class="sqdate">@day</span><span class="sqmonth">@month</span> </div> </div> <div class="sqcalendar-desc"> <div class="sqcalendar-item-info"> <span class="sqmedia-heading">@title</span> <p class="list-item-info">(@type)</p> <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @cleanDate</p> <p class="list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> @{ string isHidden = ""; if (GetString("Item.ShowInfo") == "Closed" || GetString("Item.ShowInfo") == "Hidden"){ isHidden = "style=\"display:none;\""; } } <div id="@id" @isHidden> <p>@description</p> </div> </div> </div> <div class="media-right" style="width: 33%;"> @if (document != ""){ if (document_type == "OFFENTLIGT_AFTALE_BILLEDE"){ <img class="img-responsive" src="@document" alt="" id="@(id)_img" style="max-height: 100px; float:right; position: relative;"></img> } } </div> @if (!string.IsNullOrWhiteSpace(description) || !string.IsNullOrWhiteSpace(document)){ if (GetString("Item.ShowInfo") == "Open"){ <p id="@(id)_chevron" class="text-center chevron"></p> } else if (GetString("Item.ShowInfo") == "Closed") { <p id="@(id)_chevron" class="text-center chevron bottom"></p> } } </a> </div> } } </div> } @helper RenderImage() { if (!string.IsNullOrEmpty(GetString("Item.Image"))) { var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); <!-- Choosing the smallest possible width that will work with responsive sizes --> string optimizedwidth = "1280"; switch (GetString("Item.Width")){ case "12": optimizedwidth = "1280"; break; case "9": optimizedwidth = "960"; break; case "6": optimizedwidth = "722"; break; case "3": optimizedwidth = "722"; break; case "8": optimizedwidth = "960"; break; case "4": optimizedwidth = "722"; break; } if (GetString("Item.ImageStyle") == "ball") { optimizedwidth = "500&height=500"; } if (string.IsNullOrEmpty(GetString("Item.Link"))) { <div class="img-responsive dw-std-image"> <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> </div> } else { <a href="@GetString("Item.Link")"> <div class="img-responsive dw-std-image"> <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> </div> </a> } } } @functions { private string GetImageBorderCss() { if (GetString("Item.ImageStyle") == "cover") { return "padding: 8px"; } else if (GetString("Item.ImageStyle") == "cover-border") { return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; } else if (GetString("Item.ImageStyle") == "frame") { return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; } else if (GetString("Item.ImageStyle") == "rounded") { return "border-radius: 8px !important"; } else if (GetString("Item.ImageStyle") == "ball") { return "border-radius: 1000px !important"; } else if (GetString("Item.ImageStyle") == "shadow") { return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; } else { return string.Empty; } } private string GetParagraphWidth() { string PctWidth = "100%"; switch (GetString("Item.Width")){ case "12": PctWidth = "100%"; break; case "9": PctWidth = "75%"; break; case "6": PctWidth = "50%"; break; case "3": PctWidth = "25%"; break; case "8": PctWidth = "66%"; break; case "4": PctWidth = "33%"; break; } return PctWidth; } } <script type="text/javascript"> function toggle_visibility(id) { if($('#' + id + "_chevron").length){ $('#' + id).stop().slideToggle('slow'); $('#' + id + "_chevron").toggleClass('bottom'); if(!$('#' + id + "_img").hasClass('bigPic')){ var container_width = 269; var image_height; var natural_width = document.getElementById(id + "_img").naturalWidth; var natural_height = document.getElementById(id + "_img").naturalHeight; if(natural_width < container_width){ //> container_width = natural_width; } var res = container_width / natural_width; //console.log(res); image_height = natural_height * res; //console.log(image_height); if(image_height > 400){ image_height = 400; } //console.log(natural_width + " x " + natural_height); //console.log(image_height); $('#' + id + "_img").addClass('bigPic'); $('#' + id + "_img").css('max-height', image_height + "px"); }else{ $('#' + id + "_img").removeClass('bigPic'); $('#' + id + "_img").css('max-height', "100px"); } } } </script>

Kontaktoplysninger

  • Agerbæk - Vester Starup Pastorat
  • v/ Sognepræst
    Søren Pedersen
    Kærbjervej 6
    6753 Agerbæk

  • Telefon: 7519 6703
  • Email: sop@km.dk
 

Sociale links