Find a dealer

Support

Find a dealer
Error compiling template "Designs/USKidsGolf/TemplateRenderer/StoreLocator.cshtml"
Line 815: 'CountryText' non contiene una definizione per '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 83 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 22 using Dynamicweb.Ecommerce.International; 23 24 #line default 25 #line hidden 26 27 #line 3 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 28 using Dynamicweb.Content; 29 30 #line default 31 #line hidden 32 33 #line 82 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 34 using Dynamicweb.Rendering; 35 36 #line default 37 #line hidden 38 39 #line 84 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 40 using System.Web; 41 42 #line default 43 #line hidden 44 45 #line 85 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 46 using System.Collections.Specialized; 47 48 #line default 49 #line hidden 50 51 52 public class RazorEngine_bc6b824ccb0e4820885ac2317d60e4ff : RazorTemplateBase<RazorTemplateModel<Template>> { 53 54 #line hidden 55 56 #line 11 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 11 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 12 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 14 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 15 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 16 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 117 118 119 #line default 120 #line hidden 121 122 #line 16 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 21 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 134 WriteTo(__razor_helper_writer, SnippetStart("USA")); 135 136 137 #line default 138 #line hidden 139 140 #line 21 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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=\"", 1146), Tuple.Create("\"", 1166) 149 150 #line 22 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 151 , Tuple.Create(Tuple.Create("", 1154), Tuple.Create<System.Object, System.Int32>(countryCode 152 153 #line default 154 #line hidden 155 , 1154), false) 156 ); 157 158 WriteLiteralTo(__razor_helper_writer, ">"); 159 160 161 #line 22 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 23 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 171 172 173 #line default 174 #line hidden 175 176 #line 23 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 177 WriteTo(__razor_helper_writer, SnippetEnd("USA")); 178 179 180 #line default 181 #line hidden 182 183 #line 23 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 184 185 } 186 else if (countryCode == "CA") 187 { 188 189 190 #line default 191 #line hidden 192 193 #line 27 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 194 WriteTo(__razor_helper_writer, SnippetStart("CAN")); 195 196 197 #line default 198 #line hidden 199 200 #line 27 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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=\"", 1320), Tuple.Create("\"", 1340) 209 210 #line 28 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 211 , Tuple.Create(Tuple.Create("", 1328), Tuple.Create<System.Object, System.Int32>(countryCode 212 213 #line default 214 #line hidden 215 , 1328), false) 216 ); 217 218 WriteLiteralTo(__razor_helper_writer, ">"); 219 220 221 #line 28 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 29 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 231 232 233 #line default 234 #line hidden 235 236 #line 29 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 237 WriteTo(__razor_helper_writer, SnippetEnd("CAN")); 238 239 240 #line default 241 #line hidden 242 243 #line 29 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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=\"", 1416), Tuple.Create("\"", 1436) 253 254 #line 31 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 255 , Tuple.Create(Tuple.Create("", 1424), Tuple.Create<System.Object, System.Int32>(countryCode 256 257 #line default 258 #line hidden 259 , 1424), false) 260 ); 261 262 WriteLiteralTo(__razor_helper_writer, ">"); 263 264 265 #line 31 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 32 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 275 } 276 277 #line default 278 #line hidden 279 WriteLiteralTo(__razor_helper_writer, "\r\n </select>\r\n"); 280 281 282 #line 34 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 283 284 285 #line default 286 #line hidden 287 }); 288 289 #line 34 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 290 } 291 #line default 292 #line hidden 293 294 295 #line 36 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 36 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 37 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 39 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 41 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 345 346 347 #line default 348 #line hidden 349 }); 350 351 #line 41 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 352 } 353 #line default 354 #line hidden 355 356 357 #line 43 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.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 = "USKidsGolf") 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 #line default 397 #line hidden 398 399 400 public RazorEngine_bc6b824ccb0e4820885ac2317d60e4ff() { 401 } 402 403 public override void Execute() { 404 405 #line 5 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 406 407 Dynamicweb.Content.Items.Item itemArea = Pageview.Area.Item; 408 int generalSettingsPageId = GetPageIdByNavigationTag("generalsettings");// Int32.Parse(itemArea["GeneralSettings"].ToString()); 409 var page = Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetPage(generalSettingsPageId); 410 Dynamicweb.Content.Items.Item generalSettings = page.Item; 411 412 413 414 #line default 415 #line hidden 416 417 #line 34 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 418 419 420 421 422 #line default 423 #line hidden 424 425 #line 41 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 426 427 428 429 #line default 430 #line hidden 431 WriteLiteral("\r\n"); 432 433 434 #line 43 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 435 string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", ""); 436 437 #line default 438 #line hidden 439 WriteLiteral("\r\n"); 440 441 442 #line 87 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 443 444 string dealerGroups = generalSettings["DealerGroups"].ToString(); 445 string storesGroupID = !string.IsNullOrWhiteSpace(dealerGroups) ? "%" + dealerGroups + "%" : ""; 446 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 + "'"; 447 string accessRegionsDataSql = "SELECT CountryTextName, CountryTextCode2, CountryTextRegionCode FROM EcomCountryText"; 448 string regionsString = "{"; 449 string country = ""; 450 string state = ""; 451 string countryLogged = !string.IsNullOrEmpty(HttpContext.Current.Request.Params["country"]) ? HttpContext.Current.Request.Params["country"] : country; 452 string stateLogged = !string.IsNullOrEmpty(HttpContext.Current.Request.Params["state"]) ? HttpContext.Current.Request.Params["state"] : state; 453 System.Data.DataRow[] dataSet = Dynamicweb.Data.Database.CreateDataSet(accessDataSql).Tables[0].Select(); 454 System.Data.DataRow[] dataRegionsSet = Dynamicweb.Data.Database.CreateDataSet(accessRegionsDataSql).Tables[0].Select(); 455 bool userIsLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 456 System.Collections.Generic.List<String> countriesList = dataSet.Select(r => ((string)r["AccessUserCountry"].ToString()).Trim() ).Distinct().ToList(); 457 Dictionary<string, string> countriesNames = new Dictionary<string, string>(); 458 459 foreach(System.Data.DataRow r in dataRegionsSet.Where(x => string.IsNullOrWhiteSpace(x["CountryTextRegionCode"].ToString()))) 460 { 461 if(!countriesNames.ContainsKey(r["CountryTextCode2"].ToString())) { 462 countriesNames.Add(r["CountryTextCode2"].ToString(), r["CountryTextName"].ToString()); 463 } 464 } 465 466 if(countryLogged != country) 467 { 468 stateLogged = ""; 469 } 470 471 if (userIsLoggedIn) 472 { 473 var user = Pageview.User; 474 countryLogged = user.Country.ToString(); 475 stateLogged = user.State.ToString(); 476 } 477 478 foreach (string i in countriesList) 479 { 480 System.Collections.Generic.List<String> regions = dataSet.Where(r => (string)r["AccessUserCountry"] == i).Select(r => ((string)r["AccessUserState"]).Trim() ).Distinct().ToList(); 481 int countNum = 0; 482 string countryStrip = i; 483 484 if(regionsString != "{") { 485 regionsString += ","; 486 } 487 regionsString += "\""+countryStrip+"\":["; 488 foreach (string region in regions){ 489 var regionTextList = !string.IsNullOrEmpty(region) ? dataRegionsSet.First(r => r["CountryTextRegionCode"].ToString() == region.ToString()) : null; 490 string regionText = regionTextList != null ? regionTextList["CountryTextName"].ToString() : ""; 491 492 if(!string.IsNullOrWhiteSpace(regionText)) 493 { 494 if(countNum != 0) { 495 regionsString += ","; 496 } 497 regionsString += "\""+@regionText+"\""; 498 countNum++; 499 } 500 } 501 regionsString += "]"; 502 503 } 504 regionsString += "}"; 505 506 507 #line default 508 #line hidden 509 WriteLiteral("\r\n<div"); 510 511 WriteLiteral(" class=\"dynamicweb-map\""); 512 513 WriteLiteral(" id=\"Maps-85\""); 514 515 WriteLiteral(" data-list-position=\"hidden\""); 516 517 WriteLiteral(">\r\n <div"); 518 519 WriteLiteral(" class=\"col-xs-12\""); 520 521 WriteLiteral(" id=\"findStoreFilter\""); 522 523 WriteLiteral(">\r\n <fieldset"); 524 525 WriteLiteral(" class=\"col-sm-3 col-xs-12 noPaddingLeft\""); 526 527 WriteLiteral(">\r\n"); 528 529 WriteLiteral(" "); 530 531 532 #line 153 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 533 Write(CountrySelect(countriesList, countriesNames)); 534 535 536 #line default 537 #line hidden 538 WriteLiteral("\r\n </fieldset>\r\n <fieldset"); 539 540 WriteLiteral(" class=\"col-sm-3 col-xs-12 regions\""); 541 542 WriteLiteral(">\r\n"); 543 544 WriteLiteral(" "); 545 546 547 #line 156 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 548 Write(RegionSelect()); 549 550 551 #line default 552 #line hidden 553 WriteLiteral("\r\n </fieldset>\r\n</div>\r\n\r\n"); 554 555 556 #line 160 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 557 Write(SnippetStart("jsVariables")); 558 559 560 #line default 561 #line hidden 562 WriteLiteral("\r\n var obj_loginLocation = {\r\n str_country : \""); 563 564 565 #line 162 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 566 Write(countryLogged); 567 568 569 #line default 570 #line hidden 571 WriteLiteral("\",\r\n str_state : \""); 572 573 574 #line 163 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 575 Write(stateLogged); 576 577 578 #line default 579 #line hidden 580 WriteLiteral("\"\r\n }\r\n"); 581 582 583 #line 165 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 584 Write(SnippetEnd("jsVariables")); 585 586 587 #line default 588 #line hidden 589 WriteLiteral("\r\n"); 590 591 592 #line 166 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 593 Write(SnippetStart("jsOnLoad")); 594 595 596 #line default 597 #line hidden 598 WriteLiteral("\r\n onLoadStoreLocator(\'"); 599 600 601 #line 167 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 602 Write(regionsString); 603 604 605 #line default 606 #line hidden 607 WriteLiteral("\');\r\n"); 608 609 610 #line 168 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 611 Write(SnippetEnd("jsOnLoad")); 612 613 614 #line default 615 #line hidden 616 WriteLiteral("\r\n <div"); 617 618 WriteLiteral(" class=\"locations-filter hide\""); 619 620 WriteLiteral(">\r\n <button"); 621 622 WriteLiteral(" data-filter-value=\"test\""); 623 624 WriteLiteral("></button>\r\n </div>\r\n <div"); 625 626 WriteLiteral(" id=\"loading\""); 627 628 WriteLiteral(" class=\"col-xs-12\""); 629 630 WriteLiteral(">&nbsp;</div>\r\n<div"); 631 632 WriteLiteral(" class=\"map col-sm-8 col-xs-12 noPaddingLeft\""); 633 634 WriteLiteral(">\r\n <div"); 635 636 WriteLiteral(" id=\"Maps-85-map\""); 637 638 WriteLiteral("></div>\r\n</div>\r\n<div"); 639 640 WriteLiteral(" class=\"list col-sm-4 col-xs-12\""); 641 642 WriteLiteral(">\r\n <div"); 643 644 WriteLiteral(" class=\"no-matches\""); 645 646 WriteLiteral(">"); 647 648 649 #line 177 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 650 Write(Translate("NoLocationsFound","No locations found")); 651 652 653 #line default 654 #line hidden 655 WriteLiteral("</div>\r\n <ol"); 656 657 WriteLiteral(" class=\"storeList\""); 658 659 WriteLiteral(" id=\"Maps-85-list\""); 660 661 WriteLiteral(" data-sort-order=\"desc\""); 662 663 WriteLiteral(">\r\n"); 664 665 666 #line 179 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 667 668 669 #line default 670 #line hidden 671 672 #line 179 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 673 foreach (System.Data.DataRow store in dataSet) 674 { 675 var regionTextList = dataRegionsSet.First(r => r["CountryTextRegionCode"].ToString() == store["AccessUserState"].ToString()); 676 string regionTextString = regionTextList != null ? regionTextList["CountryTextName"].ToString() : ""; 677 678 679 680 #line default 681 #line hidden 682 WriteLiteral(" <li"); 683 684 WriteLiteral(" data-lat=\""); 685 686 687 #line 184 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 688 Write(store["AccessUserGeoLocationLat"]); 689 690 691 #line default 692 #line hidden 693 WriteLiteral("\""); 694 695 WriteLiteral(" data-lng=\""); 696 697 698 #line 184 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 699 Write(store["AccessUserGeoLocationLng"]); 700 701 702 #line default 703 #line hidden 704 WriteLiteral("\""); 705 706 WriteLiteral(" data-title=\""); 707 708 709 #line 184 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 710 Write(store["AccessUserName"]); 711 712 713 #line default 714 #line hidden 715 WriteLiteral("\""); 716 717 WriteLiteral("\r\n data-filter-values=\"\""); 718 719 WriteLiteral(" data-country=\""); 720 721 722 #line 185 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 723 Write(store["AccessUserCountry"]); 724 725 726 #line default 727 #line hidden 728 WriteLiteral("\""); 729 730 WriteLiteral(" data-citycode=\""); 731 732 733 #line 185 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 734 Write(store["AccessUserState"]); 735 736 737 #line default 738 #line hidden 739 WriteLiteral("\""); 740 741 WriteLiteral(" data-city=\""); 742 743 744 #line 185 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 745 Write(regionTextString); 746 747 748 #line default 749 #line hidden 750 WriteLiteral("\""); 751 752 WriteLiteral(" data-sort-value=\""); 753 754 755 #line 185 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 756 Write(store["AccessUserName"]); 757 758 759 #line default 760 #line hidden 761 WriteLiteral("\""); 762 763 WriteLiteral(">\r\n <div>\r\n\r\n <b>"); 764 765 766 #line 188 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 767 Write(store["AccessUserName"]); 768 769 770 #line default 771 #line hidden 772 WriteLiteral("</b><br/>\r\n\r\n"); 773 774 WriteLiteral(" "); 775 776 777 #line 190 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 778 Write(store["AccessUserAddress"]); 779 780 781 #line default 782 #line hidden 783 WriteLiteral("<br/>\r\n"); 784 785 WriteLiteral(" "); 786 787 788 #line 191 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 789 Write(store["AccessUserCity"]); 790 791 792 #line default 793 #line hidden 794 WriteLiteral("\r\n"); 795 796 797 #line 192 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 798 799 800 #line default 801 #line hidden 802 803 #line 192 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 804 if(!string.IsNullOrEmpty(store["AccessUserState"].ToString())) { 805 806 807 #line default 808 #line hidden 809 WriteLiteral(" "); 810 811 WriteLiteral(", "); 812 813 814 #line 193 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 815 Write(Dynamicweb.Ecommerce.International.CountryText.GetRegionTexts(store["AccessUserCountry"].ToString()).First(c => c.RegionCode == store["AccessUserState"].ToString()).Name); 816 817 818 #line default 819 #line hidden 820 WriteLiteral("\r\n"); 821 822 823 #line 194 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 824 } 825 826 827 #line default 828 #line hidden 829 WriteLiteral(" "); 830 831 832 #line 195 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 833 Write(store["AccessUserZip"]); 834 835 836 #line default 837 #line hidden 838 WriteLiteral("\r\n </div>\r\n </li>\r\n"); 839 840 841 #line 198 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 842 } 843 844 845 #line default 846 #line hidden 847 WriteLiteral(" </ol>\r\n\r\n</div>\r\n"); 848 849 850 #line 202 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 851 Write(SnippetStart("externalScripts")); 852 853 854 #line default 855 #line hidden 856 WriteLiteral("\r\n<script"); 857 858 WriteLiteral(" type=\"text/javascript\""); 859 860 WriteLiteral(" src=\"//maps.googleapis.com/maps/api/js?v=3&amp;sensor=false\""); 861 862 WriteLiteral("></script>\r\n<script"); 863 864 WriteLiteral(" type=\"text/javascript\""); 865 866 WriteLiteral(" src=\"/Files/Templates/Designs/RizzoDesignFolder/Maps/javascripts/Maps.js\""); 867 868 WriteLiteral("></script>\r\n"); 869 870 871 #line 205 "c:\Domains\Sites\uskidsgolfpro.com\Files\Templates\Designs\USKidsGolf\TemplateRenderer\StoreLocator.cshtml" 872 Write(SnippetEnd("externalScripts")); 873 874 875 #line default 876 #line hidden 877 WriteLiteral("\r\n\r\n\r\n</div>"); 878 879 } 880 } 881 } 882

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

Our Mission

The mission of U.S. Kids Golf is to help kids have fun learning the lifelong game of golf and encourage family interaction that builds lasting memories.