Error executing template "/Designs/HagsCore/Paragraph/AssetsSearch.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_62d15804bc3a49808472a5d68b6f8b56.Execute() in C:\Projects\Hags_Dw9\Files\Templates\Designs\HagsCore\Paragraph\AssetsSearch.cshtml:line 887
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System.Web.Optimization; 3 @using Dynamicweb.Ecommerce.Variants; 4 @{ 5 string validationMessages = string.Format("messages_{0}.min.js", GetGlobalValue("Global:Area.Lang")); 6 string areaLanguage = GetGlobalValue("Global:Area.Lang"); 7 string customErrorMessage = HagsWeb.Library.Utilities.DWUtilities.GetTranslation("AdvancedSearchError", "You must provide a Product Code or a Product Name for your Search", GetGlobalValue("Global:Area.LongLang")); 8 } 9 10 @*@Scripts.Render("~/bundle/AssetSearch") 11 12 @if (areaLanguage != "en") 13 { 14 // non english validation messages 15 <script src="/Files/Templates/Designs/HagsCore/script/source/libraries/validation/localization/@validationMessages"></script> 16 }*@ 17 18 <input type="hidden" id="CultureLanguage" value="@GetGlobalValue("Global:Area.LongLang")" /> 19 <input type="hidden" id="PageID" value="@GetGlobalValue("Global:Page.ID")" /> 20 <input type="hidden" id="ErrorMessage" value="@customErrorMessage" /> 21 22 <div id="advancedSearch"> 23 <div class="m-search-primary"> 24 <div class="text-center"> 25 <ul> 26 <li><a class="m-btn-search-options btn btn-default text-uppercase" role="button" href="#advancedsearch-ui" data-toggle="tab">@Translate("AdvancedSearch", "Advanced Search")</a></li> 27 <li><a class="m-btn-search-options btn btn-default text-uppercase" role="button" href="#downloadfinder" data-toggle="tab">@Translate("ProductDownloads", "Product Downloads")</a></li> 28 <li><a class="m-btn-search-options btn btn-default text-uppercase" role="button" href="#productcollection" data-toggle="tab">@Translate("MyProductCollection", "My Product Collection")</a></li> 29 <li><a class="m-btn-search-options btn btn-default text-uppercase" role="button" href="#inspirationfinder" data-toggle="tab">@Translate("InspirationFinder", "Inspiration Finder")</a></li> 30 </ul> 31 </div> 32 </div> 33 34 35 <div class="container"> 36 37 <div class="content"> 38 39 <div class="tab-content"> 40 41 <div class="tab-pane fade" id="advancedsearch-ui"> 42 43 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 44 @using Dynamicweb.Ecommerce.Variants; 45 @using HagsWeb.Library.BusinessObjects.UsersLists; 46 @using HagsWeb.Library.State; 47 @{} 48 49 @*@helper AdvancedSearch(string name) { 50 // your helper can contain code and/or markup, e.g. 51 // var msg = "Hello " + name; 52 // <p>@msg</p> 53 // For more information, visit http://go.microsoft.com/fwlink/?LinkID=204658 54 }*@ 55 56 57 @{ 58 Dynamicweb.Frontend.PageView advSearchPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 59 Dynamicweb.Content.Area advSearchArea = new Dynamicweb.Content.AreaService().GetArea(advSearchPage.AreaID); 60 61 string advancedSearchUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl((Int32)new Dynamicweb.Content.PageService().GetFirstModulePageForArea(advSearchArea.ID, "Searchv1").ID); 62 63 // Search Results in Session - Phase 2 64 //List<AdvancedSearchState> advancedSearchState = SessionManager.UsersAdvancedSearchState != null ? SessionManager.UsersAdvancedSearchState as List<AdvancedSearchState> : new List<AdvancedSearchState>(); 65 66 67 68 69 70 // Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 71 // var area = Dynamicweb.Content.Area.GetAreaById(thisPage.AreaID); 72 73 //var AnchoringVariants = GlobalAnchoringVariants; // Defined in AssetsSearch.cshtml, the controls' parent 74 75 //Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 76 //var area = Dynamicweb.Content.Area.GetAreaById(thisPage.AreaID); 77 78 //Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 79 //ParagraphCollection pageParagraphCollection = Dynamicweb.Content.Paragraph.GetParagraphsByPageID(thisPage.ID); 80 //string pageId = thisPage.ID.ToString(); 81 82 //var area = Dynamicweb.Content.Area.GetAreaById(thisPage.AreaID); 83 // //var l = area.EcomLanguageId; 84 //string EcomLanguageID = area.EcomLanguageId; 85 //string EcomShopID = area.EcomShopID; 86 87 ////string lang = thisPage.GlobalTags.GetTagByName("LongLang").Value; 88 //string l = thisPage.Area.Values["areaecomlanguageid"].ToString(); 89 } 90 91 <div class="m-search-advanced" style="display:block;visibility:visible;"> 92 <div class="m-search-advanced-panel m-search-advanced-product" id="m-search-advanced-product" style="display:block;visibility:visible;"> 93 <div class="l-page"> 94 <div class="container-fluid"> 95 <nav class="text-center"> 96 <ul class="m-nav-tabs-search nav nav-tabs text-uppercase"> 97 <li id="tabSearchPlay" class="active"><a href="#advancedsearch-Play" data-toggle="tab">@Translate("Play", "Play")</a></li> 98 <li id="tabSearchSportFitness"><a href="#advancedsearch-SportFitness" data-toggle="tab">@Translate("SportFitness", "Sport &amp; Fitness")</a></li> 99 <li id="tabSearchParkUrban"><a href="#advancedsearch-ParkUrban" data-toggle="tab">@Translate("ParkUrban", "Park &amp; Urban")</a></li> 100 <li id="tabSearchMarine"><a href="#advancedsearch-Marine" data-toggle="tab">@Translate("Marine", "Marine")</a></li> 101 <li id="tabSearchShade"><a href="#advancedsearch-Shade" data-toggle="tab">@Translate("Shade", "Shade")</a></li> 102 </ul> 103 </nav> 104 </div> <!-- container-fluid --> 105 <div class="tab-content"> 106 <div class="tab-pane fade in active" id="advancedsearch-Play"> 107 <form id="search-play" name="search-form" method="get" action="@advancedSearchUrl"> 108 <input type="hidden" name="Products" value="Play" /> 109 <div class="l-page"> 110 <div class="container-fluid"> 111 <div class="form-horizontal"> 112 <fieldset class="m-theme-border-grey"> 113 114 <div class="row"> 115 <div class="col-ms-4 col-sm-4"> 116 <div class="form-group"> 117 <label for="ProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 118 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 119 </div> 120 </div> 121 <div class="col-ms-4 col-sm-4"> 122 <div class="form-group"> 123 <label for="ProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 124 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 125 </div> 126 </div> 127 @{ 128 List<VariantOption> PlayAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Play", advSearchArea.EcomLanguageId); 129 130 if (PlayAnchoringVariants.Any()) 131 { 132 <div class="col-ms-4 col-sm-4"> 133 <div class="form-group"> 134 135 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 136 <div class="col-sm-7"> 137 <select class="form-control" name="AnchoringType"> 138 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 139 @foreach (var option in PlayAnchoringVariants) 140 { 141 <option value='@option.Id'>@option.Name</option> 142 } 143 </select> 144 </div> 145 </div> 146 </div> 147 } 148 else 149 { 150 <input type="hidden" name="AnchoringType" value="0" /> 151 } 152 153 } 154 155 </div> <!-- row --> 156 @*<input type="hidden" name="productsInSession" value="@advancedSearchState.Count()" />*@ 157 158 </fieldset> 159 160 161 162 163 </div> <!--form - horizontal--> 164 </div> <!--container - fluid--> 165 </div> <!--l - page--> 166 <div class="m-search-advanced-buttons text-center"> 167 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 168 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 169 </div> 170 </form> 171 172 @*<script> 173 $("#search-play").validate(); 174 </script>*@ 175 <div id="results-search-play" class="m-search-advanced-results-panel"> 176 177 @*// Search Results in Session - Phase 2 178 @if (advancedSearchState.Any()) 179 { 180 181 foreach (AdvancedSearchState product in advancedSearchState) 182 { 183 @String.Format("{0}", product.Products) 184 } 185 }*@ 186 187 </div> 188 </div> 189 <div class="tab-pane fade in" id="advancedsearch-SportFitness"> 190 <form id="search-sport" name="search-form" method="get" action="@advancedSearchUrl"> 191 <input type="hidden" name="Products" value="Sport" /> 192 <div class="l-page"> 193 <div class="container-fluid"> 194 <div class="form-horizontal"> 195 <fieldset class="m-theme-border-grey"> 196 <div class="row"> 197 <div class="col-ms-4 col-sm-4"> 198 <div class="form-group"> 199 <label for="inputAdvancedSearch1" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 200 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 201 </div> 202 </div> 203 <div class="col-ms-4 col-sm-4"> 204 <div class="form-group"> 205 <label for="inputAdvancedSearch3" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 206 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 207 </div> 208 </div> 209 210 @{ 211 List<VariantOption> SportAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Sport", advSearchArea.EcomLanguageId); 212 213 if (SportAnchoringVariants.Count() > 0) 214 { 215 <div class="col-ms-4 col-sm-4"> 216 <div class="form-group"> 217 <label for="inputAdvancedSearch6" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 218 <div class="col-sm-7"> 219 <select class="form-control" name="AnchoringType"> 220 <option value="0"> @Translate("SelectAnchoring", "Select Anchoring Type") </option> 221 @foreach (var option in SportAnchoringVariants) 222 { 223 <option value='@option.Id'> @option.Name </option> 224 } 225 </select> 226 </div> 227 </div> 228 </div> 229 } 230 else 231 { 232 <input type="hidden" name="AnchoringType" value="0" /> 233 } 234 } 235 236 </div> <!-- row --> 237 </fieldset> 238 </div> <!-- form-horizontal --> 239 </div> <!-- container-fluid --> 240 </div> <!-- l-page --> 241 <div class="m-search-advanced-buttons text-center"> 242 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 243 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 244 </div> 245 </form> 246 <div id="results-search-sportfitness" class="m-search-advanced-results-panel"> 247 @*// Search Results in Session - Phase 2 248 @if (advancedSearchState.Any()) 249 { 250 251 foreach (AdvancedSearchState product in advancedSearchState) 252 { 253 @String.Format("{0}", product.Products) 254 } 255 }*@ 256 </div> 257 </div> 258 <div class="tab-pane fade in" id="advancedsearch-ParkUrban"> 259 <form id="search-park" name="search-form" method="get" action="@advancedSearchUrl"> 260 <input type="hidden" name="Products" value="Park" /> 261 <div class="l-page"> 262 <div class="container-fluid"> 263 <div class="form-horizontal"> 264 <fieldset class="m-theme-border-grey"> 265 <div class="row"> 266 <div class="col-ms-4 col-sm-4"> 267 <div class="form-group"> 268 <label for="inputAdvancedSearch1" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 269 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductCode" /></div> 270 </div> 271 </div> 272 <div class="col-ms-4 col-sm-4"> 273 <div class="form-group"> 274 <label for="inputAdvancedSearch3" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 275 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductName" /></div> 276 </div> 277 </div> 278 @{ 279 List<VariantOption> ParkAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Park", advSearchArea.EcomLanguageId); 280 281 if (ParkAnchoringVariants.Count() > 0) 282 { 283 <div class="col-ms-4 col-sm-4"> 284 <div class="form-group"> 285 <label for="inputAdvancedSearch6" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 286 <div class="col-sm-7"> 287 <select class="form-control" name="AnchoringType"> 288 <option value="0"> @Translate("SelectAnchoring", "Select Anchoring Type") </option> 289 @foreach (var option in ParkAnchoringVariants) 290 { 291 <option value='@option.Id'> @option.Name </option> 292 } 293 </select> 294 </div> 295 </div> 296 </div> 297 } 298 else 299 { 300 <input type="hidden" name="AnchoringType" value="0" /> 301 } 302 } 303 304 </div> <!-- row --> 305 </fieldset> 306 </div> <!-- form-horizontal --> 307 </div> <!-- container-fluid --> 308 </div> <!-- l-page --> 309 <div class="m-search-advanced-buttons text-center"> 310 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 311 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 312 </div> 313 </form> 314 <div id="results-search-parkurban" class="m-search-advanced-results-panel"> 315 @*// Search Results in Session - Phase 2 316 @if (advancedSearchState.Any()) 317 { 318 319 foreach (AdvancedSearchState product in advancedSearchState) 320 { 321 @String.Format("{0}", product.Products) 322 } 323 }*@ 324 </div> 325 </div> 326 <div class="tab-pane fade in" id="advancedsearch-Marine"> 327 <form id="search-marine" name="search-form" method="get" action="@advancedSearchUrl"> 328 <input type="hidden" name="Products" value="Marine" /> 329 <div class="l-page"> 330 <div class="container-fluid"> 331 <div class="form-horizontal"> 332 <fieldset class="m-theme-border-grey"> 333 <div class="row"> 334 <div class="col-ms-4 col-sm-4"> 335 <div class="form-group"> 336 <label for="inputAdvancedSearch1" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 337 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductCode" /></div> 338 </div> 339 </div> 340 <div class="col-ms-4 col-sm-4"> 341 <div class="form-group"> 342 <label for="inputAdvancedSearch3" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 343 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductName" /></div> 344 </div> 345 </div> 346 @{ 347 List<VariantOption> MarineAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Marine", advSearchArea.EcomLanguageId); 348 349 if (MarineAnchoringVariants.Count() > 0) 350 { 351 <div class="col-ms-4 col-sm-4"> 352 <div class="form-group"> 353 <label for="inputAdvancedSearch6" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 354 <div class="col-sm-7"> 355 <select class="form-control" name="AnchoringType"> 356 <option value="0"> @Translate("SelectAnchoring", "Select Anchoring Type") </option> 357 @foreach (var option in MarineAnchoringVariants) 358 { 359 <option value='@option.Id'> @option.Name </option> 360 } 361 </select> 362 </div> 363 </div> 364 </div> 365 } 366 else 367 { 368 <input type="hidden" name="AnchoringType" value="0" /> 369 } 370 } 371 372 </div> <!-- row --> 373 </fieldset> 374 </div> <!-- form-horizontal --> 375 </div> <!-- container-fluid --> 376 </div> <!-- l-page --> 377 <div class="m-search-advanced-buttons text-center"> 378 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 379 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 380 </div> 381 </form> 382 <div id="results-search-marine" class="m-search-advanced-results-panel"> 383 @*// Search Results in Session - Phase 2 384 @if (advancedSearchState.Any()) 385 { 386 387 foreach (AdvancedSearchState product in advancedSearchState) 388 { 389 @String.Format("{0}", product.Products) 390 } 391 }*@ 392 </div> 393 </div> 394 <div class="tab-pane fade in" id="advancedsearch-Shade"> 395 <form id="search-shade" name="search-form" method="get" action="@advancedSearchUrl"> 396 <input type="hidden" name="Products" value="Shade" /> 397 <div class="l-page"> 398 <div class="container-fluid"> 399 <div class="form-horizontal"> 400 <fieldset class="m-theme-border-grey"> 401 <div class="row"> 402 <div class="col-ms-4 col-sm-4"> 403 <div class="form-group"> 404 <label for="inputAdvancedSearch1" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 405 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductCode" /></div> 406 </div> 407 </div> 408 <div class="col-ms-4 col-sm-4"> 409 <div class="form-group"> 410 <label for="inputAdvancedSearch3" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 411 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductName" /></div> 412 </div> 413 </div> 414 @{ 415 List<VariantOption> ShadeAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Shade", advSearchArea.EcomLanguageId); 416 417 if (ShadeAnchoringVariants.Count() > 0) 418 { 419 <div class="col-ms-4 col-sm-4"> 420 <div class="form-group"> 421 <label for="inputAdvancedSearch6" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 422 <div class="col-sm-7"> 423 <select class="form-control" name="AnchoringType"> 424 <option value="0"> @Translate("SelectAnchoring", "Select Anchoring Type") </option> 425 @foreach (var option in ShadeAnchoringVariants) 426 { 427 <option value='@option.Id'> @option.Name </option> 428 } 429 </select> 430 </div> 431 </div> 432 </div> 433 } 434 else 435 { 436 <input type="hidden" name="AnchoringType" value="0" /> 437 } 438 } 439 440 </div> <!-- row --> 441 </fieldset> 442 </div> <!-- form-horizontal --> 443 </div> <!-- container-fluid --> 444 </div> <!-- l-page --> 445 <div class="m-search-advanced-buttons text-center"> 446 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 447 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 448 </div> 449 </form> 450 <div id="results-search-shade" class="m-search-advanced-results-panel"> 451 @*// Search Results in Session - Phase 2 452 @if (advancedSearchState.Any()) 453 { 454 455 foreach (AdvancedSearchState product in advancedSearchState) 456 { 457 @String.Format("{0}", product.Products) 458 } 459 }*@ 460 </div> 461 </div> 462 </div> 463 </div> <!-- l-page --> 464 </div> <!-- m-search-advanced-product --> 465 <div class="text-center"> 466 <a href="#advancedsearch-ui" class="m-search-advanced-close"><img src="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.png" width="112" alt="Search Advanced Close"></a> 467 </div> 468 </div> 469 470 471 472 @*<h1>@GetGlobalValue("Global:Page.Name")</h1> 473 <h1>@GetValue("Global:Page.Name")</h1> 474 <h1>The Advanced Search Include is here.. PageID = @pageId, l=, LanguageID=@EcomLanguageID, ShopID=@EcomShopID, lang=@l</h1> 475 476 <h1>Set Tag = @GetString("CheckTag") // @GetValue("CheckTag") </h1> 477 478 @foreach (var p in pageParagraphCollection) 479 { 480 var a = p.Template; 481 var b = p.ID.ToString(); 482 var c = p.Text; 483 var f = p.Languages; 484 <ul> 485 <li>@a</li> 486 <li>@b</li> 487 <li>@c</li> 488 <li>@f</li> 489 </ul> 490 }*@ 491 492 493 </div> 494 495 <div class="tab-pane fade" id="downloadfinder"> 496 497 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 498 @using HagsWeb.Library.BusinessObjects.UsersLists; 499 @using HagsWeb.Library.State; 500 @using Dynamicweb.Ecommerce.Variants; 501 @{ 502 Dynamicweb.Frontend.PageView downloadsPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 503 Dynamicweb.Content.Area downloadsArea = new Dynamicweb.Content.AreaService().GetArea(downloadsPage.AreaID); 504 505 string downloadsSearchUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl((Int32)new Dynamicweb.Content.PageService().GetFirstModulePageForArea(downloadsArea.ID, "Searchv1").ID); 506 507 // This seems to be still valid 508 List<VariantOption> ProductDownloadsAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().GetVariantOptions("ATP3", downloadsArea.EcomLanguageId); 509 510 511 #region Search Results in Session - Phase 2 512 513 514 //// Search Results in Session - Phase 2 515 //List<AdvancedSearchState> downloadsSearchState = SessionManager.UsersAdvancedSearchState != null ? SessionManager.UsersAdvancedSearchState as List<AdvancedSearchState> : new List<AdvancedSearchState>(); 516 //List<AdvancedSearchState> brochuresStateList = new List<AdvancedSearchState>(); 517 //List<AdvancedSearchState> dwgsStateList = new List<AdvancedSearchState>(); 518 //List<AdvancedSearchState> certificatesStateList = new List<AdvancedSearchState>(); 519 //List<AdvancedSearchState> installationGuidesStateList = new List<AdvancedSearchState>(); 520 521 //if (downloadsSearchState.Count() > 0) 522 //{ 523 // foreach (AdvancedSearchState downloadsState in downloadsSearchState) 524 // { 525 // if (!String.IsNullOrEmpty(downloadsState.Brochures)) 526 // { 527 // AdvancedSearchState broch = new AdvancedSearchState(); 528 // broch.Brochures = downloadsState.Brochures; 529 // brochuresStateList.Add(broch); 530 // } 531 // if (!String.IsNullOrEmpty(downloadsState.Dwgs)) 532 // { 533 // AdvancedSearchState dwg = new AdvancedSearchState(); 534 // dwg.Dwgs = downloadsState.Dwgs; 535 // dwgsStateList.Add(dwg); 536 // } 537 // if (!String.IsNullOrEmpty(downloadsState.Certificates)) 538 // { 539 // AdvancedSearchState certs = new AdvancedSearchState(); 540 // certs.Certificates = downloadsState.Certificates; 541 // certificatesStateList.Add(certs); 542 // } 543 // if (!String.IsNullOrEmpty(downloadsState.InstallationGuides)) 544 // { 545 // AdvancedSearchState guide = new AdvancedSearchState(); 546 // guide.InstallationGuides = downloadsState.InstallationGuides; 547 // installationGuidesStateList.Add(guide); 548 // } 549 // } 550 551 //} 552 #endregion 553 554 } 555 556 557 <div class="m-search-advanced" style="display:block;visibility:visible;"> 558 <div class="m-search-advanced-panel m-search-advanced-product" id="m-search-advanced-product" style="display:block;visibility:visible;"> 559 <div class="l-page"> 560 <div class="container-fluid"> 561 <nav class="text-center"> 562 <ul class="m-nav-tabs-search nav nav-tabs text-uppercase"> 563 <li><a href="#download-brochures" data-toggle="tab">@Translate("Brochures", "Brochures")</a></li> 564 <li><a href="#download-dwg" data-toggle="tab">@Translate("DWGFiles", "DWG Files")</a></li> 565 <li><a href="#download-certificates" data-toggle="tab">@Translate("Certificates", "Certificates")</a></li> 566 <li><a href="#download-installationguides" data-toggle="tab">@Translate("InstallationGuides", "Installation Guides")</a></li> 567 </ul> 568 </nav> 569 <p>@Translate("ProductDownloadsInstructions", "To find product downloads simply click on one of the options above and then use the search form displayed to find all the documents associated with your search.")</p> 570 <p>&nbsp;</p> 571 </div> <!-- container-fluid --> 572 <div class="tab-content"> 573 574 575 576 577 <div class="tab-pane fade in" id="download-brochures"> 578 <form id="search-brochures" method="post" action="@downloadsSearchUrl?Assets=download-brochures"> 579 <div class="l-page"> 580 <div class="container-fluid"> 581 <div class="form-horizontal"> 582 <input type="hidden" name="SearchType" value="download-brochures" /> 583 @*<input type="hidden" name="ProductCode" value="0" /> 584 <input type="hidden" name="Products" value="0" />*@ 585 <!--<fieldset class="m-theme-border-grey"> 586 <input type="hidden" name="Assets" value="download-brochures" /> 587 <div class="row"> 588 <div class="col-ms-4 col-sm-4"> 589 <div class="form-group"> 590 <label for="inputProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 591 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 592 </div> 593 </div> 594 <div class="col-ms-4 col-sm-4"> 595 <div class="form-group"> 596 <label for="inputProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 597 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 598 </div> 599 </div> 600 601 @if (ProductDownloadsAnchoringVariants.Count() > 0) 602 { 603 604 <div class="col-ms-4 col-sm-4"> 605 <div class="form-group"> 606 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 607 <div class="col-sm-7"> 608 <select class="form-control" name="AnchoringType"> 609 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 610 @foreach (var option in ProductDownloadsAnchoringVariants) 611 { 612 <option value='@option.Id'>@option.Name</option> 613 } 614 </select> 615 </div> 616 </div> 617 </div> 618 619 } 620 621 </div> 622 </fieldset>--> 623 </div> <!-- form-horizontal --> 624 </div> <!-- container-fluid --> 625 </div> <!-- l-page --> 626 <div class="m-search-advanced-buttons text-center"> 627 @*<button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DownloadAll", "Download All")</button>*@ 628 @*<button class="m-btn-search btn btn-default text-uppercase" type="reset" >@Translate("Reset", "Reset")</button>*@ 629 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DisplayBrochures", "Display All Brochures")</button> 630 </div> 631 <div class="l-page"> 632 <div class="container-fluid"> 633 634 <div id="results-brochures" class="m-downloads m-search-advanced-results-panel"> 635 @*// SearchState - Phase 2 636 @if (brochuresStateList.Any()) 637 { 638 foreach (AdvancedSearchState brochures in brochuresStateList) 639 { 640 @String.Format("{0}", brochures.Brochures) 641 } 642 }*@ 643 </div> <!-- m-downloads --> 644 </div> <!-- container-fluid --> 645 </div> <!-- l-page --> 646 </form> 647 </div> 648 649 650 651 652 653 <div class="tab-pane fade in" id="download-dwg"> 654 <form id="search-dwg" method="post" action="@downloadsSearchUrl?Assets=download-dwg"> 655 <div class="l-page"> 656 <div class="container-fluid"> 657 <div class="form-horizontal"> 658 <fieldset id="dwg-criteria" class="m-theme-border-grey"> 659 <input type="hidden" name="SearchType" value="download-dwg" /> 660 <div class="row"> 661 <div class="col-ms-4 col-sm-4"> 662 <div class="form-group"> 663 <label for="inputProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 664 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 665 </div> 666 </div> 667 <div class="col-ms-4 col-sm-4"> 668 <div class="form-group"> 669 <label for="inputProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 670 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 671 </div> 672 </div> 673 @if (ProductDownloadsAnchoringVariants.Count() > 0) 674 { 675 676 <div class="col-ms-4 col-sm-4"> 677 <div class="form-group"> 678 679 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 680 <div class="col-sm-7"> 681 <select class="form-control" name="AnchoringType"> 682 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 683 @foreach (var option in ProductDownloadsAnchoringVariants) 684 { 685 <option value='@option.Id'>@option.Name</option> 686 } 687 </select> 688 </div> 689 </div> 690 </div> 691 692 } 693 </div> <!-- row --> 694 </fieldset> 695 </div> <!-- form-horizontal --> 696 </div> <!-- container-fluid --> 697 </div> <!-- l-page --> 698 <div class="m-search-advanced-buttons text-center"> 699 @*<button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DownloadAll", "Download All")</button>*@ 700 <button class="m-btn-search btn btn-default text-uppercase" type="reset">@Translate("Reset", "Reset")</button> 701 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 702 </div> 703 <div class="l-page"> 704 <div class="container-fluid"> 705 706 <div id="results-dwgs" class="m-downloads m-search-advanced-results-panel"> 707 @*// SearchState - Phase 2 708 @if (dwgsStateList.Any()) 709 { 710 foreach (AdvancedSearchState dwgs in dwgsStateList) 711 { 712 @String.Format("{0}", dwgs.Dwgs) 713 } 714 }*@ 715 </div> <!-- m-downloads --> 716 717 718 </div> <!-- container-fluid --> 719 </div> <!-- l-page --> 720 </form> 721 </div> 722 <div class="tab-pane fade in" id="download-certificates"> 723 <form id="search-certificates" method="post" action="@downloadsSearchUrl?Assets=download-certificates"> 724 <div class="l-page"> 725 <div class="container-fluid"> 726 <div class="form-horizontal"> 727 <fieldset id="certificates-criteria" class="m-theme-border-grey"> 728 <input type="hidden" name="SearchType" value="download-certificates" /> 729 <div class="row"> 730 <div class="col-ms-4 col-sm-4"> 731 <div class="form-group"> 732 <label for="inputProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 733 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 734 </div> 735 </div> 736 <div class="col-ms-4 col-sm-4"> 737 <div class="form-group"> 738 <label for="inputProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 739 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 740 </div> 741 </div> 742 @if (ProductDownloadsAnchoringVariants.Count() > 0) 743 { 744 745 <div class="col-ms-4 col-sm-4"> 746 <div class="form-group"> 747 748 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 749 <div class="col-sm-7"> 750 <select class="form-control" name="AnchoringType"> 751 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 752 @foreach (var option in ProductDownloadsAnchoringVariants) 753 { 754 <option value='@option.Id'>@option.Name</option> 755 } 756 </select> 757 </div> 758 </div> 759 </div> 760 761 } 762 </div> <!-- row --> 763 </fieldset> 764 </div> <!-- form-horizontal --> 765 </div> <!-- container-fluid --> 766 </div> <!-- l-page --> 767 <div class="m-search-advanced-buttons text-center"> 768 @*<button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DownloadAll", "Download All")</button>*@ 769 <button class="m-btn-search btn btn-default text-uppercase" type="reset">@Translate("Reset", "Reset")</button> 770 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 771 772 <div class="adviceMessage"></div> 773 774 </div> 775 <div class="l-page"> 776 <div class="container-fluid"> 777 778 <div id="results-certificates" class="m-downloads m-search-advanced-results-panel"> 779 @*// SearchState - Phase 2 780 @if (certificatesStateList.Any()) 781 { 782 foreach (AdvancedSearchState certs in certificatesStateList) 783 { 784 @String.Format("{0}", certs.Certificates) 785 } 786 }*@ 787 788 </div> <!-- m-downloads --> 789 790 791 </div> <!-- container-fluid --> 792 793 </div> <!-- l-page --> 794 </form> 795 </div> 796 <div class="tab-pane fade in" id="download-installationguides"> 797 <form id="search-installationguides" method="post" action="@downloadsSearchUrl?Assets=download-installationguides"> 798 <div class="l-page"> 799 <div class="container-fluid"> 800 <div class="form-horizontal"> 801 <fieldset id="installationguides-criteria" class="m-theme-border-grey"> 802 <input type="hidden" name="SearchType" value="download-installationguides" /> 803 <div class="row"> 804 <div class="col-ms-4 col-sm-4"> 805 <div class="form-group"> 806 <label for="inputProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 807 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 808 </div> 809 </div> 810 <div class="col-ms-4 col-sm-4"> 811 <div class="form-group"> 812 <label for="inputProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 813 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 814 </div> 815 </div> 816 @if (ProductDownloadsAnchoringVariants.Count() > 0) 817 { 818 819 <div class="col-ms-4 col-sm-4"> 820 <div class="form-group"> 821 822 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 823 <div class="col-sm-7"> 824 <select class="form-control" name="AnchoringType"> 825 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 826 @foreach (var option in ProductDownloadsAnchoringVariants) 827 { 828 <option value='@option.Id'>@option.Name</option> 829 } 830 </select> 831 </div> 832 </div> 833 </div> 834 835 } 836 </div> <!-- row --> 837 </fieldset> 838 </div> <!-- form-horizontal --> 839 </div> <!-- container-fluid --> 840 </div> <!-- l-page --> 841 <div class="m-search-advanced-buttons text-center"> 842 @*<button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DownloadAll", "Download All")</button>*@ 843 <button class="m-btn-search btn btn-default text-uppercase" type="reset">@Translate("Reset", "Reset")</button> 844 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 845 </div> 846 <div class="l-page"> 847 <div class="container-fluid"> 848 849 <div id="results-guides" class="m-downloads m-search-advanced-results-panel"> 850 @*// SearchState - Phase 2 851 @if (installationGuidesStateList.Any()) 852 { 853 foreach (AdvancedSearchState guide in installationGuidesStateList) 854 { 855 @String.Format("{0}", guide.InstallationGuides) 856 } 857 }*@ 858 859 </div> <!-- m-downloads --> 860 861 862 </div> <!-- container-fluid --> 863 </div> <!-- l-page --> 864 </form> 865 </div> 866 867 </div> 868 </div> <!-- l-page --> 869 </div> <!-- m-search-advanced-product --> 870 <div class="text-center"> 871 <a href="#downloadfinder" class="m-search-advanced-close"><img src="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.png" width="112" alt="Search Advanced Close"></a> 872 </div> 873 </div> 874 875 </div> 876 <div class="tab-pane fade" id="productcollection"> 877 878 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 879 @using HagsWeb.Library.BusinessObjects.UsersLists; 880 @using HagsWeb.Library.Methods.AssetManager; 881 @using HagsWeb.Library.State; 882 @{ 883 Dynamicweb.Frontend.PageView collectionPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 884 Dynamicweb.Content.Area collectionArea = new Dynamicweb.Content.AreaService().GetArea(collectionPage.AreaID); 885 886 List<ProductCollectionItem> productCollectionItems = SessionManager.UsersMyProductCollection != null ? SessionManager.UsersMyProductCollection : new List<ProductCollectionItem>(); 887 bool isQuote = Convert.ToBoolean(collectionArea.Item["QuoteAndOrderChk"]); 888 string downloadingText = HagsWeb.Library.Utilities.DWUtilities.GetTranslation("Downloading...", "Downloading...", collectionArea.Culture); 889 int currentPage = collectionArea.ID; 890 } 891 892 893 <input type="hidden" id="isQuote" value="@isQuote" /> 894 <input type="hidden" id="downloadingText" value="@downloadingText" /> 895 <div class="m-search-advanced" style="display:block;visibility:visible;"> 896 897 <!--<div class="pull-left"><h4 class="clearfix">@Translate("MyProductCollection", "My Product Collection")</h4></div>--> 898 899 <div class="text-center" style="clear:both;padding-top:10px; border-bottom: 2px solid #000; padding-bottom: 20px;"> 900 <div id="btns_MyProductCollection"> 901 @if (productCollectionItems.Any()) 902 { 903 <p>@Translate("ProductCollectionButtonInstructions", "Use the buttons below to either download files, create quotes or create orders based on the products you have added to your collection.")</p> 904 905 <ul class="list-inline print-hide"> 906 @{ 907 List<ProductAsset> imageFileList = new List<ProductAsset>(); 908 List<ProductAsset> dwgFileList = new List<ProductAsset>(); 909 List<ProductAsset> instructionsFileList = new List<ProductAsset>(); 910 string contactUsLink = HagsWeb.Library.Utilities.DWUtilities.GetPageByNavigationTag("ContactUs", currentPage); // /kontakta-oss?mode=quote#contactForms // /kontakta-oss?success=True&mode=quote#contactForms // restful url 911 912 foreach (var item in productCollectionItems) 913 { 914 915 foreach (ProductAsset asset in item.AssetDownloads.Where(n => n.Index == HagsWeb.Library.Methods.AssetManager.AssetTypeEnum.ToFriendlyAssetName(HagsWeb.Library.Methods.AssetManager.AssetType.Images) && n.FileName == item.ProductNumber + ".jpg" || n.FileName == item.ProductNumber + "_Side.jpg" || n.FileName == item.ProductNumber + "_Top.jpg").ToList()) 916 { 917 imageFileList.Add(asset); 918 } 919 920 foreach (ProductAsset asset in item.AssetDownloads.Where(n => n.Index == HagsWeb.Library.Methods.AssetManager.AssetTypeEnum.ToFriendlyAssetName(HagsWeb.Library.Methods.AssetManager.AssetType.Drawings)).ToList()) 921 { 922 dwgFileList.Add(asset); 923 } 924 925 foreach (ProductAsset asset in item.AssetDownloads.Where(n => n.Index == HagsWeb.Library.Methods.AssetManager.AssetTypeEnum.ToFriendlyAssetName(HagsWeb.Library.Methods.AssetManager.AssetType.AssemblyInstructions)).ToList()) 926 { 927 instructionsFileList.Add(asset); 928 } 929 930 931 } 932 933 if (imageFileList.Any()) 934 { 935 <li> 936 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" name="download" role="button" data-parent="Bilder" id="imageDownloadButton">@Translate("DownloadImages", "Download Images")</a> 937 </li> 938 } 939 940 if (dwgFileList.Any()) 941 { 942 <li> 943 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" name="download" role="button" data-parent="Ritningar" id="dwgDownloadButton">@Translate("DownloadDWGFiles", "Download DWG Files")</a> 944 </li> 945 } 946 947 if (instructionsFileList.Any()) 948 { 949 <li> 950 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" name="download" role="button" data-parent="Monteringsanvisningar" id="instructionsDownloadButton">@Translate("DownloadInstallationGuides", "Download Installation Guides")</a> 951 </li> 952 } 953 954 if (isQuote) 955 { 956 if (!string.IsNullOrEmpty(contactUsLink)) 957 { 958 <li> 959 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@contactUsLink?mode=QuickQuote" role="button" data-parent="#quickquote" id="quickQuoteButton">@Translate("CreateQuickQuote", "Create a Quick Quote")</a> 960 </li> 961 <li> 962 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@contactUsLink?mode=QuickOrder" role="button" data-parent="#quickorder" id="quickOrderButton">@Translate("CreateQuickOrder", "Create a Quick Order")</a> 963 </li> 964 } 965 } 966 967 } 968 </ul> 969 970 } 971 972 <span class="error hide"></span> 973 974 </div> 975 976 <div class="m-search-advanced-results-panel" id="frm_MyProductCollection"> 977 <div class="row2"> 978 @if (productCollectionItems.Any()) 979 { 980 981 foreach (ProductCollectionItem item in productCollectionItems) 982 { 983 984 <div class="l-group-5 text-left"> 985 <div class="m-attractor"> 986 <div class="m-attractor-visual"> 987 <a href="@item.ProductUrlReference"><img src="@item.ProductImageUrl" class="img-responsive m-product-thumb"></a> 988 </div> 989 990 <div class="m-attractor-info m-attractor-info-product"> 991 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@item.ProductUrlReference">@item.ProductName</a></h3> 992 @*<p>@item.ProductDescription</p>*@ 993 <p>@Translate("ProductNumber", "Product Number"): @item.ProductNumber</p> 994 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@item.ProductUrlReference" role="button">@Translate("ProductDetails", "Product Details")</a> 995 </div> <!-- attractor-info --> 996 <div class="m-attractor-options"> 997 <ul class="m-icon-links list-unstyled"> 998 <li><a href="" name='productcollection' class="clearfix productcollection" data-removeProductlist="@item.ProductNumber"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/plus.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/plus.png" class="m-icon pull-left"><span>@Translate("RemoveFromCollection", "Remove from my collection")</span></a></li> 999 </ul> 1000 </div> <!-- m-attractor-options --> 1001 </div> 1002 1003 </div> 1004 1005 1006 } 1007 1008 } 1009 else 1010 { 1011 <p>@Translate("NoProductsInCollection", "You have no products in your collection.")</p> 1012 } 1013 </div> 1014 1015 </div> 1016 1017 </div> 1018 1019 <div class="text-center clearfix" style="clear:both;padding-top:10px;"> 1020 <a href="#productcollection" class="m-search-advanced-close"><img src="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.png" width="112" alt="Search Advanced Close"></a> 1021 </div> 1022 </div> 1023 1024 1025 1026 </div> 1027 1028 <div class="tab-pane fade" id="inspirationfinder"> 1029 1030 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1031 @using Dynamicweb.Content.Items; 1032 @{ 1033 Dynamicweb.Frontend.PageView thePage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 1034 int areaId = thePage.Area.ID; 1035 1036 // Get the current area's Paragraphs and find the ItemPublisher Module, returning a link and its paragraph content. Checks if Normalize latin Chars is set in DW 1037 var tuple = HagsWeb.Library.Methods.Items.ItemTypeMethods.GetDefaultCaseStudies(areaId, 3); 1038 string paraContent = tuple.Item1; 1039 int pageId = tuple.Item2; // The Target Case Study Page listin Case study Item Types 1040 string hyperLink = tuple.Item3; 1041 bool latinCharacters = tuple.Item4; 1042 IEnumerable<Item> caseStudies = tuple.Item5; 1043 1044 //http://developer.dynamicweb-cms.com/documentation/for-developers/item-based-structure/querying-items.aspx 1045 1046 //string DataFromItem = RenderItemList(new 1047 //{ 1048 // ItemType = "Case_Study", 1049 // ListSourceType = "Page", 1050 // ListSourcePage = "62", 1051 // //IncludeAllChildItems = true, 1052 // //IncludeParagraphItems = true, 1053 // ItemFieldsList = "*", 1054 // ListTemplate = "ItemPublisher/List/Case Study List.cshtml", 1055 // ListPageSize = "100" 1056 //}).ToString(); 1057 1058 ////int productsPageId = GetPageIdByNavigationTag("Legals"); 1059 } 1060 1061 <div class="m-search-advanced" style="display:block;visibility:visible;"> 1062 <!--<h4>@Translate("InspirationFinder", "Inspiration Finder")</h4>--> 1063 1064 <div class="m-search-advanced-results-panel fade in" id="frm_InspirationFinder"> 1065 1066 @if (caseStudies.Any()) 1067 { 1068 1069 foreach (var study in caseStudies) 1070 { 1071 string studyId = study["Id"].ToString(); 1072 string Name = study["Study_Heading"] == null ? string.Empty : study["Study_Heading"].ToString(); 1073 string hyperlinkId = study["Read_More_Button"] == null ? String.Empty : study["Read_More_Button"].ToString(); 1074 string hyperlinkText = string.Empty; 1075 string Url = "Default.aspx?ID=" + pageId + "&itemId=Case_Study:" + studyId; 1076 1077 1078 // string sb_trim_Original = System.Text.RegularExpressions.Regex.Replace(Name, @"[., ?\/#!$%\^&\*;:{}=\-_`~()]", "-").ToLower(); 1079 //string sb_trim = System.Text.RegularExpressions.Regex.Replace(Name, @"[., ?\/#!$%\^&\*;:{}=\-_`~]", "-").ToLower(); 1080 1081 //string Url = hyperLink + "/" + sb_trim; 1082 1083 //if (latinCharacters) 1084 //{ 1085 // Url = HagsWeb.Library.Utilities.DWUtilities.NormalizeLatinCharacters(Url); 1086 //} 1087 1088 //string Url = hyperLink + "/" + sb_trim; 1089 string DateCreated = study["Study_Created_Date"] == null ? string.Empty : study["Study_Created_Date"].ToString(); 1090 string Description = study["Study_Content"] == null ? string.Empty : study["Study_Content"].ToString(); 1091 string StudyImages = study["Images"] == null ? string.Empty : study["Images"].ToString(); 1092 Item studyImage = null; 1093 1094 if (!string.IsNullOrEmpty(StudyImages)) 1095 { 1096 studyImage = HagsWeb.Library.Methods.Items.ItemTypeMethods.GetItemImages(study["Images"].ToString(), 1).FirstOrDefault(); 1097 } 1098 1099 1100 <div class="l-group-content col-xs-6 col-ms-4 col-sm-3"> 1101 1102 <div class="m-attractor"> 1103 1104 <div class="m-attractor-visual"> 1105 1106 @if (studyImage == null) 1107 { 1108 <a href="@Url"><img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive" /></a> 1109 } 1110 else 1111 { 1112 <a href="@Url"><img src='@studyImage["Image"].ToString()' class="img-responsive"></a> 1113 } 1114 1115 1116 @*<img src="/Admin/Public/GetImage.ashx?width=1920&Compression=75&image=@image">*@ 1117 </div> 1118 1119 <div class="m-attractor-info m-attractor-info-product"> 1120 @if (!String.IsNullOrEmpty(Name)) 1121 { 1122 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@Url">@Name</a></h3> 1123 } 1124 @if (!String.IsNullOrEmpty(Description)) 1125 { 1126 <p>@Description</p> 1127 } 1128 1129 @if (!String.IsNullOrEmpty(DateCreated)) 1130 { 1131 <p>@DateCreated</p> 1132 } 1133 1134 @if (!String.IsNullOrEmpty(Url)) 1135 { 1136 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@Url" role="button">@Translate("CaseStudyDetails", "Case Study Details")</a> 1137 } 1138 1139 1140 </div> <!-- attractor-info --> 1141 @*<div class="m-attractor-options"> 1142 1143 <ul class="m-icon-links list-unstyled"> 1144 <li><a href="#" class="clearfix"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/plus.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/plus.png" class="m-icon pull-left"><span>Add to my collection</span></a></li> 1145 </ul> 1146 1147 </div>*@ <!-- m-attractor-options --> 1148 1149 </div> <!-- attractor --> 1150 1151 </div> 1152 } 1153 } 1154 1155 </div> 1156 1157 <div class="text-center all-case-studies"> 1158 1159 @if (!String.IsNullOrEmpty(paraContent)) 1160 { 1161 @paraContent 1162 } 1163 1164 @if (!String.IsNullOrEmpty(hyperLink)) 1165 { 1166 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@hyperLink" role="button">@Translate("ViewAllCaseStudies", "View all our case studies")</a> 1167 } 1168 1169 </div> 1170 1171 @*<div class="m-search-advanced-buttons text-center"> 1172 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@hyperLink" role="button">@Translate("ViewAllCaseStudies", "View all our case studies")</a> 1173 </div>*@ 1174 1175 @*</div>*@ 1176 1177 <div class="text-center"> 1178 <a href="#inspirationfinder" class="m-search-advanced-close"><img src="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.png" width="112" alt="Search Advanced Close"></a> 1179 </div> 1180 </div> 1181 1182 </div> 1183 </div> 1184 1185 <div id="NoResults" style="display:none;">Sorry there are currently no items that match your search criteria. Please refine your search using the options above.</div> 1186 1187 </div> 1188 </div> 1189 1190 <div style="margin-top:50px; display:none;" id="SearchResults">@Translate("YourResults", "YourResults") **Search Results here**</div> 1191 1192 1193 </div> 1194 1195 @Scripts.Render("~/bundle/AssetSearch") 1196 1197 @if (areaLanguage != "en") 1198 { 1199 // non english validation messages 1200 <script src="/Files/Templates/Designs/HagsCore/script/source/libraries/validation/localization/@validationMessages"></script> 1201 } 1202
Error executing template "/Designs/HagsCore/Paragraph/ContactUsForms.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_dcad340c8cec4420b421b0dc3b337af7.Execute() in C:\Projects\Hags_Dw9\Files\Templates\Designs\HagsCore\Paragraph\ContactUsForms.cshtml:line 23
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Dynamicweb; 3 @using System.Web.Optimization 4 @using HagsWeb.Library.BusinessObjects.UsersLists; 5 @using HagsWeb.Library.State; 6 @{ 7 string validationMessages = string.Format("messages_{0}.min.js", GetGlobalValue("Global:Area.Lang")); 8 string areaLanguage = GetGlobalValue("Global:Area.Lang"); 9 string pageId = GetGlobalValue("Global:Page.ID"); 10 string currentCulture = GetGlobalValue("Global:Area.LongLang"); 11 12 HashSet<string[,]> countrySelector = HagsWeb.Library.Methods.HagsUsers.UsersFilter.GetHagsCountries(); 13 14 string EnquiryEmail = GetString("Item.Enquiry_Email"); 15 string NewsLetterEmail = GetString("Item.News_Letter_Email"); 16 string QuoteEmail = GetString("Item.Quote_Email"); 17 string OrderEmail = GetString("Item.Order_Email"); 18 19 //bool success = Input.RequestBoolean("success") == true ? true : false; 20 21 bool success = Dynamicweb.Core.Converter.ToBoolean(System.Web.HttpContext.Current.Request["success"]); 22 23 bool isQuote = Convert.ToBoolean(Pageview.Area.Item["QuoteAndOrderChk"]); 24 string addText = string.Empty; 25 string removeText = string.Empty; 26 if(isQuote) 27 { 28 addText = HagsWeb.Library.Utilities.DWUtilities.GetTranslation("Add", "Add", currentCulture); 29 removeText = HagsWeb.Library.Utilities.DWUtilities.GetTranslation("Remove", "Remove", currentCulture); 30 } 31 32 33 string clientMode = System.Web.HttpContext.Current.Request["mode"];// String.Empty; 34 string thanksText = String.Empty; 35 36 // if a request arrives from My Product Collection area 37 List<ProductCollectionItem> productCollectionItems = SessionManager.UsersMyProductCollection != null ? SessionManager.UsersMyProductCollection : new List<ProductCollectionItem>(); 38 //if (productCollectionItems.Any() && (clientMode == "quote" || clientMode == "order")) 39 //{ 40 // productCollectionItems = SessionManager.UsersMyProductCollection != null ? SessionManager.UsersMyProductCollection : new List<ProductCollectionItem>(); 41 //} 42 //else 43 //{ 44 // //clientMode = "enquiry"; 45 //} 46 47 if (success) 48 { 49 //clientMode = Input.Request("mode"); 50 thanksText = Translate("YourRequestWasSent", "Thank you, your request was sent."); 51 } 52 53 } 54 55 @*Validation is already added in master Main.cshtml Scripts.Render("~/bundle/Validation")*@ 56 57 @if (areaLanguage != "en") 58 { 59 <script src="/Files/Templates/Designs/HagsCore/script/source/libraries/validation/localization/@validationMessages"></script> 60 } 61 62 @Scripts.Render("~/bundle/ContactUs") 63 64 65 <input id="contactUsTabName" type="hidden" value="@clientMode" /> 66 @if (isQuote) 67 { 68 <input id="translatedAddText" type="hidden" value="@addText" /> 69 <input id="translatedRemoveText" type="hidden" value="@removeText" /> 70 } 71 72 73 <!--Paragraph/ContactUsForms.cshtml--> 74 75 <div class="m-form-contact m-theme-background-lightgrey" id="contactForms"> 76 77 <div class="l-page"> 78 79 <div class="container-fluid"> 80 81 <div class="row"> 82 83 <div class="col-sm-8 col-sm-push-2"> 84 85 <nav> 86 <ul class="m-nav-tabs-contact nav nav-tabs text-uppercase"> 87 88 <li><a href="#enquiry" data-toggle="tab">@Translate("MakeEnquiry", "Make an Enquiry") </a></li> 89 @if (isQuote) 90 { 91 if (!string.IsNullOrEmpty(QuoteEmail)) 92 { 93 <li><a href="#QuickQuote" data-toggle="tab">@Translate("QuickQuote", "Quick Quote")</a></li> 94 } 95 if (!string.IsNullOrEmpty(OrderEmail)) 96 { 97 <li><a href="#QuickOrder" data-toggle="tab">@Translate("QuickOrder", "Quick Order")</a></li> 98 } 99 100 } 101 102 <li><a href="#newsletter" data-toggle="tab">@Translate("SignUpNewsletter", "Sign Up to our Newsletter") </a></li> 103 104 </ul> 105 </nav> 106 107 <div class="tab-content"> 108 109 <div class="tab-pane fade" id="enquiry"> 110 111 @if (success && clientMode == "enquiry") 112 { 113 <p class="text-success" id="enquiryformAdvice">@thanksText</p> 114 } 115 116 117 <form role="form" id="enquiryform" class="m-form-contact" method="Post" action="/Ajax/ContactUs/ContactUsPostForm.aspx"> 118 119 <input type="hidden" name="submitEmail" value="@EnquiryEmail"> 120 <input type="hidden" name="clientMode" value="enquiry"> 121 <input type="hidden" name="PageId" value="@pageId"> 122 <input type="hidden" name="PageCulture" value="@currentCulture"> 123 <input type="hidden" name="TimeStamp" value="@System.DateTime.UtcNow"> 124 125 <div class="form-group"> 126 <label for="enquiryInputName" class="control-label text-uppercase">@Translate("Name", "Name") <sup>*</sup></label> 127 <input type="text" class="form-control" required name="Name" placeholder='@Translate("EnterYourName", "Enter Your Name")'> 128 </div> 129 130 <div class="form-group"> 131 <label for="enquiryInputCountry" class="control-label text-uppercase">@Translate("SelectYourCountry", "Select Your Country") <sup>*</sup> </label> 132 <select class="form-control" required name="Country"> 133 <option value="">@Translate("SelectYourCountry", "Select your Country")</option> 134 @foreach (var country in countrySelector) 135 { 136 <option value="@country[0, 0]">@country[0, 1]</option> 137 } 138 139 </select> 140 </div> 141 142 <div class="form-group"> 143 <label for="enquiryInputEmail" class="control-label text-uppercase">@Translate("Email", "Email")<sup>*</sup></label> 144 <input type="email" required class="form-control" name="Email" placeholder='@Translate("EnterYourEmail", "Enter Email Address")'> 145 </div> 146 147 <div class="form-group hide"> 148 <label for="enquiryInputEmail2" class="control-label text-uppercase">@Translate("Email", "Email")</label> 149 <input type="text" class="form-control" name="Email2" placeholder='Leave this field blank'> 150 </div> 151 152 <div class="form-group"> 153 <label for="enquiryInputMessage" class="control-label text-uppercase">@Translate("Message", "Message")</label> 154 <textarea class="form-control" required rows="5" name="Message"></textarea> 155 </div> 156 157 <div class="form-group"> 158 <label class="control-label text-uppercase"><sup>*</sup> @Translate("RequiredFields", "Required Fields")</label> 159 </div> 160 161 <div class="text-right"><button type="submit" class="m-btn-send btn btn-default text-uppercase">@Translate("Send", "Send")</button></div> 162 163 </form> 164 165 <script> 166 $("#enquiryform").validate(); 167 </script> 168 169 </div> 170 171 <div class="tab-pane fade" id="QuickQuote"> 172 173 <form role="form" id="quoteform" class="m-form-contact" method="Post" action="/Ajax/ContactUs/ContactUsPostForm.aspx"> 174 175 @*<p class="text-success" id="quoteformAdvice" style="display:none">@Translate("YourRequestWasSent", "Thank you, your request was sent.")</p>*@ 176 177 @if (success && clientMode == "QuickQuote") 178 { 179 <p class="text-success" id="quoteformAdvice">@thanksText</p> 180 } 181 <input type="hidden" name="submitEmail" value="@QuoteEmail"> 182 <input type="hidden" name="clientMode" value="QuickQuote"> 183 <input type="hidden" name="PageId" value="@pageId"> 184 <input type="hidden" name="PageCulture" value="@currentCulture"> 185 <input type="hidden" name="TimeStamp" value="@System.DateTime.UtcNow"> 186 187 <div class="row"> 188 <div class="col-sm-4"> 189 <label for="quoteProductId" class="control-label text-uppercase">@Translate("ItemNumber", "Item Number") <sup>*</sup></label> 190 </div> 191 <div class="col-sm-2"> 192 <label for="quoteQuantity" class="control-label text-uppercase">@Translate("Quantity", "Quantity") <sup>*</sup></label> 193 </div> 194 <div class="col-sm-4"> 195 <label for="quoteNotes" class="control-label text-uppercase">@Translate("Remarks", "Remarks") </label> 196 </div> 197 <div class="col-sm-2"> 198 <label for="" class="control-label text-uppercase small">@Translate("Add/Remove", "Add/Remove") </label> 199 </div> 200 </div> 201 202 203 <!--Quote Product List--> 204 <div id="quoteProductList"> 205 206 <script id="quote_field_template" type="text/template"> 207 208 <div class="row" id="field_row_{field_index}"> 209 210 <div class="form-group col-sm-4"> 211 212 <input type="text" class="form-control required" required id="quoteProductId_{field_index}" name="ProductId_{field_index}" placeholder='@Translate("ItemNumber", "Item Number")'> 213 </div> 214 <div class="form-group col-sm-2"> 215 216 <input type="number" min="1" class="form-control required" id="quoteQuantity_{field_index}" required name="Quantity_{field_index}" placeholder='@Translate("Quantity", "Quantity")'> 217 </div> 218 <div class="form-group col-sm-4"> 219 220 <input type="text" class="form-control" id="quoteNotes_{field_index}" name="Notes_{field_index}" placeholder='@Translate("Remarks", "Remarks")'> 221 </div> 222 <div class="col-sm-2"> 223 224 <div class="text-right"><button type="button" class="m-btn-sm-more text-uppercase removeproduct" data-row="field_row_{field_index}">@Translate("Remove","Remove")</button></div> 225 226 </div> 227 228 @*<div class="form-group col-sm-4" id="AddProduct_{field_index}"> 229 230 <div class="text-left"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_{field_index}" id="AddProductBtn" name="AddProduct">@Translate("Add", "Add")</button></div> 231 232 </div>*@ 233 234 </div> 235 236 </script> 237 238 @if (productCollectionItems.Any() && clientMode == "QuickQuote") 239 { 240 int count = 1; 241 foreach (ProductCollectionItem productCollection in productCollectionItems) 242 { 243 244 <div class="row" id="field_row_@count"> 245 246 <div class="form-group col-sm-4"> 247 248 <input type="text" class="form-control required" required id="quoteProductId_@count" value="@productCollection.ProductNumber" name="ProductId_@count" placeholder='@Translate("ItemNumber", "Item Number")'> 249 </div> 250 <div class="form-group col-sm-2"> 251 252 <input type="number" min="1" class="form-control required" id="quoteQuantity_@count" required name="Quantity_@count" placeholder='@Translate("Quantity", "Quantity")'> 253 </div> 254 <div class="form-group col-sm-4"> 255 256 <input type="text" class="form-control" id="quoteNotes_@count" name="Notes_@count" placeholder='@Translate("Remarks", "Remarks")'> 257 </div> 258 @if (count > 1) 259 { 260 <div class="col-sm-2"> 261 262 <div class="text-right"><button type="button" class="m-btn-sm-more text-uppercase removeproduct" data-row="field_row_@count">@Translate("Remove", "Remove")</button></div> 263 264 </div> 265 266 } 267 268 @if (count == 1) 269 { 270 var style = ""; 271 if (productCollectionItems.Count() > 1) 272 { 273 style = "style='display:none;'"; 274 } 275 276 <div class="col-sm-2" id="AddProduct_1" @style> 277 278 <div class="text-right"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_1" id="AddProduct_1" name="AddProduct">@Translate("Add", "Add")</button></div> 279 280 </div> 281 } 282 283 284 285 @*@if (productCollectionItems.Count() == count) 286 { 287 288 <div class="form-group col-sm-4" id="AddProduct_@count"> 289 290 <div class="text-left"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_@count" id="AddProductBtn" name="AddProduct">@Translate("Add", "Add")</button></div> 291 292 </div> 293 294 }*@ 295 296 </div> 297 298 if (productCollectionItems.Count() == count && productCollectionItems.Count() > 1) 299 { 300 <div id="field_row_databutton" style="margin-left: -6px; margin-right: -6px; display:table;"> 301 <div class="form-group col-sm-4" id="AddProductData"> 302 303 <div class="text-left"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_1">@Translate("Add", "Add")</button></div> 304 305 </div> 306 </div> 307 } 308 309 310 311 ++count; 312 } 313 314 315 } 316 else 317 { 318 <div class="row" id="field_row_1"> 319 320 <div class="form-group col-sm-4"> 321 322 <input type="text" class="form-control" required id="quoteProductId_1" name="ProductId_1" placeholder='@Translate("ItemNumber", "Item Number")'> 323 324 </div> 325 <div class="form-group col-sm-2"> 326 327 <input type="number" min="1" class="form-control" required id="quoteQuantity_1" name="Quantity_1" placeholder='@Translate("Quantity", "Quantity")'> 328 329 </div> 330 <div class="form-group col-sm-4"> 331 332 <input type="text" class="form-control" id="quoteNotes_1" name="Notes_1" placeholder='@Translate("Remarks", "Remarks")'> 333 334 </div> 335 336 337 <div class="col-sm-2" id="AddProduct_1"> 338 339 <div class="text-right"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_1" id="AddProduct_1" name="AddProduct">@Translate("Add", "Add")</button></div> 340 341 </div> 342 343 </div> 344 } 345 346 <div class="row" id="field_row_button"> 347 <div class="form-group col-sm-4" id="AddProductBtn"> 348 349 <div class="text-left"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_1">@Translate("Add", "Add")</button></div> 350 351 </div> 352 </div> 353 354 </div> 355 356 357 <p class="error" id="quoteformAdvice" style="display:none">@Translate("YourRequestWasSent", "Thank you, your request was sent.")</p> 358 359 360 361 <div class="row"> 362 <div class="col-sm-6"> 363 <div class="form-group"> 364 <label for="quoteInputCustomerNumber" class="control-label text-uppercase">@Translate("CustomerNumber", "Customer Number")</label> 365 <input type="text" class="form-control" name="CustomerNumber" placeholder='@Translate("CustomerNumber", "Customer Number")'> 366 </div> 367 </div> 368 <div class="col-sm-6"> 369 <div class="form-group"> 370 <label for="quoteInputOrganisationNumber" class="control-label text-uppercase">@Translate("OrganisationNumber", "Organisation Number") <sup>*</sup></label> 371 <input type="text" class="form-control" required name="OrganisationNumber" placeholder='@Translate("OrganisationNumber", "Organisation Number")'> 372 </div> 373 </div> 374 </div> 375 376 377 <div class="row"> 378 <div class="col-sm-6"> 379 <div class="form-group"> 380 <label for="quoteInputName" class="control-label text-uppercase">@Translate("FirstName", "First Name") <sup>*</sup></label> 381 <input type="text" class="form-control" required name="FirstName" placeholder='@Translate("FirstName", "First Name") '> 382 </div> 383 </div> 384 <div class="col-sm-6"> 385 <div class="form-group"> 386 <label for="quoteInputLastName" class="control-label text-uppercase">@Translate("LastName", "Last Name") <sup>*</sup></label> 387 <input type="text" class="form-control" required name="LastName" placeholder='@Translate("LastName", "Last Name")'> 388 </div> 389 </div> 390 </div> 391 392 393 <div class="row"> 394 <div class="col-sm-6"> 395 <div class="form-group"> 396 <label for="quoteInputAddress" class="control-label text-uppercase">@Translate("PostalAddress", "Postal Address") <sup>*</sup></label> 397 <input type="text" class="form-control" required name="Address" placeholder='@Translate("PostalAddress", "Postsal Address")'> 398 </div> 399 </div> 400 <div class="col-sm-6"> 401 <div class="form-group"> 402 <label for="quoteInputPostCode" class="control-label text-uppercase">@Translate("PostalCode", "Post Code") <sup>*</sup></label> 403 <input type="text" class="form-control" required name="PostCode" placeholder='@Translate("PostalCode", "Post Code")'> 404 </div> 405 </div> 406 </div> 407 408 409 <div class="row"> 410 <div class="col-sm-6"> 411 <div class="form-group"> 412 <label for="quoteInputPlace" class="control-label text-uppercase">@Translate("Town", "Town") <sup>*</sup></label> 413 <input type="text" class="form-control" required name="Place" placeholder='@Translate("Town", "Town")'> 414 </div> 415 </div> 416 <div class="col-sm-6"> 417 <div class="form-group"> 418 <label for="quoteInputPhoneNumber" class="control-label text-uppercase">@Translate("PhoneNumber", "Phone Number") <sup>*</sup></label> 419 <input type="text" class="form-control" required name="PhoneNumber" placeholder='@Translate("PhoneNumber", "Phone Number")'> 420 </div> 421 </div> 422 </div> 423 424 425 426 427 <div class="row"> 428 <div class="col-sm-6"> 429 <div class="form-group"> 430 <label for="quoteInputAddress" class="control-label text-uppercase">@Translate("DeliveryAddress", "Delivery Address") <sup>*</sup></label> 431 <input type="text" class="form-control" required name="DeliveryAddress" placeholder='@Translate("DeliveryAddress", "Delivery Address")'> 432 </div> 433 </div> 434 <div class="col-sm-6"> 435 <div class="form-group"> 436 <label for="quoteInputPostCode" class="control-label text-uppercase">@Translate("DeliveryPostalCode", "Delivery Post Code") <sup>*</sup></label> 437 <input type="text" class="form-control" required name="DeliveryPostCode" placeholder='@Translate("DeliveryPostalCode", "Delivery Post Code")'> 438 </div> 439 </div> 440 </div> 441 442 443 <div class="row"> 444 <div class="col-sm-6"> 445 <div class="form-group"> 446 <label for="quoteInputPlace" class="control-label text-uppercase">@Translate("DeliveryTown", "Delivery Town") <sup>*</sup></label> 447 <input type="text" class="form-control" required name="DeliveryPlace" placeholder='@Translate("DeliveryTown", "Delivery Town")'> 448 </div> 449 </div> 450 <div class="col-sm-6"> 451 452 </div> 453 </div> 454 455 <div class="form-group"> 456 <label for="quoteInputEmail" class="control-label text-uppercase">@Translate("Email", "Email") <sup>*</sup></label> 457 <input type="email" required class="form-control" name="Email" placeholder='@Translate("EnterYourEmail", "Enter Email Address")'> 458 </div> 459 460 <div class="form-group hide"> 461 <label for="quoteInputEmail2" class="control-label text-uppercase">@Translate("Email", "Email")</label> 462 <input type="text" class="form-control" name="Email2" placeholder='Leave this field blank'> 463 </div> 464 465 <div class="form-group"> 466 <label for="quoteInputMessage" class="control-label text-uppercase">@Translate("Message", "Message")</label> 467 <textarea class="form-control" rows="5" name="Message"></textarea> 468 </div> 469 470 <div class="form-group"> 471 <label class="control-label text-uppercase"><sup>*</sup> @Translate("RequiredFields", "Required Fields")</label> 472 </div> 473 474 <div class="text-right"><button type="submit" id="submitId" class="m-btn-send btn btn-default text-uppercase">@Translate("RequestAQuote", "Request a Quote")</button></div> 475 476 </form> 477 478 <script> 479 $("#quoteform").validate(); 480 </script> 481 482 </div> 483 484 <div class="tab-pane fade" id="QuickOrder"> 485 486 @*http://jsfiddle.net/qBURS/2/*@ 487 488 <form role="form" id="orderform" class="m-form-contact" method="post" action="/Ajax/ContactUs/ContactUsPostForm.aspx"> 489 490 @if (success && clientMode == "QuickOrder") 491 { 492 <p class="text-success" id="orderformAdvice">@thanksText</p> 493 } 494 495 <input type="hidden" name="submitEmail" value="@QuoteEmail"> 496 <input type="hidden" name="clientMode" value="QuickOrder"> 497 <input type="hidden" name="PageId" value="@pageId"> 498 <input type="hidden" name="PageCulture" value="@currentCulture"> 499 <input type="hidden" name="TimeStamp" value="@System.DateTime.UtcNow"> 500 501 <div class="row"> 502 <div class="col-sm-4"> 503 504 <label for="orderProductId" class="control-label text-uppercase">@Translate("ItemNumber", "Item Number") <sup>*</sup></label> 505 </div> 506 <div class="col-sm-2"> 507 <label for="orderQuantity" class="control-label text-uppercase">@Translate("Quantity", "Quantity") <sup>*</sup></label> 508 </div> 509 <div class="col-sm-4"> 510 <label for="orderNotes" class="control-label text-uppercase">@Translate("Remarks", "Remarks") </label> 511 </div> 512 <div class="col-sm-2"> 513 <label for="" class="control-label text-uppercase small">@Translate("Add/Remove", "Add/Remove") </label> 514 </div> 515 </div> 516 517 <!--Order Product List--> 518 <div id="orderProductList"> 519 520 <script id="order_field_template" type="text/template"> 521 522 <div class="row" id="field_row_{field_index}"> 523 524 <div class="form-group col-sm-4"> 525 526 <input type="text" class="form-control required" required id="orderProductId_{field_index}" name="ProductId_{field_index}" placeholder='@Translate("ItemNumber", "Item Number")'> 527 </div> 528 <div class="form-group col-sm-2"> 529 530 <input type="number" min="1" class="form-control required" required id="orderQuantity_{field_index}" name="Quantity_{field_index}" placeholder='@Translate("Quantity", "Quantity")'> 531 </div> 532 <div class="form-group col-sm-4"> 533 534 <input type="text" class="form-control" id="orderNotes_{field_index}" name="Notes_{field_index}" placeholder='@Translate("Remarks", "Remarks")'> 535 </div> 536 537 <div class="col-sm-2"> 538 539 <div class="text-right"><button type="button" class="m-btn-sm-more text-uppercase removeproduct" data-row="field_row_{field_index}">@Translate("Remove", "Remove")</button></div> 540 541 </div> 542 543 @*<div class="form-group col-sm-4" id="AddProduct_{field_index}"> 544 545 <div class="text-left"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_{field_index}" name="AddProduct">@Translate("Add", "Add")</button></div> 546 547 </div>*@ 548 549 </div> 550 551 </script> 552 553 @if (productCollectionItems.Any() && clientMode == "QuickOrder") 554 { 555 int count = 1; 556 foreach (ProductCollectionItem productCollection in productCollectionItems) 557 { 558 <div class="row" id="field_row_@count"> 559 560 <div class="form-group col-sm-4"> 561 562 <input type="text" class="form-control" required name="ProductId_@count" value="@productCollection.ProductNumber" id="orderProductId_@count" placeholder='@Translate("ItemNumber", "Item Number")'> 563 </div> 564 <div class="form-group col-sm-2"> 565 566 <input type="number" min="1" class="form-control" name="Quantity_@count" required id="orderQuantity_@count" placeholder='@Translate("Quantity", "Quantity")'> 567 </div> 568 <div class="form-group col-sm-4"> 569 570 <input type="text" class="form-control" id="orderNotes_@count" name="Notes_@count" placeholder='@Translate("Remarks", "Remarks")'> 571 </div> 572 573 574 @if (count > 1) 575 { 576 <div class="col-sm-2"> 577 578 <div class="text-right"><button type="button" class="m-btn-sm-more text-uppercase removeproduct" data-row="field_row_@count">@Translate("Remove", "Remove")</button></div> 579 580 </div> 581 } 582 583 584 @if (count == 1) 585 { 586 var style = ""; 587 if (productCollectionItems.Count() > 1) 588 { 589 style = "style='display:none;'"; 590 } 591 592 <div class="col-sm-2" id="AddProduct_1" @style> 593 594 <div class="text-right"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_1" id="AddProduct_1" name="AddProduct">@Translate("Add", "Add")</button></div> 595 596 </div> 597 } 598 599 @*@if (productCollectionItems.Count() == count) 600 { 601 <div class="form-group col-sm-4" id="AddProduct_@count"> 602 603 <div class="text-left"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_@count" name="AddProduct">@Translate("Add", "Add")</button></div> 604 605 </div> 606 }*@ 607 608 609 </div> 610 611 612 if (productCollectionItems.Count() == count && productCollectionItems.Count() > 1) 613 { 614 <div id="field_row_databutton" style="margin-left: -6px; margin-right: -6px; display:table;"> 615 <div class="form-group col-sm-4" id="AddProductData"> 616 617 <div class="text-left"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_1">@Translate("Add", "Add")</button></div> 618 619 </div> 620 </div> 621 } 622 ++count; 623 } 624 } 625 else 626 { 627 <div class="row" id="field_row_1"> 628 629 <div class="form-group col-sm-4"> 630 631 <input type="text" class="form-control" required name="ProductId_1" id="orderProductId_1" placeholder='@Translate("ItemNumber", "Item Number")'> 632 </div> 633 <div class="form-group col-sm-2"> 634 635 <input type="number" min="1" class="form-control" name="Quantity_1" required id="orderQuantity_1" placeholder='@Translate("Quantity", "Quantity")'> 636 </div> 637 <div class="form-group col-sm-4"> 638 639 <input type="text" class="form-control" id="orderNotes_1" name="Notes_1" placeholder='@Translate("Remarks", "Remarks")'> 640 </div> 641 642 <div class="col-sm-2" id="AddProduct_1"> 643 644 <div class="text-right"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_1" id="AddProduct_1" name="AddProduct">@Translate("Add", "Add")</button></div> 645 646 </div> 647 648 649 @*<div class="col-sm-2"> 650 651 <div class="text-right"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_1" name="AddProduct">@Translate("Add", "Add")</button></div> 652 653 </div>*@ 654 655 </div> 656 } 657 658 659 <div class="row" id="field_row_button"> 660 <div class="form-group col-sm-4" id="AddProductBtn"> 661 662 <div class="text-left"><button type="button" class="m-btn-sm-more text-uppercase addproduct" data-row="field_row_1">@Translate("Add", "Add")</button></div> 663 664 </div> 665 </div> 666 667 </div> 668 669 670 <p class="error" id="orderformAdvice" style="display:none">@Translate("YourRequestWasSent", "Thank you, your request was sent.")</p> 671 672 673 <div class="row"> 674 <div class="col-sm-6"> 675 <div class="form-group"> 676 <label for="orderInputCustomerNumber" class="control-label text-uppercase">@Translate("CustomerNumber", "Customer Number")</label> 677 <input type="text" class="form-control" name="CustomerNumber" id="orderInputCustomerNumber" placeholder='@Translate("CustomerNumber", "Customer Number")'> 678 </div> 679 </div> 680 <div class="col-sm-6"> 681 <div class="form-group"> 682 <label for="orderInputOrganisationNumber" class="control-label text-uppercase">@Translate("OrganisationNumber", "Organisation Number") <sup>*</sup></label> 683 <input type="text" class="form-control" required name="OrganisationNumber" id="orderInputOrganisationNumber" placeholder='@Translate("OrganisationNumber", "Organisation Number")'> 684 </div> 685 </div> 686 </div> 687 688 689 <div class="row"> 690 <div class="col-sm-6"> 691 <div class="form-group"> 692 <label for="orderInputName" class="control-label text-uppercase">@Translate("FirstName", "First Name") <sup>*</sup></label> 693 <input type="text" class="form-control" required name="FirstName" id="orderInputName" placeholder='@Translate("FirstName", "First Name")'> 694 </div> 695 </div> 696 <div class="col-sm-6"> 697 <div class="form-group"> 698 <label for="orderInputLastName" class="control-label text-uppercase">@Translate("LastName", "Efternamn") <sup>*</sup></label> 699 <input type="text" class="form-control" required name="LastName" id="orderInputLastName" placeholder='@Translate("LastName", "Last Name")'> 700 </div> 701 </div> 702 </div> 703 704 705 <div class="row"> 706 <div class="col-sm-6"> 707 <div class="form-group"> 708 <label for="orderInputAddress" class="control-label text-uppercase">@Translate("PostalAddress", "Postal Address") <sup>*</sup></label> 709 <input type="text" class="form-control" required name="Address" placeholder='@Translate("PostalAddress", "Postal Address")'> 710 </div> 711 </div> 712 <div class="col-sm-6"> 713 <div class="form-group"> 714 <label for="orderInputPostCode" class="control-label text-uppercase">@Translate("PostalCode", "Post Code") <sup>*</sup></label> 715 <input type="text" class="form-control" required name="PostCode" placeholder='@Translate("PostalCode", "Post Code")'> 716 </div> 717 </div> 718 </div> 719 720 721 <div class="row"> 722 <div class="col-sm-6"> 723 <div class="form-group"> 724 <label for="orderInputPlace" class="control-label text-uppercase">@Translate("Town", "Town") <sup>*</sup></label> 725 <input type="text" class="form-control" required name="Place" placeholder='@Translate("Town", "Town")'> 726 </div> 727 </div> 728 <div class="col-sm-6"> 729 <div class="form-group"> 730 <label for="orderInputPhoneNumber" class="control-label text-uppercase">@Translate("PhoneNumber", "Phone Number") <sup>*</sup></label> 731 <input type="text" class="form-control" required name="PhoneNumber" placeholder='@Translate("PhoneNumber", "Phone Number")'> 732 </div> 733 </div> 734 </div> 735 736 737 <div class="row"> 738 <div class="col-sm-6"> 739 <div class="form-group"> 740 <label for="orderInputDeliveryAddress" class="control-label text-uppercase">@Translate("DeliveryAddress", "Delivery Address") <sup>*</sup></label> 741 <input type="text" class="form-control" required name="DeliveryAddress" placeholder='@Translate("DeliveryAddress", "Delivery Address")'> 742 </div> 743 </div> 744 <div class="col-sm-6"> 745 <div class="form-group"> 746 <label for="orderInputDeliveryPostCode" class="control-label text-uppercase">@Translate("DeliveryPostalCode", "Delivery Post Code") <sup>*</sup></label> 747 <input type="text" class="form-control" required name="DeliveryPostCode" placeholder='@Translate("DeliveryPostalCode", "Delivery Post Code")'> 748 </div> 749 </div> 750 </div> 751 752 753 <div class="row"> 754 <div class="col-sm-6"> 755 <div class="form-group"> 756 <label for="orderInputDeliveryPlace" class="control-label text-uppercase">@Translate("DeliveryTown", "Delivery Town") <sup>*</sup></label> 757 <input type="text" class="form-control" required name="DeliveryPlace" placeholder='@Translate("DeliveryTown", "Delivery Town")'> 758 </div> 759 </div> 760 <div class="col-sm-6"> 761 762 </div> 763 </div> 764 765 <div class="form-group"> 766 <label for="orderInputEmail" class="control-label text-uppercase">@Translate("Email", "Email") <sup>*</sup></label> 767 <input type="email" required class="form-control" name="Email"placeholder='@Translate("EnterYourEmail", "Enter Email Address")'> 768 </div> 769 770 <div class="form-group hide"> 771 <label for="orderInputEmail2" class="control-label text-uppercase">@Translate("Email", "Email")</label> 772 <input type="text" class="form-control" name="Email2" placeholder='Leave this field blank'> 773 </div> 774 775 <div class="form-group"> 776 <label for="orderInputMessage" class="control-label text-uppercase">@Translate("Message", "Message")</label> 777 <textarea class="form-control" rows="5" name="Message" id="orderInputMessage"></textarea> 778 </div> 779 780 <div class="form-group"> 781 <label class="control-label text-uppercase"> <sup>*</sup> @Translate("RequiredFields", "Required Fields")</label> 782 </div> 783 784 <div class="text-right"><button type="submit" class="m-btn-send btn btn-default text-uppercase">@Translate("SubmitOrder", "Submit Order")</button></div> 785 786 </form> 787 788 <script> 789 $("#orderform").validate(); 790 </script> 791 792 </div> 793 794 <div class="tab-pane fade" id="newsletter"> 795 796 @*Hags Changed Swedish Newsletter signup*@ 797 @if (currentCulture == "sv-SE") 798 { 799 800 <script src="https://forms.apsisforms.com/formbuilder.js"></script> 801 <script> 802 (function() { 803 var form = new ApsisForms.FormbuilderInstance(); 804 form.init({ 805 formId: '917c5ffe030a6f7a0bd034248ac6e645' 806 }); 807 })(); 808 </script> 809 810 <div class="afp-917c5ffe030a6f7a0bd034248ac6e645"></div> 811 812 } 813 else 814 { 815 816 <form role="form" id="newsform" class="m-form-contact" method="post" action="/Ajax/ContactUs/ContactUsPostForm.aspx"> 817 818 @if (success && clientMode == "newsletter") 819 { 820 <p class="text-success" id="enquiryformAdvice">@thanksText</p> 821 } 822 823 <input type="hidden" name="submitEmail" value="@NewsLetterEmail"> 824 <input type="hidden" name="clientMode" value="newsletter"> 825 <input type="hidden" name="PageId" value="@pageId"> 826 <input type="hidden" name="PageCulture" value="@currentCulture"> 827 <input type="hidden" name="TimeStamp" value="@System.DateTime.UtcNow"> 828 829 <div class="form-group"> 830 <label for="Name" class="control-label text-uppercase">@Translate("Name", "Name") <sup>*</sup></label> 831 <input type="text" class="form-control" required name="Name" placeholder='@Translate("EnterYourName", "Enter Your Name")'> 832 </div> 833 834 <div class="form-group"> 835 <label for="Country" class="control-label text-uppercase">@Translate("SelectYourCountry", "Select Your Country") <sup>*</sup> </label> 836 <select class="form-control" required name="Country"> 837 <option value="">@Translate("SelectYourCountry", "Select your Country")</option> 838 @foreach (var country in countrySelector) 839 { 840 <option value="@country[0, 0]">@country[0, 1]</option> 841 } 842 </select> 843 </div> 844 845 <div class="form-group"> 846 <label for="Email" class="control-label text-uppercase">@Translate("Email", "Email")<sup>*</sup></label> 847 <input type="email" required class="form-control" name="Email" placeholder='@Translate("EnterYourEmail", "Enter Email Address")'> 848 </div> 849 850 <div class="form-group hide"> 851 <label for="enquiryInputEmail2" class="control-label text-uppercase">@Translate("Email", "Email")</label> 852 <input type="text" class="form-control" name="Email2" placeholder='Leave this field blank'> 853 </div> 854 855 <div class="form-group"> 856 <label for="Message" class="control-label text-uppercase">@Translate("Message", "Message")</label> 857 <textarea class="form-control" required rows="5" name="Message"></textarea> 858 </div> 859 860 <div class="form-group"> 861 <label class="control-label text-uppercase"><sup>*</sup> @Translate("RequiredFields", "Required Fields")</label> 862 </div> 863 864 <div class="text-right"><button type="submit" class="m-btn-send btn btn-default text-uppercase">@Translate("Send", "Send")</button></div> 865 866 </form> 867 868 <script> 869 $("#newsform").validate(); 870 </script> 871 } 872 </div> 873 874 </div> 875 876 </div> 877 878 </div> <!-- row --> 879 880 </div> <!-- container-fluid --> 881 882 </div> <!-- l-page --> 883 884 </div> 885 886
Error executing template "/Designs/HagsCore/Paragraph/Worldwide Contacts.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_ba779cc318694b928b75fd0e98fa8261.Execute() in C:\Projects\Hags_Dw9\Files\Templates\Designs\HagsCore\Paragraph\Worldwide Contacts.cshtml:line 13
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System.Web.Optimization; 3 @using Dynamicweb.Content.Items; 4 @using Dynamicweb.Security.UserManagement; 5 @using HagsWeb.Library.Methods.HagsUsers; 6 @{ 7 Dynamicweb.Content.Area area = new Dynamicweb.Content.AreaService().GetArea(Dynamicweb.Frontend.PageView.Current().AreaID); 8 9 Item Item = Dynamicweb.Content.Items.Item.GetItemById(GetString("Item.SystemName"), GetString("Item.Id")); 10 string areaLongLang = GetGlobalValue("Global:Area.LongLang"); //en-GB, sv-SE 11 12 // The areas social media configuration on initial page load 13 string social = Dynamicweb.Frontend.PageView.Current().Area.Item["Social_Media"].ToString(); 14 List<Item> socialMediaList = new List<Item>(); 15 16 foreach (var s in social.Split(',').ToArray()) 17 { 18 Item media = Dynamicweb.Content.Items.Item.GetItemById("Social_Links", s); 19 if (media != null) 20 { 21 socialMediaList.Add(media); 22 } 23 } 24 25 string selectedCountry = areaLongLang.Substring(areaLongLang.Length - 2); 26 27 if (Dynamicweb.Frontend.PageView.Current().AreaID == 1) 28 { 29 selectedCountry = ""; // default 30 } 31 32 Group countryGroup = HagsCustomModules.Ajax.WorldContacts.WorldContacts.GetCurrentGroup(selectedCountry); 33 34 UserCollection countryUsers = null; 35 UserCollection distributorUsers = null; 36 UserCollection subsiduaryUsers = null; 37 string countryGroupName = String.Empty; 38 string countryGroupMap = String.Empty; 39 HashSet<String[,]> ddList = new HashSet<string[,]>(); 40 41 if (countryGroup != null) 42 { 43 var tuple = UsersFilter.GetCountryGroup(countryGroup, selectedCountry.ToUpper()); 44 45 countryUsers = tuple.Item1; 46 distributorUsers = tuple.Item2; 47 subsiduaryUsers = tuple.Item3; 48 countryGroupName = tuple.Item4; 49 countryGroupMap = tuple.Item5; 50 ddList = tuple.Item6; 51 } 52 53 54 55 } 56 @*http://doc.dynamicweb.com/forum/cms-standard-features/disappointed-with-the-maps-module?M=BasicForum&PID=1605*@ 57 @*http://doc.dynamicweb.com/forum/development/dealer-search-outdates-as-of-dw8?M=BasicForum&PID=1605*@ 58 59 @Scripts.Render("~/bundle/WorldContacts") 60 61 <input type="hidden" id="selectedCountry" value="@selectedCountry" /> 62 63 <div class="m-worldwide m-theme-background-lightgrey"> 64 65 <div class="m-worldwide-select"> 66 67 <div class="l-page"> 68 69 <div class="container-fluid"> 70 71 @if (ddList.Count() > 0) 72 { 73 <label for="selectCountry">@Translate("WorldwideContacts", "Worldwide Contacts"):</label> 74 75 <div class="btn-group dropdown" id="selectCountry"> 76 77 <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> 78 79 @Translate("SelectYourCountry", "Select your Country") <span class="caret"></span> 80 81 </button> 82 83 84 <ul class="dropdown-menu" role="listbox"> 85 @foreach (var a in ddList) 86 { 87 <li> 88 <span> 89 <img src="@a[0, 2]" align="middle"><a href="#" data-ajax="@a[0, 0].ToLower()">@a[0, 1]</a> 90 </span> 91 </li> 92 93 } 94 </ul> 95 96 </div> 97 98 } 99 100 101 </div> <!-- container-fluid --> 102 103 </div> <!-- l-page --> 104 105 </div> <!-- m-worldwide-select --> 106 107 <div class="l-page"> 108 109 <div class="container-fluid"> 110 111 <div class="row"> 112 <div class="col-md-9"> 113 114 <div class="row"> 115 116 <div class="col-ms-7 col-sm-7"> 117 118 <div class="m-generalcontent" id="contactusContent"> 119 120 <h3>@GetString("Item.Heading.Value")</h3> 121 122 <p class="countryContent">@GetString("Item.Country_Content.Value")</p> 123 124 </div> <!-- m-generalcontent --> 125 126 </div> 127 128 129 <div class="col-ms-5 col-sm-5"> 130 131 <div class="m-worldwide-map" id="countryMap"> 132 133 @if (!String.IsNullOrEmpty(countryGroupMap)) 134 { 135 <img src="Files/@countryGroupMap" class="img-responsive"> 136 } 137 138 </div> 139 140 </div> 141 142 143 </div> <!-- row --> 144 145 <div class="m-generalcontent" id="buttonLinks"> 146 147 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" id="btnInsp" href="@GetString("Item.Inspiration_Button.Button_Link")" role="button">@GetString("Item.Inspiration_Button.Button_Text.Value")</a> 148 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" id="btnCtc" href="@GetString("Item.Contact_Button.Button_Link")" role="button">@GetString("Item.Contact_Button.Button_Text.Value")</a> 149 150 </div> <!-- m-generalcontent --> 151 152 <div id="adviceMessage"></div> 153 154 </div> 155 <div class="col-md-3" id="worldwideInfo"> 156 157 @if (countryUsers != null && countryUsers.Count > 0) 158 { 159 160 <div class="m-worldwide-info" id="worldwideInfo"> 161 162 <h3>@countryGroupName</h3> 163 164 <div id="Country" class="contactspanel"> 165 166 @foreach (var countryUser in countryUsers) 167 { 168 var name = countryUser.Name; 169 var address = countryUser.Address; 170 var address2 = countryUser.Address2; 171 var city = countryUser.City; 172 var zipCode = countryUser.Zip; 173 var state = countryUser.State; 174 var country = countryUser.Country; 175 var phone = countryUser.Phone.Trim(); 176 var fax = countryUser.Fax.Trim(); 177 var email = countryUser.Email.Trim(); 178 //var sort = user. 179 var webSite = countryUser.CustomFieldValues.Where(n => n.CustomField.SystemName == "AccessUser_UserWebsite") 180 .Select(n => n.Value).FirstOrDefault().ToString().Trim(); 181 182 <div class="m-generalcontent"> 183 <div class="h-card vcard"> 184 <div class="h-adr adr"> 185 186 <p> 187 @if (!String.IsNullOrWhiteSpace(name)) 188 { 189 <span class="fn p-org org">@name</span><br> 190 } 191 @*<span class="fn p-org org">SARL ABC Diffusion</span><br>*@ 192 @if (!String.IsNullOrWhiteSpace(address)) 193 { 194 <span class="p-street-address street-address">@address</span><br> 195 } 196 @*<span class="p-street-address street-address">Zi La Houche</span><br>*@ 197 @if (!String.IsNullOrWhiteSpace(city)) 198 { 199 <span class="p-street-address street-address">@city</span><br> 200 } 201 @if (!String.IsNullOrWhiteSpace(state)) 202 { 203 <span class="p-street-address street-address">@state</span><br> 204 } 205 206 @if (!String.IsNullOrWhiteSpace(zipCode)) 207 { 208 <span class="p-postal-code postal-code">@zipCode</span><span class="p-locality locality">@city</span><br> 209 } 210 @if (!String.IsNullOrWhiteSpace(country)) 211 { 212 <span class="p-locality locality">@country</span><br> 213 } 214 215 @*<span class="p-postal-code postal-code">702 40</span> <span class="p-locality locality">Aneby</span>*@ 216 </p> 217 </div> 218 </div> 219 <ul class="m-icon-links list-unstyled"> 220 @if (!String.IsNullOrWhiteSpace(phone)) 221 { 222 <li><img class="clearfix m-icon pull-left" src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/telephone.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/telephone.png"><span>@phone</span></li> 223 } 224 @if (!String.IsNullOrWhiteSpace(fax)) 225 { 226 <li><img class="clearfix m-icon pull-left" src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/fax.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/fax.png"><span>@fax</span></li> 227 } 228 229 @if (!String.IsNullOrWhiteSpace(email)) 230 { 231 <li><a href="mailto:@email" class="clearfix"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/email.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/email.png" class="m-icon pull-left"><span>@email</span></a></li> 232 } 233 234 @if (!String.IsNullOrWhiteSpace(webSite)) 235 { 236 <li><a href="@webSite" class="clearfix"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/website.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/website.png" class="m-icon pull-left"><span>@webSite</span></a></li> 237 } 238 239 </ul> 240 </div> <!-- m-generalcontent --> 241 } 242 243 </div> 244 245 246 <div id="Distributors" class="contactspanel" style="display: none;"> 247 248 @if (distributorUsers != null && distributorUsers.Count > 0) 249 { 250 foreach (var distributor in distributorUsers) 251 { 252 var name = distributor.Name; 253 var address = distributor.Address; 254 var address2 = distributor.Address2; 255 var city = distributor.City; 256 var zipCode = distributor.Zip; 257 var state = distributor.State; 258 var country = distributor.Country; 259 var phone = distributor.Phone.Trim(); 260 var fax = distributor.Fax.Trim(); 261 var email = distributor.Email.Trim(); 262 var webSite = distributor.CustomFieldValues.Where(n => n.CustomField.SystemName == "AccessUser_UserWebsite") 263 .Select(n => n.Value).FirstOrDefault().ToString().Trim(); 264 265 <div class="m-generalcontent"> 266 <div class="h-card vcard"> 267 <div class="h-adr adr"> 268 269 <p> 270 @if (!String.IsNullOrWhiteSpace(name)) 271 { 272 <span class="fn p-org org">@name</span><br> 273 } 274 @*<span class="fn p-org org">SARL ABC Diffusion</span><br>*@ 275 @if (!String.IsNullOrWhiteSpace(address)) 276 { 277 <span class="p-street-address street-address">@address</span><br> 278 } 279 @*<span class="p-street-address street-address">Zi La Houche</span><br>*@ 280 @if (!String.IsNullOrWhiteSpace(city)) 281 { 282 <span class="p-street-address street-address">@city</span><br> 283 } 284 @if (!String.IsNullOrWhiteSpace(state)) 285 { 286 <span class="p-street-address street-address">@state</span><br> 287 } 288 289 @if (!String.IsNullOrWhiteSpace(zipCode)) 290 { 291 <span class="p-postal-code postal-code">@zipCode</span><span class="p-locality locality">@city</span><br> 292 } 293 @if (!String.IsNullOrWhiteSpace(country)) 294 { 295 <span class="p-locality locality">@country</span><br> 296 } 297 298 @*<span class="p-postal-code postal-code">702 40</span> <span class="p-locality locality">Aneby</span>*@ 299 </p> 300 </div> 301 </div> 302 <ul class="m-icon-links list-unstyled"> 303 @if (!String.IsNullOrWhiteSpace(phone)) 304 { 305 <li><img class="clearfix m-icon pull-left" src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/telephone.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/telephone.png"><span>@phone</span></li> 306 } 307 @if (!String.IsNullOrWhiteSpace(fax)) 308 { 309 <li><img class="clearfix m-icon pull-left" src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/fax.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/fax.png"><span>@fax</span></li> 310 } 311 312 @if (!String.IsNullOrWhiteSpace(email)) 313 { 314 <li><a href="mailto:@email" class="clearfix"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/email.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/email.png" class="m-icon pull-left"><span>@email</span></a></li> 315 } 316 317 @if (!String.IsNullOrWhiteSpace(webSite)) 318 { 319 <li><a href="@webSite" class="clearfix"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/website.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/website.png" class="m-icon pull-left"><span>@webSite</span></a></li> 320 } 321 322 </ul> 323 </div> <!-- m-generalcontent --> 324 } 325 } 326 327 </div> 328 329 330 <div id="Subsidiaries" class="contactspanel" style="display: none;"> 331 @if (subsiduaryUsers != null && subsiduaryUsers.Count > 0) 332 { 333 foreach (var subsiduary in subsiduaryUsers) 334 { 335 var name = subsiduary.Name; 336 var address = subsiduary.Address; 337 var address2 = subsiduary.Address2; 338 var city = subsiduary.City; 339 var zipCode = subsiduary.Zip; 340 var state = subsiduary.State; 341 var country = subsiduary.Country; 342 var phone = subsiduary.Phone.Trim(); 343 var fax = subsiduary.Fax.Trim(); 344 var email = subsiduary.Email.Trim(); 345 var webSite = subsiduary.CustomFieldValues.Where(n => n.CustomField.SystemName == "AccessUser_UserWebsite") 346 .Select(n => n.Value).FirstOrDefault().ToString().Trim(); 347 348 <div class="m-generalcontent"> 349 <div class="h-card vcard"> 350 <div class="h-adr adr"> 351 352 <p> 353 @if (!String.IsNullOrWhiteSpace(name)) 354 { 355 <span class="fn p-org org">@name</span><br> 356 } 357 @*<span class="fn p-org org">SARL ABC Diffusion</span><br>*@ 358 @if (!String.IsNullOrWhiteSpace(address)) 359 { 360 <span class="p-street-address street-address">@address</span><br> 361 } 362 @*<span class="p-street-address street-address">Zi La Houche</span><br>*@ 363 @if (!String.IsNullOrWhiteSpace(city)) 364 { 365 <span class="p-street-address street-address">@city</span><br> 366 } 367 @if (!String.IsNullOrWhiteSpace(state)) 368 { 369 <span class="p-street-address street-address">@state</span><br> 370 } 371 372 @if (!String.IsNullOrWhiteSpace(zipCode)) 373 { 374 <span class="p-postal-code postal-code">@zipCode</span><span class="p-locality locality">@city</span><br> 375 } 376 @if (!String.IsNullOrWhiteSpace(country)) 377 { 378 <span class="p-locality locality">@country</span><br> 379 } 380 381 @*<span class="p-postal-code postal-code">702 40</span> <span class="p-locality locality">Aneby</span>*@ 382 </p> 383 </div> 384 </div> 385 <ul class="m-icon-links list-unstyled"> 386 @if (!String.IsNullOrWhiteSpace(phone)) 387 { 388 <li><img class="clearfix m-icon pull-left" src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/telephone.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/telephone.png"><span>@phone</span></li> 389 } 390 @if (!String.IsNullOrWhiteSpace(fax)) 391 { 392 <li><img class="clearfix m-icon pull-left" src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/fax.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/fax.png"><span>@fax</span></li> 393 } 394 395 @if (!String.IsNullOrWhiteSpace(email)) 396 { 397 <li><a href="mailto:@email" class="clearfix"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/email.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/email.png" class="m-icon pull-left"><span>@email</span></a></li> 398 } 399 400 @if (!String.IsNullOrWhiteSpace(webSite)) 401 { 402 <li><a href="@webSite" class="clearfix"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/contact/website.png" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/contact/website.png" class="m-icon pull-left"><span>@webSite</span></a></li> 403 } 404 405 </ul> 406 </div> <!-- m-generalcontent --> 407 } 408 } 409 </div> 410 411 412 <div class="m-generalcontent" id="socialIcons"> 413 <p>@Translate("FollowHAGS", "Follow HAGS:")</p> 414 <div class="m-social"> 415 <ul class="list-inline"> 416 @foreach (Item prop in socialMediaList) 417 { 418 var linkUrl = prop["Social_Link"]; 419 string linkIcon = "/Files/Templates/Designs/HagsCore/res/img/icons/social/" + prop["Social_Icon"] + ".png"; 420 <li><a href="@linkUrl" target="_blank"><img src="@linkIcon" class="m-icon" /></a></li> 421 } 422 </ul> 423 </div> <!-- m-social --> 424 </div> <!-- m-generalcontent --> 425 426 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" data-ajax="Country" href="#" role="button" style="display: none;">@GetString("Item.Offices_Button.Button_Text.Value")</a> 427 428 @{ 429 var btnDistDisplay = "style='display: none;'"; 430 if (distributorUsers != null) 431 { 432 btnDistDisplay = "style='display: block; margin-bottom:5px'"; 433 } 434 } 435 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" data-ajax="Distributors" href="#" role="button" @btnDistDisplay>@GetString("Item.Distributors_Button.Button_Text.Value")</a> 436 437 @{ 438 var btnSubsDisplay = "style='display: none;'"; 439 if (subsiduaryUsers != null) 440 { 441 btnSubsDisplay = "style='display: block;'"; 442 } 443 } 444 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" data-ajax="Subsidiaries" href="#" role="button" @btnSubsDisplay>@GetString("Item.Subsidiaries_Button.Button_Text.Value")</a> 445 446 447 </div><!-- m-worldwide-info --> 448 449 } 450 451 </div> 452 </div> <!-- row --> 453 454 </div> <!-- container-fluid --> 455 456 </div> <!-- l-page --> 457 458 </div> <!-- m-worldwide --> 459