Partners

Partners
Error compiling template "Designs/PacificBag/TemplateRenderer/Partners.cshtml"
Line 754: 'CountryText' does not contain a definition for 'GetRegionTexts'

1 //------------------------------------------------------------------------------ 2 // <auto-generated> 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319.42000 5 // 6 // Changes to this file may cause incorrect behavior and will be lost if 7 // the code is regenerated. 8 // </auto-generated> 9 //------------------------------------------------------------------------------ 10 11 namespace CompiledRazorTemplates.Dynamic { 12 13 #line 87 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 14 using System; 15 16 #line default 17 #line hidden 18 using System.Collections.Generic; 19 using System.Linq; 20 21 #line 86 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 22 using Dynamicweb.Rendering; 23 24 #line default 25 #line hidden 26 27 #line 3 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 28 using Dynamicweb.Content; 29 30 #line default 31 #line hidden 32 33 #line 88 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 34 using System.Web; 35 36 #line default 37 #line hidden 38 39 #line 89 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 40 using System.Collections.Specialized; 41 42 #line default 43 #line hidden 44 45 46 public class RazorEngine_d0b6642f86e04c388c3b935c29e2f6c5 : RazorTemplateBase<RazorTemplateModel<Template>> { 47 48 #line hidden 49 50 #line 10 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 51 52 public static string GetImage(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "jpg", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "PacificBag") 53 { 54 Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); 55 string currDevice = currentPageview.Device.ToString(); 56 string alternativeImage = !String.IsNullOrEmpty(currentPageview.Area.Item["NoImage"].ToString()) ? currentPageview.Area.Item["NoImage"].ToString() : "/Files/Templates/Designs/"+ designName + "/images/alternativeImage.jpg"; 57 string widthString = ""; 58 string heightString = ""; 59 string getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : ""; 60 string getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : ""; 61 string bgColor = !string.IsNullOrEmpty(background) ? "&amp;Background="+background : ""; 62 int getImageWidth = imageWidth != 0 ? imageWidth : 0; 63 int getImageHeight = imageHeight != 0 ? imageHeight : 0; 64 65 if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 66 { 67 getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; 68 getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; 69 } 70 else if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 71 { 72 getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; 73 getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; 74 } 75 76 if (getImageWidth != 0) 77 { 78 widthString = "&amp;Width=" + getImageWidth; 79 } 80 if (getImageHeight != 0) 81 { 82 heightString = "&amp;Height=" + getImageHeight; 83 } 84 85 string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; 86 return output; 87 } 88 89 public static string GetImageWhiteSpace(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "jpg", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "PacificBag") 90 { 91 Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); 92 string currDevice = currentPageview.Device.ToString(); 93 string alternativeImage = "/Files/Templates/Designs/" + designName + "/images/white80.png"; 94 string widthString = ""; 95 string heightString = ""; 96 string getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : ""; 97 string getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : ""; 98 string bgColor = !string.IsNullOrEmpty(background) ? "&amp;Background="+background : ""; 99 int getImageWidth = imageWidth != 0 ? imageWidth : 0; 100 int getImageHeight = imageHeight != 0 ? imageHeight : 0; 101 102 if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 103 { 104 getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; 105 getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; 106 } 107 else if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 108 { 109 getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; 110 getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; 111 } 112 113 if (getImageWidth != 0) 114 { 115 widthString = "&amp;Width=" + getImageWidth; 116 } 117 if (getImageHeight != 0) 118 { 119 heightString = "&amp;Height=" + getImageHeight; 120 } 121 122 string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; 123 return output; 124 } 125 126 #line default 127 #line hidden 128 129 130 #line 154 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 131 public RazorEngine.Templating.TemplateWriter CountrySelect(System.Collections.Generic.List<String> countriesList, Dictionary<string, string> countriesNames){ 132 #line default 133 #line hidden 134 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 135 136 #line 154 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 137 138 139 140 #line default 141 #line hidden 142 WriteLiteralTo(__razor_helper_writer, " <label"); 143 144 WriteLiteralTo(__razor_helper_writer, " class=\"text-left\""); 145 146 WriteLiteralTo(__razor_helper_writer, ">"); 147 148 149 #line 155 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 150 WriteTo(__razor_helper_writer, Translate("selectYourCountry", "Select your country:")); 151 152 153 #line default 154 #line hidden 155 WriteLiteralTo(__razor_helper_writer, "</label>\r\n"); 156 157 WriteLiteralTo(__razor_helper_writer, " <select"); 158 159 WriteLiteralTo(__razor_helper_writer, " name=\"country\""); 160 161 WriteLiteralTo(__razor_helper_writer, ">\r\n <option"); 162 163 WriteLiteralTo(__razor_helper_writer, " selected=\"selected\""); 164 165 WriteLiteralTo(__razor_helper_writer, " value=\"\""); 166 167 WriteLiteralTo(__razor_helper_writer, ">"); 168 169 170 #line 157 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 171 WriteTo(__razor_helper_writer, Translate("all", "All")); 172 173 174 #line default 175 #line hidden 176 WriteLiteralTo(__razor_helper_writer, "</option>\r\n"); 177 178 WriteLiteralTo(__razor_helper_writer, " "); 179 180 181 #line 158 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 182 WriteTo(__razor_helper_writer, RenderSnippet("US")); 183 184 185 #line default 186 #line hidden 187 WriteLiteralTo(__razor_helper_writer, "\r\n"); 188 189 190 #line 159 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 191 192 193 #line default 194 #line hidden 195 196 #line 159 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 197 foreach (string countryCode in countriesList.OrderBy(s => s)) 198 { 199 string countryStrip = countriesNames.ContainsKey(countryCode) ? countriesNames[countryCode] : countryCode; 200 if (countryCode == "US") 201 { 202 203 204 #line default 205 #line hidden 206 207 #line 164 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 208 WriteTo(__razor_helper_writer, SnippetStart("USA")); 209 210 211 #line default 212 #line hidden 213 214 #line 164 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 215 216 217 218 #line default 219 #line hidden 220 WriteLiteralTo(__razor_helper_writer, " <option"); 221 222 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 9318), Tuple.Create("\"", 9338) 223 224 #line 165 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 225 , Tuple.Create(Tuple.Create("", 9326), Tuple.Create<System.Object, System.Int32>(countryCode 226 227 #line default 228 #line hidden 229 , 9326), false) 230 ); 231 232 WriteLiteralTo(__razor_helper_writer, ">"); 233 234 235 #line 165 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 236 WriteTo(__razor_helper_writer, countryStrip); 237 238 239 #line default 240 #line hidden 241 WriteLiteralTo(__razor_helper_writer, "</option>\r\n"); 242 243 244 #line 166 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 245 246 247 #line default 248 #line hidden 249 250 #line 166 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 251 WriteTo(__razor_helper_writer, SnippetEnd("USA")); 252 253 254 #line default 255 #line hidden 256 257 #line 166 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 258 259 } 260 else if (countryCode == "CA") 261 { 262 263 264 #line default 265 #line hidden 266 267 #line 170 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 268 WriteTo(__razor_helper_writer, SnippetStart("CAN")); 269 270 271 #line default 272 #line hidden 273 274 #line 170 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 275 276 277 278 #line default 279 #line hidden 280 WriteLiteralTo(__razor_helper_writer, " <option"); 281 282 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 9492), Tuple.Create("\"", 9512) 283 284 #line 171 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 285 , Tuple.Create(Tuple.Create("", 9500), Tuple.Create<System.Object, System.Int32>(countryCode 286 287 #line default 288 #line hidden 289 , 9500), false) 290 ); 291 292 WriteLiteralTo(__razor_helper_writer, ">"); 293 294 295 #line 171 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 296 WriteTo(__razor_helper_writer, countryStrip); 297 298 299 #line default 300 #line hidden 301 WriteLiteralTo(__razor_helper_writer, "</option>\r\n"); 302 303 304 #line 172 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 305 306 307 #line default 308 #line hidden 309 310 #line 172 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 311 WriteTo(__razor_helper_writer, SnippetEnd("CAN")); 312 313 314 #line default 315 #line hidden 316 317 #line 172 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 318 319 } 320 321 322 #line default 323 #line hidden 324 WriteLiteralTo(__razor_helper_writer, " <option"); 325 326 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 9588), Tuple.Create("\"", 9608) 327 328 #line 174 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 329 , Tuple.Create(Tuple.Create("", 9596), Tuple.Create<System.Object, System.Int32>(countryCode 330 331 #line default 332 #line hidden 333 , 9596), false) 334 ); 335 336 WriteLiteralTo(__razor_helper_writer, ">"); 337 338 339 #line 174 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 340 WriteTo(__razor_helper_writer, countryStrip); 341 342 343 #line default 344 #line hidden 345 WriteLiteralTo(__razor_helper_writer, "</option>\r\n"); 346 347 348 #line 175 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 349 } 350 351 352 #line default 353 #line hidden 354 WriteLiteralTo(__razor_helper_writer, " </select>\r\n"); 355 356 357 #line 177 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 358 359 360 #line default 361 #line hidden 362 }); 363 364 #line 177 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 365 } 366 #line default 367 #line hidden 368 369 370 #line 179 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 371 public RazorEngine.Templating.TemplateWriter RegionSelect(){ 372 #line default 373 #line hidden 374 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 375 376 #line 179 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 377 378 379 380 #line default 381 #line hidden 382 WriteLiteralTo(__razor_helper_writer, " <label"); 383 384 WriteLiteralTo(__razor_helper_writer, " class=\"text-left\""); 385 386 WriteLiteralTo(__razor_helper_writer, ">"); 387 388 389 #line 180 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 390 WriteTo(__razor_helper_writer, Translate("selectYourRegion","Select your region:")); 391 392 393 #line default 394 #line hidden 395 WriteLiteralTo(__razor_helper_writer, "</label>\r\n"); 396 397 WriteLiteralTo(__razor_helper_writer, " <select"); 398 399 WriteLiteralTo(__razor_helper_writer, " data-width=\"100%\""); 400 401 WriteLiteralTo(__razor_helper_writer, " name=\"locality\""); 402 403 WriteLiteralTo(__razor_helper_writer, ">\r\n <option"); 404 405 WriteLiteralTo(__razor_helper_writer, " value=\"\""); 406 407 WriteLiteralTo(__razor_helper_writer, ">"); 408 409 410 #line 182 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 411 WriteTo(__razor_helper_writer, Translate("all","All")); 412 413 414 #line default 415 #line hidden 416 WriteLiteralTo(__razor_helper_writer, "</option>\r\n </select>\r\n"); 417 418 419 #line 184 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 420 421 422 #line default 423 #line hidden 424 }); 425 426 #line 184 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 427 } 428 #line default 429 #line hidden 430 431 432 public RazorEngine_d0b6642f86e04c388c3b935c29e2f6c5() { 433 } 434 435 public override void Execute() { 436 437 #line 4 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 438 439 Dynamicweb.Content.Items.Item itemArea = Pageview.Area.Item; 440 int generalSettingsPageId = Int32.Parse(itemArea["GeneralSettings"].ToString()); 441 var page = Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetPage(generalSettingsPageId); 442 Dynamicweb.Content.Items.Item generalSettings = Dynamicweb.Content.Items.Item.GetItemById(page.ItemType, page.ItemId); 443 444 445 #line default 446 #line hidden 447 WriteLiteral("\r\n"); 448 449 450 #line 10 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 451 string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", ""); 452 453 #line default 454 #line hidden 455 WriteLiteral("\r\n"); 456 457 458 #line 91 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 459 460 string dealerGroups = generalSettings["DealerGroups"].ToString(); 461 string storesGroupID = !string.IsNullOrWhiteSpace(dealerGroups) ? "%" + dealerGroups + "%" : ""; 462 string accessDataSql = "SELECT AccessUserState, AccessUserCountry, AccessUserZip, AccessUserAddress, AccessUserName, AccessUserCity, AccessUserGeoLocationLat, AccessUserImage, AccessUserGeoLocationLng FROM accessUser WHERE AccessUserCountry is not NULL AND AccessUserCountry != '' AND AccessUserGeoLocationLat IS NOT NULL AND AccessUserGroups LIKE '" + storesGroupID + "'"; 463 string accessRegionsDataSql = "SELECT CountryTextName, CountryTextCode2, CountryTextRegionCode FROM EcomCountryText"; 464 string regionsString = "{"; 465 string country = ""; 466 string state = ""; 467 string countryLogged = !string.IsNullOrEmpty(HttpContext.Current.Request.Params["country"]) ? HttpContext.Current.Request.Params["country"] : country; 468 string stateLogged = !string.IsNullOrEmpty(HttpContext.Current.Request.Params["state"]) ? HttpContext.Current.Request.Params["state"] : state; 469 System.Data.DataRow[] dataSet = Dynamicweb.Data.Database.CreateDataSet(accessDataSql).Tables[0].Select(); 470 System.Data.DataRow[] dataRegionsSet = Dynamicweb.Data.Database.CreateDataSet(accessRegionsDataSql).Tables[0].Select(); 471 bool userIsLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 472 System.Collections.Generic.List<String> countriesList = dataSet.Select(r => ((string)r["AccessUserCountry"].ToString()).Trim() ).Distinct().ToList(); 473 Dictionary<string, string> countriesNames = new Dictionary<string, string>(); 474 475 foreach(System.Data.DataRow r in dataRegionsSet.Where(x => string.IsNullOrWhiteSpace(x["CountryTextRegionCode"].ToString()))) 476 { 477 if(!countriesNames.ContainsKey(r["CountryTextCode2"].ToString())) { 478 countriesNames.Add(r["CountryTextCode2"].ToString(), r["CountryTextName"].ToString()); 479 } 480 } 481 482 if(countryLogged != country) 483 { 484 stateLogged = ""; 485 } 486 487 if (userIsLoggedIn) 488 { 489 var user = Pageview.User; 490 countryLogged = user.Country.ToString(); 491 stateLogged = user.State.ToString(); 492 } 493 494 foreach (string i in countriesList) 495 { 496 System.Collections.Generic.List<String> regions = dataSet.Where(r => (string)r["AccessUserCountry"] == i).Select(r => ((string)r["AccessUserState"]).Trim() ).Distinct().ToList(); 497 int countNum = 0; 498 string countryStrip = i; 499 500 if(regionsString != "{") { 501 regionsString += ","; 502 } 503 regionsString += "\""+countryStrip+"\":["; 504 foreach (string region in regions){ 505 var regionTextList = !string.IsNullOrEmpty(region) ? dataRegionsSet.First(r => r["CountryTextRegionCode"].ToString() == region.ToString()) : null; 506 string regionText = regionTextList != null ? regionTextList["CountryTextName"].ToString() : ""; 507 508 if(!string.IsNullOrWhiteSpace(regionText)) 509 { 510 if(countNum != 0) { 511 regionsString += ","; 512 } 513 regionsString += "\""+@regionText+"\""; 514 countNum++; 515 } 516 } 517 regionsString += "]"; 518 519 } 520 regionsString += "}"; 521 522 523 #line default 524 #line hidden 525 WriteLiteral("\r\n"); 526 527 WriteLiteral("\r\n"); 528 529 WriteLiteral("\r\n<div"); 530 531 WriteLiteral(" class=\"col-xs-12 col-sm-3 partnersFilterContainer\""); 532 533 WriteLiteral(" id=\"findStoreFilter\""); 534 535 WriteLiteral(">\r\n <h2>"); 536 537 538 #line 187 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 539 Write(Translate("findYourLocalPartnet", "Find your local partner")); 540 541 542 #line default 543 #line hidden 544 WriteLiteral("</h2>\r\n <fieldset"); 545 546 WriteLiteral(" class=\"col-xs-12 noPadding\""); 547 548 WriteLiteral(">\r\n"); 549 550 WriteLiteral(" "); 551 552 553 #line 189 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 554 Write(CountrySelect(countriesList, countriesNames)); 555 556 557 #line default 558 #line hidden 559 WriteLiteral("\r\n </fieldset>\r\n <fieldset"); 560 561 WriteLiteral(" class=\"col-xs-12 noPadding\""); 562 563 WriteLiteral(">\r\n"); 564 565 WriteLiteral(" "); 566 567 568 #line 192 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 569 Write(RegionSelect()); 570 571 572 #line default 573 #line hidden 574 WriteLiteral("\r\n </fieldset>\r\n</div>\r\n\r\n<div"); 575 576 WriteLiteral(" class=\"list col-sm-9 col-xs-12\""); 577 578 WriteLiteral(">\r\n <div"); 579 580 WriteLiteral(" class=\"no-matches hidden\""); 581 582 WriteLiteral(">"); 583 584 585 #line 197 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 586 Write(Translate("noLocationsFound","No locations found")); 587 588 589 #line default 590 #line hidden 591 WriteLiteral("</div>\r\n <ol"); 592 593 WriteLiteral(" class=\"partnersList\""); 594 595 WriteLiteral(" data-sort-order=\"desc\""); 596 597 WriteLiteral(">\r\n\r\n"); 598 599 600 #line 200 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 601 602 603 #line default 604 #line hidden 605 606 #line 200 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 607 foreach (System.Data.DataRow store in dataSet) 608 { 609 var regionTextList = dataRegionsSet.Where(r => r["CountryTextRegionCode"].ToString() == store["AccessUserState"].ToString() ).First(); 610 string regionText = regionTextList != null ? regionTextList["CountryTextName"].ToString() : ""; 611 string filter = store["AccessUserCountry"].ToString() + " " + regionText; 612 string image = "/Files" + store["AccessUserImage"].ToString(); 613 614 615 616 #line default 617 #line hidden 618 WriteLiteral(" <li"); 619 620 WriteLiteral(" class=\"col-xs-12 col-sm-6 col-md-4\""); 621 622 WriteLiteral(" data-title=\""); 623 624 625 #line 207 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 626 Write(store["AccessUserName"]); 627 628 629 #line default 630 #line hidden 631 WriteLiteral("\""); 632 633 WriteLiteral("\r\n data-filter-values=\""); 634 635 636 #line 208 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 637 Write(filter); 638 639 640 #line default 641 #line hidden 642 WriteLiteral("\""); 643 644 WriteLiteral(" data-country=\""); 645 646 647 #line 208 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 648 Write(store["AccessUserCountry"]); 649 650 651 #line default 652 #line hidden 653 WriteLiteral("\""); 654 655 WriteLiteral(" data-citycode=\""); 656 657 658 #line 208 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 659 Write(store["AccessUserState"]); 660 661 662 #line default 663 #line hidden 664 WriteLiteral("\""); 665 666 WriteLiteral(" data-city=\""); 667 668 669 #line 208 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 670 Write(regionText); 671 672 673 #line default 674 #line hidden 675 WriteLiteral("\""); 676 677 WriteLiteral(" data-sort-value=\""); 678 679 680 #line 208 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 681 Write(store["AccessUserName"]); 682 683 684 #line default 685 #line hidden 686 WriteLiteral("\""); 687 688 WriteLiteral(">\r\n <div>\r\n <figure>\r\n <img"); 689 690 WriteLiteral(" class=\"img-responsive\""); 691 692 WriteAttribute("src", Tuple.Create(" src=\"", 11250), Tuple.Create("\"", 11280) 693 694 #line 211 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 695 , Tuple.Create(Tuple.Create("", 11256), Tuple.Create<System.Object, System.Int32>(GetImage(image, 400, 0) 696 697 #line default 698 #line hidden 699 , 11256), false) 700 ); 701 702 WriteLiteral(" />\r\n </figure>\r\n <h2>"); 703 704 705 #line 213 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 706 Write(store["AccessUserName"]); 707 708 709 #line default 710 #line hidden 711 WriteLiteral("</h2>\r\n\r\n"); 712 713 WriteLiteral(" "); 714 715 716 #line 215 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 717 Write(store["AccessUserAddress"]); 718 719 720 #line default 721 #line hidden 722 WriteLiteral("<br/>\r\n"); 723 724 WriteLiteral(" "); 725 726 727 #line 216 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 728 Write(store["AccessUserCity"]); 729 730 731 #line default 732 #line hidden 733 WriteLiteral("\r\n"); 734 735 736 #line 217 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 737 738 739 #line default 740 #line hidden 741 742 #line 217 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 743 if(!string.IsNullOrEmpty(store["AccessUserState"].ToString())) { 744 745 746 #line default 747 #line hidden 748 WriteLiteral(" "); 749 750 WriteLiteral(", "); 751 752 753 #line 218 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 754 Write(Dynamicweb.Ecommerce.International.CountryText.GetRegionTexts(store["AccessUserCountry"].ToString()).First(c => c.RegionCode == store["AccessUserState"].ToString()).Name); 755 756 757 #line default 758 #line hidden 759 WriteLiteral("\r\n"); 760 761 762 #line 219 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 763 } 764 765 766 #line default 767 #line hidden 768 WriteLiteral(" "); 769 770 771 #line 220 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 772 Write(store["AccessUserZip"]); 773 774 775 #line default 776 #line hidden 777 WriteLiteral("\r\n </div>\r\n </li>\r\n"); 778 779 780 #line 223 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 781 } 782 783 784 #line default 785 #line hidden 786 WriteLiteral(" </ol>\r\n\r\n</div>\r\n\r\n"); 787 788 789 #line 228 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 790 Write(SnippetStart("jsOnLoad")); 791 792 793 #line default 794 #line hidden 795 WriteLiteral("\r\n onLoadPartners(\'"); 796 797 798 #line 229 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 799 Write(regionsString); 800 801 802 #line default 803 #line hidden 804 WriteLiteral("\', {\r\n str_country : \""); 805 806 807 #line 230 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 808 Write(countryLogged); 809 810 811 #line default 812 #line hidden 813 WriteLiteral("\",\r\n str_state : \""); 814 815 816 #line 231 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 817 Write(stateLogged); 818 819 820 #line default 821 #line hidden 822 WriteLiteral("\"\r\n });\r\n"); 823 824 825 #line 233 "C:\Domains\Sites\pacificbag.com\Files\Templates\Designs\PacificBag\TemplateRenderer\Partners.cshtml" 826 Write(SnippetEnd("jsOnLoad")); 827 828 829 #line default 830 #line hidden 831 WriteLiteral("\r\n"); 832 833 } 834 } 835 } 836

1 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 2 @using Dynamicweb.Rendering 3 @using Dynamicweb.Content 4 @{ 5 Dynamicweb.Content.Items.Item itemArea = Pageview.Area.Item; 6 int generalSettingsPageId = Int32.Parse(itemArea["GeneralSettings"].ToString()); 7 var page = Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetPage(generalSettingsPageId); 8 Dynamicweb.Content.Items.Item generalSettings = Dynamicweb.Content.Items.Item.GetItemById(page.ItemType, page.ItemId); 9 } 10 @{ string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", "");}@functions{ 11 public static string GetImage(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "jpg", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "PacificBag") 12 { 13 Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); 14 string currDevice = currentPageview.Device.ToString(); 15 string alternativeImage = !String.IsNullOrEmpty(currentPageview.Area.Item["NoImage"].ToString()) ? currentPageview.Area.Item["NoImage"].ToString() : "/Files/Templates/Designs/"+ designName + "/images/alternativeImage.jpg"; 16 string widthString = ""; 17 string heightString = ""; 18 string getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : ""; 19 string getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : ""; 20 string bgColor = !string.IsNullOrEmpty(background) ? "&amp;Background="+background : ""; 21 int getImageWidth = imageWidth != 0 ? imageWidth : 0; 22 int getImageHeight = imageHeight != 0 ? imageHeight : 0; 23 24 if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 25 { 26 getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; 27 getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; 28 } 29 else if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 30 { 31 getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; 32 getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; 33 } 34 35 if (getImageWidth != 0) 36 { 37 widthString = "&amp;Width=" + getImageWidth; 38 } 39 if (getImageHeight != 0) 40 { 41 heightString = "&amp;Height=" + getImageHeight; 42 } 43 44 string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; 45 return output; 46 } 47 48 public static string GetImageWhiteSpace(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "jpg", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "PacificBag") 49 { 50 Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); 51 string currDevice = currentPageview.Device.ToString(); 52 string alternativeImage = "/Files/Templates/Designs/" + designName + "/images/white80.png"; 53 string widthString = ""; 54 string heightString = ""; 55 string getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : ""; 56 string getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : ""; 57 string bgColor = !string.IsNullOrEmpty(background) ? "&amp;Background="+background : ""; 58 int getImageWidth = imageWidth != 0 ? imageWidth : 0; 59 int getImageHeight = imageHeight != 0 ? imageHeight : 0; 60 61 if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 62 { 63 getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; 64 getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; 65 } 66 else if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 67 { 68 getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; 69 getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; 70 } 71 72 if (getImageWidth != 0) 73 { 74 widthString = "&amp;Width=" + getImageWidth; 75 } 76 if (getImageHeight != 0) 77 { 78 heightString = "&amp;Height=" + getImageHeight; 79 } 80 81 string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; 82 return output; 83 } 84 } 85 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 86 @using Dynamicweb.Rendering; 87 @using System; 88 @using System.Web; 89 @using System.Collections.Specialized; 90 91 @{ 92 string dealerGroups = generalSettings["DealerGroups"].ToString(); 93 string storesGroupID = !string.IsNullOrWhiteSpace(dealerGroups) ? "%" + dealerGroups + "%" : ""; 94 string accessDataSql = "SELECT AccessUserState, AccessUserCountry, AccessUserZip, AccessUserAddress, AccessUserName, AccessUserCity, AccessUserGeoLocationLat, AccessUserImage, AccessUserGeoLocationLng FROM accessUser WHERE AccessUserCountry is not NULL AND AccessUserCountry != '' AND AccessUserGeoLocationLat IS NOT NULL AND AccessUserGroups LIKE '" + storesGroupID + "'"; 95 string accessRegionsDataSql = "SELECT CountryTextName, CountryTextCode2, CountryTextRegionCode FROM EcomCountryText"; 96 string regionsString = "{"; 97 string country = ""; 98 string state = ""; 99 string countryLogged = !string.IsNullOrEmpty(HttpContext.Current.Request.Params["country"]) ? HttpContext.Current.Request.Params["country"] : country; 100 string stateLogged = !string.IsNullOrEmpty(HttpContext.Current.Request.Params["state"]) ? HttpContext.Current.Request.Params["state"] : state; 101 System.Data.DataRow[] dataSet = Dynamicweb.Data.Database.CreateDataSet(accessDataSql).Tables[0].Select(); 102 System.Data.DataRow[] dataRegionsSet = Dynamicweb.Data.Database.CreateDataSet(accessRegionsDataSql).Tables[0].Select(); 103 bool userIsLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 104 System.Collections.Generic.List<String> countriesList = dataSet.Select(r => ((string)r["AccessUserCountry"].ToString()).Trim() ).Distinct().ToList(); 105 Dictionary<string, string> countriesNames = new Dictionary<string, string>(); 106 107 foreach(System.Data.DataRow r in dataRegionsSet.Where(x => string.IsNullOrWhiteSpace(x["CountryTextRegionCode"].ToString()))) 108 { 109 if(!countriesNames.ContainsKey(r["CountryTextCode2"].ToString())) { 110 countriesNames.Add(r["CountryTextCode2"].ToString(), r["CountryTextName"].ToString()); 111 } 112 } 113 114 if(countryLogged != country) 115 { 116 stateLogged = ""; 117 } 118 119 if (userIsLoggedIn) 120 { 121 var user = Pageview.User; 122 countryLogged = user.Country.ToString(); 123 stateLogged = user.State.ToString(); 124 } 125 126 foreach (string i in countriesList) 127 { 128 System.Collections.Generic.List<String> regions = dataSet.Where(r => (string)r["AccessUserCountry"] == i).Select(r => ((string)r["AccessUserState"]).Trim() ).Distinct().ToList(); 129 int countNum = 0; 130 string countryStrip = i; 131 132 if(regionsString != "{") { 133 regionsString += ","; 134 } 135 regionsString += "\""+countryStrip+"\":["; 136 foreach (string region in regions){ 137 var regionTextList = !string.IsNullOrEmpty(region) ? dataRegionsSet.First(r => r["CountryTextRegionCode"].ToString() == region.ToString()) : null; 138 string regionText = regionTextList != null ? regionTextList["CountryTextName"].ToString() : ""; 139 140 if(!string.IsNullOrWhiteSpace(regionText)) 141 { 142 if(countNum != 0) { 143 regionsString += ","; 144 } 145 regionsString += "\""+@regionText+"\""; 146 countNum++; 147 } 148 } 149 regionsString += "]"; 150 151 } 152 regionsString += "}"; 153 } 154 @helper CountrySelect(System.Collections.Generic.List<String> countriesList, Dictionary<string, string> countriesNames){ 155 <label class="text-left">@Translate("selectYourCountry", "Select your country:")</label> 156 <select name="country"> 157 <option selected="selected" value="">@Translate("all", "All")</option> 158 @RenderSnippet("US") 159 @foreach (string countryCode in countriesList.OrderBy(s => s)) 160 { 161 string countryStrip = countriesNames.ContainsKey(countryCode) ? countriesNames[countryCode] : countryCode; 162 if (countryCode == "US") 163 { 164 @SnippetStart("USA") 165 <option value="@countryCode">@countryStrip</option> 166 @SnippetEnd("USA") 167 } 168 else if (countryCode == "CA") 169 { 170 @SnippetStart("CAN") 171 <option value="@countryCode">@countryStrip</option> 172 @SnippetEnd("CAN") 173 } 174 <option value="@countryCode">@countryStrip</option> 175 } 176 </select> 177 } 178 179 @helper RegionSelect(){ 180 <label class="text-left">@Translate("selectYourRegion","Select your region:")</label> 181 <select data-width="100%" name="locality"> 182 <option value="">@Translate("all","All")</option> 183 </select> 184 } 185 186 <div class="col-xs-12 col-sm-3 partnersFilterContainer" id="findStoreFilter"> 187 <h2>@Translate("findYourLocalPartnet", "Find your local partner")</h2> 188 <fieldset class="col-xs-12 noPadding"> 189 @CountrySelect(countriesList, countriesNames) 190 </fieldset> 191 <fieldset class="col-xs-12 noPadding"> 192 @RegionSelect() 193 </fieldset> 194 </div> 195 196 <div class="list col-sm-9 col-xs-12"> 197 <div class="no-matches hidden">@Translate("noLocationsFound","No locations found")</div> 198 <ol class="partnersList" data-sort-order="desc"> 199 200 @foreach (System.Data.DataRow store in dataSet) 201 { 202 var regionTextList = dataRegionsSet.Where(r => r["CountryTextRegionCode"].ToString() == store["AccessUserState"].ToString() ).First(); 203 string regionText = regionTextList != null ? regionTextList["CountryTextName"].ToString() : ""; 204 string filter = store["AccessUserCountry"].ToString() + " " + regionText; 205 string image = "/Files" + store["AccessUserImage"].ToString(); 206 207 <li class="col-xs-12 col-sm-6 col-md-4" data-title="@store["AccessUserName"]" 208 data-filter-values="@filter" data-country="@store["AccessUserCountry"]" data-citycode="@store["AccessUserState"]" data-city="@regionText" data-sort-value="@store["AccessUserName"]"> 209 <div> 210 <figure> 211 <img class="img-responsive" src="@GetImage(image, 400, 0)" /> 212 </figure> 213 <h2>@store["AccessUserName"]</h2> 214 215 @store["AccessUserAddress"]<br/> 216 @store["AccessUserCity"] 217 @if(!string.IsNullOrEmpty(store["AccessUserState"].ToString())) { 218 @:, @Dynamicweb.Ecommerce.International.CountryText.GetRegionTexts(store["AccessUserCountry"].ToString()).First(c => c.RegionCode == store["AccessUserState"].ToString()).Name 219 } 220 @store["AccessUserZip"] 221 </div> 222 </li> 223 } 224 </ol> 225 226 </div> 227 228 @SnippetStart("jsOnLoad") 229 onLoadPartners('@regionsString', { 230 str_country : "@countryLogged", 231 str_state : "@stateLogged" 232 }); 233 @SnippetEnd("jsOnLoad") 234