Partners

Support

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

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

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.