Error executing template "Designs/exhibition_site/eCom/Product/MCH365-case.cshtml"
System.Exception: _dynamicwebProduct is not Active. Settings are: {"Presentation":null,"Booth":null,"Product":null,"Id":"Pb06adb3b28dfa2c9ac6234ee77e09","LanguageId":null,"VariantId":"","PrimaryVariantId":"","EmbeddedInModelList":true}
at Co3.Espresso.Website.Models.FrontEnd.Ecommerce.EspressoProduct.Populate(ProductSettings settings) in F:\TeamCity\BuildAgent 1\work\ea1444d680f7414e\Co3.Espresso.Website\Models\FrontEnd\Ecommerce\EspressoProduct.cs:line 755
at Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce.ProfileProduct.Populate(ProductSettings settings) in C:\git\co3.mch\Co3.MCH.Website.Frontend\Models\Frontend\Ecommerce\ProfileProduct.cs:line 61
at Co3.MCH.Website.Frontend.Services.Ecommerce.ProductService.GetEspressoProduct(ProductSettings settings, String key) in C:\git\co3.mch\Co3.MCH.Website.Frontend\Services\Ecommerce\ProductService.cs:line 59
at Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce.CaseProduct.GetProfileProduct() in C:\git\co3.mch\Co3.MCH.Website.Frontend\Models\Frontend\Ecommerce\CaseProduct.cs:line 89
at Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce.CaseProduct.get_Profile() in C:\git\co3.mch\Co3.MCH.Website.Frontend\Models\Frontend\Ecommerce\CaseProduct.cs:line 81
at CompiledRazorTemplates.Dynamic.RazorEngine_3ae661f1718f40ab91d5a02ecdae9082.Execute() in E:\dynamicweb.net\Solutions\mch365.espresso5.dk\Files\Templates\Designs\exhibition_site\eCom\Product\MCH365-case.cshtml:line 27
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 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module
2 @using System.Web
3 @using Co3.Espresso.Base.Extensions
4 @using Co3.Espresso.Website.Services
5 @using Co3.Espresso.Website.Models.FrontEnd
6 @using Co3.Espresso.Website.Models.FrontEnd.Settings
7 @using Co3.MCH.Data.Models.MCH365
8 @using Co3.MCH.Website.Frontend.Models.Frontend
9 @using Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce
10 @using Co3.MCH.Website.Frontend.Models.Frontend.MCH365
11 @using Co3.MCH.Website.Frontend.Models.Frontend.Users
12 @using Dynamicweb.Frontend
13 14 @{
15 CaseProduct caseProduct = (CaseProduct) Co3.MCH.Website.Frontend.Services.Ecommerce.ProductService.Instance.GetEspressoProduct(
16 new ProductSettings()
17 {
18 Id = GetString("Ecom:Product.ID"),
19 VariantId = GetString("Ecom:Product.VariantID"),
20 PrimaryVariantId = GetString("Ecom:Product.DefaultVariantComboID"),
21 EmbeddedInModelList = true
22 }, nameof(CaseProduct)
23 );
24 25 string tradeshowName = MCH365Context.Current.TradeShowDetails.Name;
26 string tradeshowCode = PageView.Current().Area.Item[ "TradeShowCode" ].ToString();
27 bool hasPresentation = caseProduct.Profile?.HasPresentation != null && caseProduct.Profile.HasPresentation && caseProduct.Profile.ContactPersons.Products.Any();
28 29 string latestProductlistPage = SearchEngineFriendlyURLs.GetFriendlyUrl( PageView.Current().Page.Parent.GetPageHrefValue() );
30 if ( UserContext.Current.LatestProductListPageIds.ContainsKey( "case" ) )
31 {
32 latestProductlistPage = SearchEngineFriendlyURLs.GetFriendlyUrl( string.Format("Default.aspx?ID={0}", UserContext.Current.LatestProductListPageIds["case"]) );
33 } else if ( UserContext.Current.LatestProductListPageIds.ContainsKey( "articlemerge" ) )
34 {
35 latestProductlistPage = SearchEngineFriendlyURLs.GetFriendlyUrl( string.Format("Default.aspx?ID={0}", UserContext.Current.LatestProductListPageIds["articlemerge"]) );
36 }
37 38 string caseProductImage = "/admin/public/getimage.ashx?Image=" + caseProduct.Image + "&Width=1280&Height=720&Format=webp&Quality=75&Crop=0";
39 string caseImage = !string.IsNullOrEmpty(caseProductImage) ? caseProductImage : MCH365Context.Current.TradeShowDetails.Logo;
40 41 string caseName = caseProduct.Name.Replace("\"", "'");
42 string caseDescriptionFormatted = caseProduct.DescriptionFormatted;
43 string caseDescriptionFormattedStrippedHtml = caseDescriptionFormatted.StripHtml();
44 45 string caseDescriptionFormattedMetaDesc = !string.IsNullOrEmpty(caseDescriptionFormattedStrippedHtml) ? caseDescriptionFormattedStrippedHtml : caseName;
46 47 if ( caseDescriptionFormattedStrippedHtml.Length > 160 )
48 {
49 caseDescriptionFormattedMetaDesc = !string.IsNullOrEmpty(caseDescriptionFormattedStrippedHtml) ? caseDescriptionFormattedStrippedHtml.Substring(0, 160) : caseName;
50 }
51 }
52 53 @RenderingService.Instance.SectionEnd()
54 @RenderingService.Instance.SectionStart(new SectionSettings
55 {
56 Classes = new ClassList("e-section mch365-custom-article-details-wrapper")
57 })
58 59 <div class="col-12 p-columns mch365-custom-product-details-wrapper-main-content">
60 <div class="row mt-2 mt-md-4">
61 <div class="col-12">
62 <div class="row">
63 <div class="col-12 col-md-7 col-lg-8 mb-5 mb-md-0 p-columns">
64 <div class="row">
65 <div class="col-12 col-md-11">
66 <h1 class="mega mb-half">@caseProduct.Name</h1>
67 <a class="align-self-center arrow-left d-block mb-2 mt-1 small" href="@latestProductlistPage"><i class="material-icons material-icons-large d-none">arrow_back</i>@Translate("MCH365 - To Overview - Link", "Til oversigten")</a>
68 69 <p class="mt-0">
70 @caseProduct.Created.ToLongEspressoFormat()
71 @if (caseProduct.Profile?.Company?.Name != null)
72 {
73 <span class="d-md-none">
74 | <a class="text-black" href="@(PageView.Current().SearchFriendlyUrl)#companyInfo"> @caseProduct.Profile.Company.Name </a>
75 </span>
76 }
77 </p>
78 79 @if ( caseProduct.CategoryFieldValues.Any() )
80 {
81 <ul class="mch365-custom-product-product-details-categories-list">
82 @foreach ( KeyValuePair< string, CategoryFieldValue > subcategory in caseProduct.CategoryFieldValues )
83 {
84 string filterValue = string.Format( "C{0}|{1}", tradeshowCode, subcategory.Key );
85 <li>
86 <a href="@(latestProductlistPage)?PresentationCategory=@filterValue">@subcategory.Value.FieldLabel</a>
87 </li>
88 }
89 </ul>
90 }
91 92 @if (caseProduct.Image != "")
93 {
94 <div class="mch365-list-item-image-container image-ratio-16-9 mb-3">
95 <a class="mch365-download-full-image" href="@caseProduct.Image" download>
96 <i class="material-icons">download</i>
97 <span class="mch365-download-full-image-text">@Translate( "MCH365 - Button - Download full image - Text", "Kun til redaktionelt brug" )</span>
98 </a>
99 <img src="/admin/public/getimage.ashx?Image=@caseProduct.Image&Width=1280&Height=720&Format=webp&Quality=75&Crop=0" class="p-img p-img-corner-rounded" alt="">
100 </div>
101 }
102103 @if (caseProduct.DescriptionFormatted != "")
104 {
105 <p>
106 @caseProduct.DescriptionFormatted
107 </p>
108 }
109110 @if (caseProduct.Links.Any())
111 {
112 <div class="mt-2">
113 @foreach (LinkContainer link in caseProduct.Links)
114 {
115 if (!string.IsNullOrEmpty(link.Link) && !string.IsNullOrEmpty(link.Title))
116 {
117 <a target="_blank" href="@link.Link">@link.Title</a><br/>
118 }
119 }
120 </div>
121 }
122 </div>
123 </div>
124 @if (caseProduct.Profile?.Company?.Name != null)
125 {
126 @RenderingService.Instance.PartialView("ecom/product/partials/case-details/MCH365-related-cases.cshtml", caseProduct)
127 }
128 </div>
129 <div class="col-12 col-md-5 col-lg-4 p-columns">
130 <div class="row">
131 <div class="col-12">
132 <div class="row no-gutters">
133 @if (caseProduct.Profile?.Company?.Name != null)
134 {
135 <div class="col-12 bg-gradient border-radius p-2 mch365-custom-product-details-sidebar mt-4 mb-4" id="companyInfo">
136 @if (caseProduct.Profile?.Company?.Logo != null)
137 {
138 string logoImage = caseProduct.Profile.Company.Logo;
139 string companyBackgroundColor = caseProduct.Profile.Company.BrandColor;
140141 string noCompanyInfo = "";
142 string textLight = "e-text-light";
143144 if (string.IsNullOrEmpty(logoImage) && string.IsNullOrEmpty(companyBackgroundColor))
145 {
146 noCompanyInfo = "bg-light";
147 textLight = "text-muted";
148 }
149150 string noLogoBackground = "";
151 if (string.IsNullOrEmpty(logoImage) && !string.IsNullOrEmpty(companyBackgroundColor))
152 {
153 noLogoBackground = "style=\"background:" + companyBackgroundColor + ";\"";
154 }
155 <span class="d-block px-custom-logo mx-auto mb-3">
156 <div class="e-productlist-item-image-container border-radius-double @noCompanyInfo" @noLogoBackground>
157158159 <div class="e-productlist-item-image-wrapper justify-content-center align-items-center d-flex @textLight">
160 @{
161 if (string.IsNullOrEmpty(logoImage))
162 {
163 <span class="h1 mb-0">@caseProduct.Profile.Company.Name.Substring(0,1).ToLower()</span>
164 }
165 else
166 {
167 <img alt="@caseProduct.Profile.Company.Name" class="e-productlist-item-image w-100 p-1" src="@(caseProduct.Profile.Company.Logo)">
168 }
169 }
170 </div>
171 </div>
172 </span>
173 }
174 <p class="small mb-half">@Translate("MCH365 - Case details CreatedBy - Heading", "Casen er skrevet af:")</p>
175 <h4 class="mt-0 mb-2">@caseProduct.Profile.Company.Name</h4>
176 <p class="small line-clamp-10">
177 @Co3.MCH.Website.Frontend.Services.Ecommerce.ProductService.Instance.GetTruncatedFormattedString(caseProduct.Profile.Company.Description, 600)
178 </p>
179180 <a class="btn btn-transparent mt-2" href="@caseProduct.Profile.Link">
181 @Translate("MCH365 - Case details ExhibitorProfile - Link", "Se profil")
182 </a>
183 </div>
184 }
185 @if (hasPresentation)
186 {
187 <div class="col-12 ">
188 <h2 class="small mb-2">@Translate("MCH365 - Case details MeetUsAt - Text", "Mød os på") @tradeshowName</h2>
189 <div class="row e-productlist-container">
190 @foreach (ContactPersonProduct contact in caseProduct.Profile.ContactPersons.Products.Select(p => (ContactPersonProduct) p))
191 {
192 <div class="col-12">
193 @contact.ListItemHtml
194 </div>
195 }
196 </div>
197 </div>
198 }
199 </div>
200 </div>
201 </div>
202 </div>
203 </div>
204 </div>
205 </div>
206 </div>
207208 @RenderingService.Instance.SectionEnd()
209 @RenderingService.Instance.SectionStart(new SectionSettings())
210211 @SnippetStart("profileProductCompanyDescription")@caseDescriptionFormattedMetaDesc@SnippetEnd("profileProductCompanyDescription") @* Avoid using linebreaks in this snippet, as it will also add linebreaks to the content *@
212 @SnippetStart("profileProductCompanyName")@caseName@SnippetEnd("profileProductCompanyName") @* Avoid using linebreaks in this snippet, as it will also add linebreaks to the content *@
213 @SnippetStart("profileProductCompanyLogo")@caseImage@SnippetEnd("profileProductCompanyLogo") @* Avoid using linebreaks in this snippet, as it will also add linebreaks to the content *@