Exception in template (Designs\RizzoDesignFolder\eCom/Product/ProductRedirect.cshtml): System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
   at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
   at CompiledRazorTemplates.Dynamic.fdbdccbfabdaadb.isActive(Int32 productMonth, Int32 productYear, Int32 productDay)
   at CompiledRazorTemplates.Dynamic.fdbdccbfabdaadb.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.Output()
@inherits RazorTemplateBase<RazorTemplateModel<Template>> @using Dynamicweb.Rendering; @if(!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["detail"]) && GetInteger("Ecom:Product.PrimaryOrCurrentPageID") != Pageview.Page.ID) { string redirect = "/Default.aspx?ID=" + GetString("Ecom:Product.PrimaryOrCurrentPageID") + "&ProductID=" + GetString("Ecom:Product.ID"); if(!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["variantID"])) { redirect += "&variantID=" + System.Web.HttpContext.Current.Request.QueryString["variantID"].ToString(); } System.Web.HttpContext.Current.Response.Redirect(Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(redirect)); } @using System.Collections.Generic @using System.Dynamic @using System.Globalization @using System.Text.RegularExpressions @using System.Web @using Dynamicweb.Frontend @inherits Dynamicweb.Rendering.RazorTemplateBase< Dynamicweb.Rendering.RazorTemplateModel< Dynamicweb.Rendering.Template > > @using System; @{ string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", ""); }@functions{ public static string GetImage(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "jpg", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "RizzoDesignFolder") { Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); string currDevice = currentPageview.Device.ToString(), alternativeImage = currentPageview.Area.Item["NoImage"] != null ? currentPageview.Area.Item["NoImage"].ToString() : "/Files/Templates/Designs/"+ designName + "/images/alternativeImage.jpg", widthString = "", heightString = "", getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : "", getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : "", bgColor = !string.IsNullOrEmpty(background) ? "&amp;backgroud="+background : ""; int getImageWidth = imageWidth != 0 ? imageWidth : 0, getImageHeight = imageHeight != 0 ? imageHeight : 0; if (currDevice == Dynamicweb.Frontend.PageView.DeviceType.Tablet.ToString()) { getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; } else if (currDevice == Dynamicweb.Frontend.PageView.DeviceType.Mobile.ToString()) { getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; } if (getImageWidth != 0) { widthString = "&amp;Width=" + getImageWidth; } if (getImageHeight != 0) { heightString = "&amp;Height=" + getImageHeight; } string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; return output; } } @inherits RazorTemplateBase<RazorTemplateModel<Template>> @using Dynamicweb.Rendering; @functions{ private string GetImagePathUrl(string small, string medium, string large, string pattern) { string imagePath; if (!string.IsNullOrEmpty(small)) imagePath = small; else if (!string.IsNullOrEmpty(medium)) imagePath = medium; else if (!string.IsNullOrEmpty(large)) imagePath = large; else imagePath = pattern; return imagePath; } } @{ var areaItem = Pageview.Area.Item; bool isLoggedIn = Pageview.User.LoggedIn, isFrontEnd = Dynamicweb.ExecutingContext.IsFrontEnd(), productIsFavorite = GetBoolean( "Ecom:Product.IsProductInFavoriteList" ); string areaid = Pageview.GlobalTags.GetTagByName( "Global:Area.ID" ).Value, currentPageId = Pageview.Page.ID.ToString(), variantDefaultId = GetString( "Ecom:Product.DefaultVariantComboID" ), variantCurrentId = GetString( "Ecom:Product.VariantID" ), variantId = !string.IsNullOrEmpty( variantCurrentId ) ? variantCurrentId : variantDefaultId, titleKey = "title", title = "", imageKey = "image", image = "", stockStatus = GetInteger( "Ecom:Product.Stock" ) > 0 ? "fa-check" : "fa-close", stockStatusID = GetString( "Ecom:Product:Stock.ID" ), productId = GetString( "Ecom:Product.ID" ), productLanguage = GetString( "Ecom:Product.LanguageID" ), productName = GetString( "Ecom:Product.Name" ), productNumber = GetString( "Ecom:Product.Number" ).Trim(), pattern = "", productImage = GetImagePathUrl( GetString( "Ecom:Product.ImageSmall.Clean" ), GetString( "Ecom:Product.ImageMedium.Clean" ), GetString( "Ecom:Product.ImageLarge.Clean" ), pattern ), productGetImage = GetImage( productImage, 0, 600 ), imagesFolder = "/Files/Files/" + designName + "/Products/", imagePattern = "/Files/Images/SocialeMedier/" + productNumber + ".jpg", standardProdImg = "/Files/Templates/Designs/RizzoDesignFolder/images/JUC_logo.png", productIntro = GetString( "Ecom:Product.MetaDescription" ), productDescription = GetString( "Ecom:Product.LongDescription" ), pointPrice = GetString( "Ecom:Product.PointPrice" ), productDetails = GetString( "Ecom:Product:Field.Details.Value.Clean" ), productWarranty = GetString( "Ecom:Product:Field.Warranty.Value.Clean" ), ShowFoaLogo = GetString( "Ecom:Product:Field.ShowFoaLogo.Value.Clean" ), productPrice = GetString( "Ecom:Product.Price.PriceWithoutVAT" ).Replace( ",00", "" ), currency = GetString( "Ecom:Product.Price.Currency.Symbol" ), currencyCode = GetString( "Ecom:Order.Price.CurrencyCode" ), productPriceDB = GetString( "Ecom:Product.DBPrice" ), productRemoveFromList = "/Default.aspx?Id=" + currentPageId + "&amp;ProductID=" + productId + "&amp;CCRemoveFromMyLists=" + productId + "&amp;CCRemoveFromListVariantID=" + variantId + "&amp;CCRemoveFromListLanguageID=" + productLanguage, productAddToList = "/Default.aspx?Id=" + currentPageId + "&amp;ProductID=" + productId + "&amp;CCAddToMyLists=" + productId + "&amp;CCAddToListVariantID=" + variantId + "&amp;CCAddToListLanguageID=" + productLanguage, favoriteUrl = productIsFavorite ? productRemoveFromList : productAddToList, // Filter for downloads item downloadsFilter = "Products contains 'p_" + productId + ",' or Products contains 'p_" + productId + ":' or Products ends with 'p_" + productId + "'", nrLectures = GetString( "Ecom:Product:Field.Lectures.Value.Clean" ), nrLecturesDecimal = GetString( "Ecom:Product:Field.LecturesDecimal.Value.Raw" ), video = GetString( "Ecom:Product:Field.video.FullPath" ), poster = GetString( "Ecom:Product:Field.poster.FullPath" ), groupId = GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), parentGroupId = groupId, pageGroupUrl = String.Format( "/Default.aspx?Id={0}&amp;groupid={1}#open", currentPageId, parentGroupId ), pageGroupPrimaryPageUrl = "", stock = GetString( "Ecom:Product:Stock.Text" ), nrDay = GetString( "Ecom:Product:Field.Day.Value.Clean" ), nrMonth = GetString( "Ecom:Product:Field.Month.Value.Clean" ), nrYear = GetString( "Ecom:Product:Field.Year.Value.Clean" ), nrAdress = GetString( "Ecom:Product:Field.locationEvent.Value.Clean" ), /* HUAH: old one*/ courseEventLocation = GetString( "Ecom:Product:Field.LokationAfBegivenhed.Value.Clean" ), OpenGraphTitle = GetString( "Ecom:Product:Field.OpenGraphTitle.Value.Clean" ), OpenGraphDescription = GetString( "Ecom:Product:Field.OpenGraphDescription.Value.Clean" ), OpenGraphImage = GetString( "Ecom:Product:Field.OpenGraphImage2.Value" ), stockNumber = GetString( "Ecom:Product.Stock" ); int stockNumberInt = Int32.Parse( stockNumber ); string firstActivityStartDate = ""; string lastActivityEndDate = ""; var nrCompleteDate = nrDay + "/" + nrMonth + "/" + nrYear; DateTime productFieldDateStart = DateTime.Now; var imagesList = new List< Dictionary< string, string > >(); var relatedGroupsList = GetLoop( "ProductRelatedGroups" ); var currentGroup = Dynamicweb.eCommerce.Products.Group.GetGroupByID( groupId, productLanguage ); string parentGroupName = currentGroup.Name; var parentGroups = currentGroup.ParentGroupsDefaultLanguage; if ( parentGroups.Any() ) { var parentGroup = parentGroups.FirstOrDefault(); parentGroupId = parentGroup.ID.ToString(); parentGroupName = parentGroup.Name; pageGroupUrl = String.Format( "/Default.aspx?Id={0}&amp;groupid={1}#open", currentPageId, parentGroupId ); pageGroupPrimaryPageUrl = parentGroup.Meta.PrimaryPage.ToString(); } var productCanonical = GetGlobalValue( "Global:Request.Scheme" ) + "://" + GetGlobalValue( "Global:Request.Host" ) + GetGlobalValue( "Global:Pageview.Url" ); var productMetaTitle = GetString( "Ecom:Product.Name" ); var productMetaDescription = GetString( "Ecom:Product.MetaDescription" ); var shareWithEmailBody = Translate( "shareWithEmailBody", "Jeg anbefaler dig at kigge på denne side:" ); var productType = GetString( "Ecom:Product.CategoryField.Product.Type.Value" ); } @if ( GetInteger( "Ecom:Product.PrimaryOrCurrentPageID" ) != Pageview.Page.ID ) { var redirect = "/Default.aspx?ID=" + GetString( "Ecom:Product.PrimaryOrCurrentPageID" ) + "&ProductID=" + GetString( "Ecom:Product.ID" ); if ( !string.IsNullOrEmpty( HttpContext.Current.Request.QueryString[ "variantID" ] ) ) { redirect += "&variantID=" + HttpContext.Current.Request.QueryString[ "variantID" ]; } HttpContext.Current.Response.Redirect( SearchEngineFriendlyURLs.GetFriendlyUrl( redirect ) ); } else if ( !String.IsNullOrEmpty( pageGroupPrimaryPageUrl ) ) { var currentPageUrl = "Default.aspx?Id=" + Pageview.Page.ID; if ( currentPageUrl.ToLower() != pageGroupPrimaryPageUrl.ToLower() ) { pageGroupPrimaryPageUrl = pageGroupPrimaryPageUrl + "&ProductID=" + GetString( "Ecom:Product.ID" ); HttpContext.Current.Response.Redirect( SearchEngineFriendlyURLs.GetFriendlyUrl( pageGroupPrimaryPageUrl ) ); } } @SnippetStart( "productTracking" ) <script> fbq('track', 'ViewContent', { content_name: '@productName', content_ids: ['@productId'], content_type: 'product', value: @productPriceDB, currency: 'DKK' }); </script> @SnippetEnd( "productTracking" ) <div id="product-container" data-pageId="@currentPageId" data-productId="@productId" data-variantId="@variantId" data-errorCombination1='@Translate( "combinationNotAvailable", "Kombinationen findes ikke" )'> <article class="col-xs-12 noPadding" id="product-description"> <div class="col-sm-8 col-xs-12 noPaddingLeft product-column" id="leftSide"> <div> <div class="smartbuttons"> <a href="javascript:window.print();" id="smart_print"></a> </div> <h2> @productName </h2> @if ( GetString( "Ecom:Product:Field.ShowFoaLogo.Value" ) == "True" ) { <div class="mask maskLeft"> <a href="/uber-juc/pflichtfortbildung-fur-fachanwalte-nach-§15-fao.aspx"> <img alt="" src="/Files/Templates/Designs/RizzoDesignFolder/images/foalogo_small.png" width="120px" /> </a> </div> } @if ( !String.IsNullOrEmpty( productImage ) ) { <div id="product-image"> <figure> <img class="img-responsive" src="@productGetImage" alt="@productName" title="@productName" /> </figure> </div> } <div id="product-description"> @if ( !String.IsNullOrEmpty( video ) ) { <video id="video" width="100%" preload controls poster="@poster" onclick="this.play();"> <source src="@video" type="video/mp4"> Din browser understøtter ikke video. </video> } <br /> @productDescription </div> <div class="share-wrapper"> <h2> <strong>@Translate( "shareSoMeHeader", "Share" )</strong> </h2> <div class="share-wrapper-inner"> <ul class="social-inner"> <li class="facebook"> <a class="dk-share" href="https://www.facebook.com/sharer/sharer.php?u=@productCanonical" title="Share on Facebook" alt="Share on Facebook" target="_blank"> <img alt="Facebook Icon" src="/Files/Images/Icons/facebook.png"> <p class="share-text">Facebook</p> </a> </li> <li class="linkedin"> <a class="dk-share" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=@productCanonical&amp;title=@productMetaTitle&amp;summary=@productMetaDescription" title="Share on LinkedIn" alt="Share on LinkedIn" target="_blank"> <img alt="LinkedIn Icon" src="/Files/Images/Icons/linkedin.png"> <p class="share-text">LinkedIn</p> </a> </li> <li class="epost"> <a class="share-email" href="mailto:?subject=@productMetaTitle&amp;body=@shareWithEmailBody @productCanonical" title="Share with e-mail"> <img alt="Email Icon" src="/Files/Images/Icons/email.png"> <p class="share-text">E-mail</p> </a> </li> </ul> </div> </div> </div> </div> <div id="rightSide" class="col-xs-12 col-sm-4 product-column noPaddingRight @stockStatusID"> @if ( stockStatusID != "STOCKSTATUS3" ) { <form name="addToCart" class="add-to-cart form-fields hidden-lg hidden-md hidden-sm" action="@SearchEngineFriendlyURLs.GetFriendlyUrl( currentPageId )" method="post" data-outofstock='@Translate( "outOfStock", "Out of stock" )'> <input name="cartcmd" type="hidden" value="add" /> <input type="hidden" name="productID" value="@productId" /> <input name="EcomOrderLineFieldInput_dateNow" type="hidden" value="" /> <input name="EcomOrderLineFieldInput_customerName" type="hidden" value="" /> <input name="EcomOrderLineFieldInput_email" type="hidden" value="" /> <input name="EcomOrderLineFieldInput_title" type="hidden" value="" /> <input type="hidden" name="EcomOrderLineFieldInput_MaterialIDSystem" value="" class="@productNumber" /> <textarea class="js-courseActivities" name="EcomOrderLineFieldInput_courseActivities" style="display:none"></textarea> <textarea class="js-courseLocation" name="EcomOrderLineFieldInput_courseLocation" style="display:none"></textarea> <a class="addToCartSubmit" href="javascript:void(0);" data-add='@Translate( "addToCart", "Læg i kurven" )' data-added='@Translate( "added", "Lagt til" )'> <img class="addToCartIcon" src="/files/templates/designs/rizzodesignfolder/images/svgicons/cart.svg"> @Translate( "addToCart_" + productType, "Læg i kurven" ) </a> <input class="hidden" type="submit" value='@Translate( "addToCart" )' /> </form> } <div style="float: left; width: 100%;"> @{ var productDay = 0; var productMonth = 0; var productYear = 0; productDay = GetInteger( "Ecom:Product:Field.Day.Value" ); productMonth = GetInteger( "Ecom:Product:Field.Month.Value" ); productYear = GetInteger( "Ecom:Product:Field.Year.Value" ); var courseIsActive = isActive( productMonth, productYear, productDay ); bool maskClassActive = false; if ( GetString( "Ecom:Product:Field.ShowFoaLogo.Value" ) == "True" ) { maskClassActive = true; } ; } @if ( areaid == "1" ) { @*Skriv mig op - Inaktive kurser*@ if ( !courseIsActive ) { <script>$(".add-to-cart").remove(); </script> } <h3 class="@( courseIsActive ? "hide" : "" )">@Translate( "Skriv mig op", "Skriv mig op" )</h3> <div class="@( courseIsActive ? "hide" : "" ) @( GetString( "Ecom:Product:Field.ShowFoaLogo.Value" ) == "True" ? "maskActiveClass" : "" )"> <p>@Translate( "Kurset er afholdt", "Kurset er afholdt, men hvis du er interesseret i at det genopsættes, så giv os besked. Klik på ”Skriv mig op” herunder og udfyld felterne." )</p> <p>&nbsp;</p> </div> <div id="signup_course"> <h3 class="@( courseIsActive ? "hide" : "" )" id="signup_header">@Translate( "Skriv mig op", "Skriv mig op" )</h3> <div id="signup_form" style="display: none"> @*Hidden signup form extranet + Forms for editors*@ @RenderParagraphContent( 744 ) @RenderParagraphContent( 748 ) <p>&nbsp;</p> </div> <script> $("#signup_header").click(function() { $("#signup_form").slideToggle(2000); }); </script> </div> } @*Lagerstatus = antal pladser*@ @if ( !String.IsNullOrEmpty( stock ) ) { if ( stockStatusID == "STOCKSTATUS3" ) { if ( areaid == "1" || areaid == "9" ) { @*Tilmeld venteliste - Aktive kurser*@ var styleDisplayWaitinglist = "display:block"; if ( courseIsActive ) { styleDisplayWaitinglist = "display:block"; } else { styleDisplayWaitinglist = "display:none"; } <h3 style="@styleDisplayWaitinglist" class="@stockStatusID">@Translate( "WaitinglistHeader", "Tilmeld venteliste" )</h3> <div style="@styleDisplayWaitinglist"> <p>@Translate( "WaitinglistIntro", "Aktiviteten er fyldt. Skriv dig hurtigt og nemt på ventelisten og kom foran, hvis der bliver en plads ledig." )</p> <p>&nbsp;</p> </div> <div id="Waitinglist_course"> <h3 style="@styleDisplayWaitinglist" id="Waitinglist_header">@Translate( "WaitinglistButton", "Tilmeld venteliste" )</h3> <div id="Waitinglist_form" style="display: none"> @if ( areaid == "1" ) { @RenderParagraphContent( 774 )<p>&nbsp;</p> } @if ( areaid == "9" ) { @RenderParagraphContent( 785 )<p>&nbsp;</p> } </div> <script> $("#Waitinglist_header").click(function() { $("#Waitinglist_form").slideToggle(2000); }); </script> </div> } } else if ( stockStatusID == "STOCKSTATUS2" && stockNumberInt < 8 ) { <h3>OBS!</h3> <p> @stock</p> <p>&nbsp;</p> } } @if ( !String.IsNullOrEmpty( nrLectures ) ) { <h3> @Translate( "lectures" ) </h3> if ( !String.IsNullOrEmpty( nrLecturesDecimal ) && nrLecturesDecimal != "0" ) { <p>@nrLecturesDecimal</p> } else { <p>@nrLectures</p> } } <p>&nbsp;</p> @if ( GetString( "Ecom:Product:Field.newDateFIelds.Value" ) == "True" ) { <div class="e-com-product-details e-com-product-field"> @{ // Here is a dictionary of all Custom Fields on a Product in Ecommerce Dictionary< string, string > seasons = new Dictionary< string, string >(); foreach ( LoopItem fieldList in GetLoop( "CustomFieldList" ) ) { // Here we check if the Fields SystemName contains the word season // We do that so we dont get any other Customer Fields if ( fieldList.GetString( "Ecom:CustomField.System" ).Contains( "season" ) ) { string system = fieldList.GetString( "Ecom:CustomField.System" ); foreach ( LoopItem item in GetLoop( "CustomFields" ) ) { string value = system + ".Value.Clean"; seasons.Add( system, item.GetString( value ) ); } } } // START: Current Course // This is where we show the current/present course DateTime currentDateTimeNow = DateTime.Now; DateTime outgoingStartDate = DateTime.ParseExact( GetString( "Ecom:Product:Field.outgoingStartDate.Value.Clean" ), "dd-MM-yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture ); <div class="CustomCouseActivity"> @if ( outgoingStartDate > currentDateTimeNow && !( GetString( "Ecom:Product:Field.outgoingHeadline.Value.Clean" ).Contains( "slet" ) ) ) { // Here we check if the current courses date is higher than DateTimeNow because current course have be bigger to be showed // We also check if the headline contains slet and we do that because we dont wanna show it if it contains slet <div class="e-com-product-details-current-season"> <h3> <strong>Nuværende sæson</strong><br> </h3> <br> @GetString( "Ecom:Product:Field.outgoingHeadline.Value.Clean" ) <br> <span style="text-transform: capitalize;">@outgoingStartDate.ToString( "dddd" )</span> <span>d.</span> <span>@outgoingStartDate.ToString( "dd" ).</span> <span>@outgoingStartDate.ToString( "MMMM" )</span> <span>@outgoingStartDate.ToString( "yyyy" )</span> <br> <span>Kl.</span> <span>@outgoingStartDate.ToString( "HH" ):@outgoingStartDate.ToString( "mm" )</span> <span>-</span> @{ // Here we make the Add To Calender button DateTime outgoingEndDate = DateTime.ParseExact( GetString( "Ecom:Product:Field.outgoingEndDate.Value.Clean" ), "dd-MM-yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture ); <span>@outgoingEndDate.ToString( "HH" ):@outgoingEndDate.ToString( "mm" )</span> if ( !String.IsNullOrEmpty( GetString( "Ecom:Product:Field.outgoingExtra.Value.Clean" ) ) ) { <br> @GetString( "Ecom:Product:Field.outgoingExtra.Value.Clean" ) } if ( GetString( "Ecom:Product:Field.showAddToCalendar.Value" ) == "False" ) { <span class="fullStartDate" style="display:none">@outgoingStartDate.ToString( "dd" )-@outgoingStartDate.ToString( "MM" )-@outgoingStartDate.ToString( "yyyy" ) @outgoingStartDate.ToString( "HH" ):@outgoingStartDate.ToString( "mm" )</span> <span class="fullEndDate" style="display:none">@outgoingEndDate.ToString( "HH" ):@outgoingEndDate.ToString( "mm" )</span> <br> <div class="addeventatc" title="Add to Calendar"> <span class="addeventatcText">+ @Translate( "Tilføj til kalender", "Tilføj til kalender" )</span> <span class="start"></span> <span class="end"></span> <span class="timezone">Europe/Danmark</span> <span class="title">JUC - @productName</span> <span class="description"></span> <span class="location">@courseEventLocation.Replace( "<br>", ", " )</span> </div> } } </div> <h3> <br><br><strong>Næste sæson</strong> </h3> // END: Current Course } @{ // START: Main courses int foreachCounter = 0; int foreachKeyCounter = 0; } <div class="e-com-product-details-next-season js-e-com-product-details-next-season"> @foreach ( KeyValuePair< string, string > seasonFields in seasons ) { // we do this check to see if it should continue until it see a new headline // That is because the loop goes systematic through each Custom Fields so if the loop meets a Headline there says slet we dont want the date and ExtraField from that date // Instead we want to move to the next Headline if ( foreachKeyCounter <= foreachCounter ) { if ( seasonFields.Key.Contains( "DateStart" ) ) { //Standard +1 for each counter foreachCounter = foreachCounter + 1; foreachKeyCounter = foreachKeyCounter + 1; // checking if its the first date field we meet if ( foreachKeyCounter == 2 ) { firstActivityStartDate = seasonFields.Value; } productFieldDateStart = DateTime.ParseExact( seasonFields.Value, "dd-MM-yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture ); // Here we write the full Start Date in a div there is hidden // This div is later copied with JS and moved down to Add To Calendar if ( GetString( "Ecom:Product:Field.showAddToCalendar.Value" ) == "False" ) { <span class="fullStartDate" style="display:none">@productFieldDateStart.ToString( "dd" )-@productFieldDateStart.ToString( "MM" )-@productFieldDateStart.ToString( "yyyy" ) @productFieldDateStart.ToString( "HH" ):@productFieldDateStart.ToString( "mm" )</span> } <span class="courseActivityWrap courseActivityWrapStartDate"> <span style="text-transform: capitalize;">@productFieldDateStart.ToString( "dddd" )</span> <span>d.</span> <span>@productFieldDateStart.ToString( "dd" ).</span> <span>@productFieldDateStart.ToString( "MMMM" )</span> <span>@productFieldDateStart.ToString( "yyyy" )</span> <br> <span>Kl.</span> <span>@productFieldDateStart.ToString( "HH" ):@productFieldDateStart.ToString( "mm" )</span> <span>-</span> </span> } else if ( seasonFields.Key.Contains( "DateEnd" ) ) { foreachCounter = foreachCounter + 1; foreachKeyCounter = foreachKeyCounter + 1; lastActivityEndDate = seasonFields.Value; // Here we write the full End Date in a div there is hidden // This div is later copied with JS and moved down to Add To Calendar DateTime productFieldDateEnd = DateTime.ParseExact( seasonFields.Value, "dd-MM-yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture ); if ( GetString( "Ecom:Product:Field.showAddToCalendar.Value" ) == "False" ) { <span class="fullEndDate" style="display:none">@productFieldDateEnd.ToString( "HH" ):@productFieldDateEnd.ToString( "mm" )</span> } <span class="courseActivityWrapEndDate"> <span>@productFieldDateEnd.ToString( "HH" ):@productFieldDateEnd.ToString( "mm" )</span> </span> } else if ( seasonFields.Key.Contains( "Headline" ) && seasonFields.Value.Contains( "slet" ) ) { foreachCounter = foreachCounter + 1; foreachKeyCounter = foreachKeyCounter + 4; continue; } else if ( seasonFields.Key.Contains( "Headline" ) && seasonFields.Value != "" ) { foreachCounter = foreachCounter + 1; foreachKeyCounter = foreachKeyCounter + 1; <span class="courseActivityWrap"> <br> @seasonFields.Value <br> </span> } else if ( seasonFields.Key.Contains( "Extra" ) && seasonFields.Value != "" ) { // Here we write the Extra Field and also Add To Calender foreachCounter = foreachCounter + 1; foreachKeyCounter = foreachKeyCounter + 1; <p class="courseActivityWrap" style="font-weight: normal"> @seasonFields.Value </p> if ( GetString( "Ecom:Product:Field.showAddToCalendar.Value" ) == "False" ) { <div class="addeventatc" title="Add to Calendar"> <span class="addeventatcText">+ @Translate( "Tilføj til kalender", "Tilføj til kalender" )</span> <span class="start"></span> <span class="end"></span> <span class="timezone">Europe/Danmark</span> <span class="title">JUC - @productName</span> <span class="description"></span> <span class="location">@courseEventLocation.Replace( "<br>", ", " )</span> </div> } } else if ( seasonFields.Key.Contains( "Extra" ) && seasonFields.Value == "" ) { // Here we only write Add To Calender and dont do the plus 1 to Counter because its the last one if ( GetString( "Ecom:Product:Field.showAddToCalendar.Value" ) == "False" ) { <div class="addeventatc" title="Add to Calendar"> <span class="addeventatcText">+ @Translate( "Tilføj til kalender", "Tilføj til kalender" )</span> <span class="start"></span> <span class="end"></span> <span class="timezone">Europe/Danmark</span> <span class="title">JUC - @productName</span> <span class="description"></span> <span class="location">@courseEventLocation.Replace( "<br>", ", " )</span> </div> } } } else { // here we plus to counter and continue to the next Custom Field in the Dictionary foreachCounter = foreachCounter + 1; continue; } // END: Main courses } </div> </div> // some of this is old Schema and some is new. It might need to be replaced SnippetStart( "organizationEvent" ); string eventName = GetString( "Ecom:Product.Name" ), eventURL = GetGlobalValue( "Global:Request.Scheme" ) + "://" + GetGlobalValue( "Global:Request.Host" ) + GetGlobalValue( "Global:Pageview.Url" ); DateTime productFieldDateStartMonth = DateTime.ParseExact( firstActivityStartDate, "dd-MM-yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture ); DateTime productFieldDateEndHour = DateTime.ParseExact( lastActivityEndDate, "dd-MM-yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture ); dynamic organization = new ExpandoObject(); organization.Name = eventName; organization.Url = eventURL; organization.Description = productIntro; organization.Email = "juc@juc.dk"; organization.Locality = "Danmark"; organization.ZipCode = "1620"; organization.StreetAddress = courseEventLocation.Replace( "<br>", ", " ); organization.Phone = "+45 70 20 82 60"; organization.OpeningHours = ""; organization.PriceRange = productPrice.Replace( ",00", "" ); organization.PriceCurrency = "DKK"; organization.Image = "http://juc.dk" + productGetImage; organization.firstActivityStartDate = firstActivityStartDate; organization.activityEnd = productFieldDateStart.ToString( "dd-MM-yyyy" ) + " " + productFieldDateEndHour.ToString( "HH:mm" ); var organizationEvent = new HtmlString( string.Format( @" {{ ""@context"" : ""http://schema.org"", ""@type"" : ""Event"", ""name"": ""{0}"", ""startDate"": ""{12}"", ""endDate"": ""{13}"", ""location"": {{ ""@type"": ""Place"", ""name"": ""JUC"", ""address"": {{ ""@type"": ""PostalAddress"", ""streetAddress"": ""{6}"", ""addressLocality"": ""{4}"", ""postalCode"": ""{5}"", ""addressRegion"": ""DK"" }} }}, ""image"": [ ""{11}"" ], ""description"": ""{2}"", ""offers"": {{ ""@type"": ""Offer"", ""url"": ""{1}"", ""price"": ""{9}"", ""priceCurrency"": ""DKK"", ""validFrom"": ""{12}"" }}, ""performer"": {{ ""@type"": ""Organization"", ""name"": ""JUC"" }} }} ", organization.Name, // 0 organization.Url, // 1 organization.Description, // 2 organization.Email, // 3 organization.Locality, // 4 organization.ZipCode, // 5 organization.StreetAddress, // 6 organization.Phone, // 7 organization.OpeningHours, // 8 organization.PriceRange, // 9 organization.PriceCurrency, // 10 organization.Image, // 11 organization.firstActivityStartDate, //12 organization.activityEnd //13 ) ); SnippetEnd( "organizationEvent" ); SnippetStart( "organizationCourseCourse" ); dynamic organizationCourse = new ExpandoObject(); organizationCourse.Name = eventName; organizationCourse.Url = eventURL; organizationCourse.Description = productIntro; var organizationCourseCourse = new HtmlString( string.Format( @" {{ ""@context"" : ""http://schema.org"", ""@type"" : ""Course"", ""name"": ""{0}"", ""description"": ""{2}"", ""provider"": {{ ""@type"": ""Offer"", ""name"": ""JUC"", ""SameAs"": ""{1}"" }} }} ", organizationCourse.Name, // 0 organizationCourse.Url, // 1 organizationCourse.Description // 2 ) ); } @SnippetEnd( "organizationCourseCourse" ) <script type="application/ld+json"> @organizationEvent </script> <script type="application/ld+json"> @organizationCourseCourse </script> </div> <div class="courseLocation"> <p> <br> <br> <b>JUC</b> </p> <p> @courseEventLocation </p> </div> } <p>&nbsp;</p> @if ( GetString( "Ecom:Product:Field.newDateFIelds.Value" ) == "False") { <span class="e-com-product-details"> @productDetails </span> } <p>&nbsp;</p> <h3> @Translate( "priceDetails" ) </h3> <p class="price @productPrice"> @currencyCode @productPrice.Replace( ",00", "" ) </p> @if ( stockStatusID != "STOCKSTATUS3" && courseIsActive ) { <form name="addToCart" class="add-to-cart form-fields hidden-xs" action="@SearchEngineFriendlyURLs.GetFriendlyUrl( currentPageId )" method="post" data-outofstock='@Translate( "outOfStock", "Out of stock" )'> <input name="cartcmd" type="hidden" value="add" /> <input type="hidden" name="productID" value="@productId" /> <input name="EcomOrderLineFieldInput_dateNow" type="hidden" value="" /> <input name="EcomOrderLineFieldInput_customerName" type="hidden" value="" /> <input name="EcomOrderLineFieldInput_email" type="hidden" value="" /> <input name="EcomOrderLineFieldInput_title" type="hidden" value="" /> <input type="hidden" name="EcomOrderLineFieldInput_MaterialIDSystem" value="" class="@productNumber" /> <textarea class="js-courseActivities" name="EcomOrderLineFieldInput_courseActivities" style="display:none"></textarea> <textarea class="js-courseLocation" name="EcomOrderLineFieldInput_courseLocation" style="display:none"></textarea> <a class="addToCartSubmit addToCartSubmitDesktop" href="javascript:void(0);" data-add='@Translate( "addToCart", "Læg i kurven" )' data-added='@Translate( "added", "Lagt til" )'> <img class="addToCartIcon" src="/files/templates/designs/rizzodesignfolder/images/svgicons/cart.svg"> @Translate( "addToCart_" + productType, "Læg I kurven" ) </a> @*FLY TO CART*@ <style> .product-clone { position: fixed; z-index: 9999; } </style> <script> $(document).ready(function() { if (0 < $('.addToCartSubmit').length) { $('.addToCartSubmit').click(function() { var offset = $("#leftSide").offset(); $("#leftSide").clone().addClass('product-clone').css({ 'left': offset.left + 'px', 'top': parseInt(offset.top - $(window).scrollTop()) + 'px', 'width': $("#leftSide div").parent().width() + 'px', 'height': $("#leftSide div").parent().height() + 'px' }).appendTo($('#leftSide').parent()); var cart = $('nav li.myCart a span').offset(); $('.product-clone').animate( { top: parseInt(cart.top - $(window).scrollTop()) + 'px', left: cart.left + 'px', 'height': '0px', 'width': '0px' }, 800, function() { $(this).remove(); }); }); } }); </script> <input class="hidden" type="submit" value='@Translate( "addToCart" )' /> </form> } @if ( areaid == "1" ) { @*Hold mig opdateret- Aktive kurser*@ @*<h3 style="@(courseIsActive ? "" : "hide")">@Translate("Hold mig opdateret", "Hold mig opdateret")</h3>*@ <div style="@( courseIsActive ? "" : "hide" )"> <p class="keepMeUpdatedIntro" style="display: none">@Translate( "keepMeUpdatedIntro", "" )</p> <p>&nbsp;</p> </div> <div id="keepMeUpdated_course"> <h3 style="@( courseIsActive ? "" : "hide" )" id="keepMeUpdated_header">@Translate( "keepMedUpdatedHeader", "Hold mig opdateret" )</h3> <div id="keepMeUpdated_form" style="display: none"> @RenderParagraphContent( 761 ) </div> <script> $("#keepMeUpdated_header").click(function() { $("#keepMeUpdated_form").slideToggle(2000); }); </script> </div> } </div> @if ( GetString( "Ecom:Product:Field.ShowFoaLogo.Value" ) == "True" ) { <div class="mask maskRight"> <a href="/uber-juc/pflichtfortbildung-fur-fachanwalte-nach-§15-fao.aspx" target="_blank"> <img alt="" src="/Files/Templates/Designs/RizzoDesignFolder/images/foalogo_small.png" width="120px" /> </a> </div> } </div> <div class="col-lg-8 col-xs-12 noPadding product-column"> @foreach ( var group in relatedGroupsList ) { @*teachers*@ if ( group.GetString( "Ecom:Product:RelatedGroup.GroupID" ) == "RELGRP2" ) { var relatedProdsList = group.GetLoop( "Products" ); if ( relatedProdsList.Any() ) { string teacherName = "", teacherDescription = "", teacherLink = "", teacherImage = "", teacherTeaser = "", teachersTitle = relatedProdsList.Count() > 1 ? Translate( "teachers", "Undervisere" ) : Translate( "teacher", "Underviser" ); if ( groupId == "GROUP4" || groupId == "GROUP29" || groupId == "GROUP32" || groupId == "GROUP41" ) { teachersTitle = relatedProdsList.Count() > 1 ? Translate( "Netværksledelse", "Netværksledelse" ) : Translate( "Netværksledelse", "Netværksledelse" ); } <div class="teachers" id="leftSideOuter"> <div class='teachers-container'> <h2> @teachersTitle </h2> <div id="listContainer"> <ul class="productsList row teachersOuter" data-list id="productsList"> @foreach ( var prod in relatedProdsList ) { teacherName = prod.GetString( "Ecom:Product.Name" ); teacherDescription = prod.GetString( "Ecom:Product.ShortDescription" ); teacherImage = GetImagePathUrl( prod.GetString( "Ecom:Product.ImageSmall.Clean" ), prod.GetString( "Ecom:Product.ImageMedium.Clean" ), prod.GetString( "Ecom:Product.ImageLarge.Clean" ), "*" ); teacherImage = GetImage( teacherImage, 0, 600 ); teacherLink = "Default.aspx?ID=" + prod.GetString( "Ecom:Product.PrimaryOrCurrentPageID" ) + "&ProductID=" + prod.GetString( "Ecom:Product.ID" ); if ( !String.IsNullOrEmpty( teacherDescription ) && !String.IsNullOrEmpty( teacherLink ) && !String.IsNullOrEmpty( teacherImage ) && !String.IsNullOrEmpty( teacherName ) ) { <li> <div class="col-xs-12 noPadding"> <figure class="col-xs-2 noPadding"> <a href="@teacherLink"> <img src="@teacherImage" title="@teacherName" alt="@teacherName" class="img-responsive" /> </a> </figure> <div class="col-xs-10"> <h3> <a itemprop="name" href="@teacherLink"> @teacherName </a> </h3> @if ( !String.IsNullOrEmpty( teacherDescription ) ) { <div class="shortDescription tileHide"> <a itemprop="name" href="@teacherLink"> <p> @Dynamicweb.Base.TeaserString( StripHtml( teacherDescription ), 120, "..." ) </p> </a> </div> } </div> </div> </li> } } </ul> </div> </div> </div> } } } @foreach ( var group in relatedGroupsList ) { @*ansvarlig*@ if ( group.GetString( "Ecom:Product:RelatedGroup.GroupID" ) == "RELGRP10" ) { var responsibleProdsList = group.GetLoop( "Products" ); if ( responsibleProdsList.Any() ) { string responsibleName = "", responsibleDescription = "", responsibleLink = "", responsibleImage = "", responsibleTeaser = "", responsibleTitle = ""; responsibleTitle = responsibleProdsList.Count() > 0 ? Translate( "Ansvarlig", "Ansvarlig" ) : Translate( "Ansvarlig", "Ansvarlig" ); <div class="responsible" id="leftSideOuter"> <div class='teachers-container @group.GetString( "Ecom:Product:RelatedGroup.GroupID" )'> <h2> @responsibleTitle </h2> <div id="listContainer"> <ul class="productsList row teachersOuter" data-list id="productsList"> @foreach ( var prod in responsibleProdsList ) { responsibleName = prod.GetString( "Ecom:Product.Name" ); responsibleDescription = prod.GetString( "Ecom:Product.ShortDescription" ); responsibleImage = GetImagePathUrl( prod.GetString( "Ecom:Product.ImageSmall.Clean" ), prod.GetString( "Ecom:Product.ImageMedium.Clean" ), prod.GetString( "Ecom:Product.ImageLarge.Clean" ), "*" ); responsibleImage = GetImage( responsibleImage, 0, 600 ); responsibleLink = "Default.aspx?ID=" + prod.GetString( "Ecom:Product.PrimaryOrCurrentPageID" ) + "&ProductID=" + prod.GetString( "Ecom:Product.ID" ); <li> <div class="col-xs-12 noPadding"> <figure class="col-xs-2 noPadding"> <a href="@responsibleLink"> <img src="@responsibleImage" title="@responsibleName" alt="@responsibleName" class="img-responsive" /> </a> </figure> <div class="col-xs-10"> <h3> <a itemprop="name" href="@responsibleLink"> @responsibleName </a> </h3> @if ( !String.IsNullOrEmpty( responsibleDescription ) ) { <div class="shortDescription tileHide"> <a itemprop="name" href="@responsibleLink"> <p> @Dynamicweb.Base.TeaserString( StripHtml( responsibleDescription ), 120, "..." ) </p> </a> </div> } </div> </div> </li> } </ul> </div> </div> </div> } } } </div> @*relaterede produkter*@ <div class="col-lg-4 col-xs-12 noPadding product-column product-right-column"> @if ( GetLoop( "ProductRelatedGroups" ).Any() ) { var miscdebug = ""; <div> @foreach ( var group in relatedGroupsList ) { if ( group.GetString( "Ecom:Product:RelatedGroup.GroupID" ) == "RELGRP1" ) { var prodsList = group.GetLoop( "Products" ); if ( prodsList.Any() ) { string groupName = group.GetString( "Ecom:Product:RelatedGroup.Name" ), groupID = group.GetString( "Ecom:Product:RelatedGroup.GroupID" ), relatedProductName = "", relatedProductLink = "", relatedProductDesc = "", relatednrLectures = "", relatednrLecturesDecimal = "", relatedProductMonth = "", moduleNumber = "", ShowDateOnList = "", relatedProductGroupID = ""; var productMonthRel = 0; var productYearRel = 0; var productDayRel = 0; var relatedProductIndex = 0; var monthNames = DateTimeFormatInfo.CurrentInfo.AbbreviatedMonthNames; <div class="related-products-legend top">@Translate( "relatedProducts", "Relaterede produkter" )</div> <ul class="relatedOuter related-products"> @foreach ( LoopItem relatedProduct in prodsList.OrderBy( x => x.GetInteger( "Ecom:Product:Field.Year.Value" ) ).ThenBy( x => x.GetInteger( "Ecom:Product:Field.Month.Value" ) ).ThenBy( x => x.GetInteger( "Ecom:Product:Field.Day.Value" ) ) ) { miscdebug = ""; try { relatedProductIndex++; relatedProductName = relatedProduct.GetString( "Ecom:Product.Name" ); relatedProductLink = relatedProduct.GetString( "Ecom:Product.LinkGroup.Clean" ); relatedProductDesc = Dynamicweb.Base.TeaserString( StripHtml( relatedProduct.GetString( "Ecom:Product.ShortDescription" ) ), 80, "..." ); relatednrLectures = relatedProduct.GetString( "Ecom:Product:Field.Lectures.Value.Clean" ); relatednrLecturesDecimal = relatedProduct.GetString( "Ecom:Product:Field.LecturesDecimal.Value.Raw" ); productMonthRel = relatedProduct.GetInteger( "Ecom:Product:Field.Month.Value" ); productYearRel = relatedProduct.GetInteger( "Ecom:Product:Field.Year.Value" ); productDayRel = relatedProduct.GetInteger( "Ecom:Product:Field.Day.Value" ); moduleNumber = relatedProduct.GetString( "Ecom:Product:Field.moduleNummer" ); ShowDateOnList = relatedProduct.GetString( "Ecom:Product:Field.ShowDateOnList" ); relatedProductMonth = monthNames[ productMonthRel - 1 ]; relatedProductGroupID = relatedProduct.GetString( "Ecom:Product.PrimaryGroupID" ); var relCourseIsActive = isActive( productMonthRel, productYearRel, productDayRel ); //string relatedProductMod2Class = "mod" + (relatedProductIndex % 2).ToString(); int productDateStartInt = 0; string myDateTime = relatedProduct.GetString( "Ecom:Product:Field.season01Activity01DateStart.Value.Clean" ); DateTime productDateStart = DateTime.Now; if ( !String.IsNullOrEmpty( myDateTime ) ) { productDateStart = DateTime.ParseExact( myDateTime, "dd-MM-yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture ); productDateStartInt = ( int ) productDateStart.Day; } miscdebug = relatedProduct.GetString( "Ecom:Product.PrimaryGroupID" ) + "-----"; Dynamicweb.eCommerce.Products.Group relatedGroup = Dynamicweb.eCommerce.Products.Group.GetGroupByID( relatedProductGroupID ); if ( !relatedGroup.IsTopGroup ) { string relatedProductGroupPrimaryParentGroupID = relatedGroup.PrimaryParentGroupID; if ( relatedGroup.ParentGroups.Any() ) { relatedGroup = !String.IsNullOrEmpty( relatedProductGroupPrimaryParentGroupID ) ? relatedGroup.ParentGroups.Where( x => x.ID == relatedProductGroupPrimaryParentGroupID ).First() : relatedGroup.ParentGroups.First(); } } string relatedProductGroupColor = relatedGroup.ProductGroupFieldValues.GetProductGroupFieldValue( "Color" ).Value.ToString(); <li class="related-product-item @relatedProductGroupColor @relatedProductName @( relCourseIsActive ? "" : "hide" )"> <div> <div class="related-info"> <ul> <li class="productDate"> <div> @if ( relatedProduct.GetString( "Ecom:Product:Field.newDateFIelds.Value" ) != "False" && productDateStart != DateTime.Now ) { <strong class="newDateStartInt">@productDateStartInt</strong> <span>@productDateStart.ToString( "MMMM" ).Substring( 0, 3 )</span> } else { if ( ShowDateOnList == "False" ) { <strong>@relatedProduct.GetString( "Ecom:Product:Field.Day.Value" )</strong> <span>@relatedProductMonth</span> } } </div> </li> <li class="productLessons"> <div> @if ( !String.IsNullOrEmpty( relatednrLecturesDecimal ) && relatednrLecturesDecimal != "0" ) { <strong>@relatednrLecturesDecimal</strong> } else { <strong>@relatednrLectures</strong> } <span>@Translate( "ShortLectures", "Lekt." )</span> </div> </li> </ul> </div> <div class="related-details"> <h3> <a href="@relatedProductLink" title="@relatedProductName"> @relatedProductName </a> </h3> @if ( !String.IsNullOrEmpty( moduleNumber ) && moduleNumber != "0" ) { <span class="productModuleNumberText">modul<span class="productModuleNumber">@moduleNumber</span></span> } @*<div> <a href="@relatedProductLink" title="@relatedProductName"> @relatedProductDesc </a> </div>*@ </div> </div> <a href="@relatedProductLink" title="@relatedProductName" class="overlayLink">@relatedProductName</a> </li> } catch ( Exception ee ) { <div> Fejl: @ee.ToString() <br /><br /> @miscdebug </div> } } </ul> } } } </div> } </div> </article> </div> @SnippetStart( "breadCrumb" ) <li>&nbsp;|&nbsp;</li> <li> <a href="@pageGroupUrl">@parentGroupName</a> </li> @SnippetEnd( "breadCrumb" ) @SnippetStart( "OGMeta" ) @{ if ( !String.IsNullOrEmpty( OpenGraphTitle ) ) { <meta property="og:title" content='@OpenGraphTitle' /> } else { <meta property="og:title" content='@productName' /> } if ( !String.IsNullOrEmpty( OpenGraphDescription ) ) { <meta property="og:description" content='@OpenGraphDescription' /> } else { <meta property="og:description" content='@StripHtml( productIntro )' /> } if ( !String.IsNullOrEmpty( OpenGraphImage ) ) { <meta property="og:image" content='@Pageview.GlobalTags.GetTagByName( "Global:Request.Scheme" ).Value://@Pageview.GlobalTags.GetTagByName( "Global:Request.Host" ).Value/@OpenGraphImage' /> } else { <meta property="og:image" content='@Pageview.GlobalTags.GetTagByName( "Global:Request.Scheme" ).Value://@Pageview.GlobalTags.GetTagByName( "Global:Request.Host" ).Value@imagePattern' /> } } <meta property="og:site_name" content='@areaItem[ "CompanyName" ]' /> <meta property="og:url" content='@Pageview.GlobalTags.GetTagByName( "Global:Request.Scheme" ).Value://@Pageview.GlobalTags.GetTagByName( "Global:Request.Host" ).Value@( Pageview.GlobalTags.GetTagByName( "Global:Pageview.Url" ).Value )' /> <meta content="article" property="og:type" /> <meta property="og:locale" content='@Pageview.GlobalTags.GetTagByName( "Global:Area.LongLang" ).Value.Replace( "-", "_" )' /> @SnippetEnd( "OGMeta" ) @SnippetStart( "jsOnLoad" ) onLoadProductDetail(); @SnippetEnd( "jsOnLoad" ) @functions { public static string StripHtml( string source ) { return Regex.Replace( source, "<.*?>", string.Empty ); } public bool isActive( int productMonth, int productYear, int productDay ) { DateTime productDate = new DateTime( productYear, productMonth, productDay ); DateTime localDate = DateTime.Now; int result = DateTime.Compare( productDate, localDate ); if ( result > 0 ) { return true; } return false; } }