Find a dealer 2

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

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