Line 1: using System;Line 2: using System.Collections.Generic;Line 3: using System.Linq;Line 4: using System.Web;Line 5: using System.Web.Services;Line 6: Line 7: using System.Web.Script.Serialization;Line 8: using System.Web.Script.Services;Line 9: Line 10: /// <summary>Line 11: /// Summary description for LocationSearchLine 12: /// </summary>Line 13: [WebService(Namespace = "https://contentfeed.remedyconnect.com/")]Line 14: [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]Line 15: // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. Line 16: // [System.Web.Script.Services.ScriptService]Line 17: public class LocationSearch : System.Web.Services.WebServiceLine 18: {Line 19: Line 20: public LocationSearch()Line 21: {Line 22: Line 23: //Uncomment the following line if using designed components Line 24: //InitializeComponent(); Line 25: }Line 26: Line 27: #region SearchesLine 28: [WebMethod]Line 29: [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]Line 30: public void AdvocareLocationSearch(string searchword, int topnum, int idSpecialty)Line 31: {Line 32: Line 33: var locations = new List<RemedyLocation>();Line 34: string result = string.Empty;Line 35: tryLine 36: {Line 37: #region GetDataLine 38: LocationSearchDataContext dbFind = new LocationSearchDataContext();Line 39: List<remedy_SearchLocationResult> selections = dbFind.remedy_SearchLocation(topnum, null, searchword, null, null, 0, idSpecialty).ToList();Line 40: //DataSet ds = new DataSet();Line 41: for (int i = 0; i < selections.Count; i++)Line 42: {Line 43: var loc = new RemedyLocation();Line 44: loc.ItemId = selections[i].ItemID;Line 45: loc.PracticeName = selections[i].PracticeName;Line 46: loc.WebsiteUrl = selections[i].WebsiteURL;Line 47: loc.GooglePlaceId = selections[i].GooglePlaceId;Line 48: loc.PracPhotoURL = selections[i].PracPhotoURL;Line 49: loc.PracticeGroup = selections[i].PracticeGroup;Line 50: loc.PracticePhone = selections[i].PracticePhone;Line 51: loc.SpecialtyName = selections[i].SpecialtyName;Line 52: loc.SpecialtyIcon = selections[i].SpecialtyIcon;Line 53: loc.Address1 = selections[i].Address1;Line 54: loc.Address2 = selections[i].Address2;Line 55: loc.City = selections[i].City;Line 56: if (selections[i].Latitude != null)Line 57: {Line 58: loc.Latitude = selections[i].Latitude.ToString();Line 59: }Line 60: if (selections[i].Longitude != null)Line 61: {Line 62: loc.Longitude = selections[i].Longitude.ToString();Line 63: }Line 64: loc.LocationGooglePlaceId = selections[i].GooglePlaceId;Line 65: loc.LocationName = selections[i].LocationName;Line 66: loc.LocationURL = selections[i].LocationURL;Line 67: loc.LocPhotoURL = selections[i].LocPhotoURL;Line 68: loc.MetaDescription = selections[i].MetaDescription;Line 69: loc.MetaTitle = selections[i].MetaTitle;Line 70: loc.OfficeFax = selections[i].OfficeFax;Line 71: loc.OfficePhone = selections[i].OfficePhone;Line 72: loc.RatingsType = selections[i].RatingsType;Line 73: loc.SpecialtyId = int.Parse(selections[i].SpecialtyId.ToString());Line 74: loc.SpecialtyName = selections[i].SpecialtyName;Line 75: loc.State = selections[i].State;Line 76: loc.Zip = selections[i].Zip;Line 77: Line 78: List<RemedyStaff> staffList = new List<RemedyStaff>();Line 79: //Add Staff LocationsLine 80: List<remedy_GetStaffPerLocationResult> staff = dbFind.remedy_GetStaffPerLocation(loc.ItemId).ToList();Line 81: for (int s = 0; s < staff.Count; s++)Line 82: {Line 83: RemedyStaff thisStaff = new RemedyStaff();Line 84: thisStaff.ItemId = staff[s].ItemID;Line 85: thisStaff.FullName = staff[s].FullName;Line 86: thisStaff.FirstName = staff[s].FirstName;Line 87: thisStaff.MiddleName = staff[s].MiddleName;Line 88: thisStaff.LastName = staff[s].LastName;Line 89: thisStaff.Title = staff[s].Title;Line 90: thisStaff.ProfileURL = staff[s].ProfileUrl;Line 91: thisStaff.StaffPhotoURL = staff[s].StaffPhotoUrl;Line 92: thisStaff.SpecialtyName = staff[s].SpecialtyName;Line 93: staffList.Add(thisStaff);Line 94: }Line 95: loc.LocationStaff = staffList;Line 96: //Add Staff SpecialtiesLine 97: Line 98: Line 99: locations.Add(loc);Line 100: }Line 101: dbFind.Dispose();Line 102: #endregionLine 103: Line 104: result = new JavaScriptSerializer().Serialize(locations);Line 105: Line 106: // PrepareLine 107: string callback = HttpContext.Current.Request.Params["callback"];Line 108: string json = "{\"locations\": " + result + ", \"locationcount\": " + selections.Count + "}";Line 109: string response = string.IsNullOrEmpty(callback) ? json : string.Format("{0}({1});", callback, json);Line 110: Line 111: // ResponseLine 112: HttpContext.Current.Response.ContentType = "application/json";Line 113: HttpContext.Current.Response.Write(response);Line 114: }Line 115: catch (Exception ex)Line 116: {Line 117: throw ex;Line 118: }Line 119: }Line 120: [WebMethod]Line 121: [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]Line 122: public void AdvocareLocationSearchWithLocation(string searchword, int topnum, int miles, decimal lat, decimal lon, int idZip, int idSpecialty)Line 123: {Line 124: Line 125: var locations = new List<RemedyLocation>();Line 126: string result = string.Empty;Line 127: tryLine 128: {Line 129: #region GetDataLine 130: LocationSearchDataContext dbFind = new LocationSearchDataContext();Line 131: List<remedy_SearchLocationResult> selections = dbFind.remedy_SearchLocation(topnum, miles, searchword, lon, lat, idZip, idSpecialty).ToList();Line 132: //DataSet ds = new DataSet();Line 133: for (int i = 0; i < selections.Count; i++)Line 134: {Line 135: var loc = new RemedyLocation();Line 136: loc.ItemId = selections[i].ItemID;Line 137: loc.PracticeName = selections[i].PracticeName;Line 138: loc.WebsiteUrl = selections[i].WebsiteURL;Line 139: loc.GooglePlaceId = selections[i].GooglePlaceId;Line 140: loc.PracPhotoURL = selections[i].PracPhotoURL;Line 141: loc.PracticeGroup = selections[i].PracticeGroup;Line 142: loc.PracticePhone = selections[i].PracticePhone;Line 143: loc.SpecialtyName = selections[i].SpecialtyName;Line 144: loc.SpecialtyIcon = selections[i].SpecialtyIcon;Line 145: loc.Address1 = selections[i].Address1;Line 146: loc.Address2 = selections[i].Address2;Line 147: loc.City = selections[i].City;Line 148: if (selections[i].Latitude != null)Line 149: {Line 150: loc.Latitude = selections[i].Latitude.ToString();Line 151: }Line 152: if (selections[i].Longitude != null)Line 153: {Line 154: loc.Longitude = selections[i].Longitude.ToString();Line 155: }Line 156: loc.LocationGooglePlaceId = selections[i].GooglePlaceId;Line 157: loc.LocationName = selections[i].LocationName;Line 158: loc.LocationURL = selections[i].LocationURL;Line 159: loc.LocPhotoURL = selections[i].LocPhotoURL;Line 160: loc.MetaDescription = selections[i].MetaDescription;Line 161: loc.MetaTitle = selections[i].MetaTitle;Line 162: loc.OfficeFax = selections[i].OfficeFax;Line 163: loc.OfficePhone = selections[i].OfficePhone;Line 164: loc.RatingsType = selections[i].RatingsType;Line 165: loc.SpecialtyId = int.Parse(selections[i].SpecialtyId.ToString());Line 166: loc.SpecialtyName = selections[i].SpecialtyName;Line 167: loc.State = selections[i].State;Line 168: loc.Zip = selections[i].Zip;Line 169: Line 170: loc.MilesAway = selections[i].MilesAway;Line 171: List<RemedyStaff> staffList = new List<RemedyStaff>();Line 172: //Add Staff LocationsLine 173: List<remedy_GetStaffPerLocationResult> staff = dbFind.remedy_GetStaffPerLocation(loc.ItemId).ToList();Line 174: for (int s = 0; s < staff.Count; s++)Line 175: {Line 176: RemedyStaff thisStaff = new RemedyStaff();Line 177: thisStaff.ItemId = staff[s].ItemID;Line 178: thisStaff.FullName = staff[s].FullName;Line 179: thisStaff.FirstName = staff[s].FirstName;Line 180: thisStaff.MiddleName = staff[s].MiddleName;Line 181: thisStaff.LastName = staff[s].LastName;Line 182: thisStaff.Title = staff[s].Title;Line 183: thisStaff.ProfileURL = staff[s].ProfileUrl;Line 184: thisStaff.StaffPhotoURL = staff[s].StaffPhotoUrl;Line 185: thisStaff.SpecialtyName = staff[s].SpecialtyName;Line 186: staffList.Add(thisStaff);Line 187: }Line 188: loc.LocationStaff = staffList;Line 189: //Add Staff SpecialtiesLine 190: Line 191: Line 192: locations.Add(loc);Line 193: }Line 194: dbFind.Dispose();Line 195: #endregionLine 196: Line 197: result = new JavaScriptSerializer().Serialize(locations);Line 198: Line 199: // PrepareLine 200: string callback = HttpContext.Current.Request.Params["callback"];Line 201: string json = "{\"locations\": " + result + ", \"locationcount\": " + selections.Count + "}";Line 202: string response = string.IsNullOrEmpty(callback) ? json : string.Format("{0}({1});", callback, json);Line 203: Line 204: // ResponseLine 205: HttpContext.Current.Response.ContentType = "application/json";Line 206: HttpContext.Current.Response.Write(response);Line 207: }Line 208: catch (Exception ex)Line 209: {Line 210: throw ex;Line 211: }Line 212: }Line 213: Line 214: [WebMethod]Line 215: [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]Line 216: public void AdvocareProviderSearch(string searchword, int topnum, int idSpecialty)Line 217: {Line 218: Line 219: var providers = new List<RemedyStaff>();Line 220: string result = string.Empty;Line 221: tryLine 222: {Line 223: #region GetDataLine 224: LocationSearchDataContext dbFind = new LocationSearchDataContext();Line 225: List<remedy_SearchStaffResult> selections = dbFind.remedy_SearchStaff(topnum, null, searchword, null, null, 0, idSpecialty).ToList();Line 226: //DataSet ds = new DataSet();Line 227: for (int i = 0; i < selections.Count; i++)Line 228: {Line 229: var staff = new RemedyStaff();Line 230: staff.ItemId = selections[i].ItemID;Line 231: staff.BookingURL = selections[i].BookingURL;Line 232: staff.BookingURL2 = selections[i].BookingURL2;Line 233: staff.FirstName = selections[i].FirstName;Line 234: staff.FullName = selections[i].FullName;Line 235: staff.Gender = selections[i].Gender;Line 236: staff.GooglePlaceId = selections[i].GooglePlaceId;Line 237: staff.Language = selections[i].Language;Line 238: staff.LastName = selections[i].LastName;Line 239: staff.MetaDescription = selections[i].MetaDescription;Line 240: staff.MetaTitle = selections[i].MetaTitle;Line 241: staff.MiddleName = selections[i].MiddleName;Line 242: staff.ProfilePhotoURL = selections[i].ProfilePhotoUrl;Line 243: staff.ProfileURL = selections[i].ProfileUrl;Line 244: staff.SpecialtyName = selections[i].SpecialtyName;Line 245: staff.StaffCategory = selections[i].StaffCategory;Line 246: staff.StaffPhotoURL = selections[i].StaffPhotoUrl;Line 247: staff.Title = selections[i].Title;Line 248: Line 249: List<RemedyLocation> locList = new List<RemedyLocation>();Line 250: //Add Staff LocationsLine 251: List<remedy_GetLocationsPerStaffResult> locs = dbFind.remedy_GetLocationsPerStaff(staff.ItemId).ToList();Line 252: for (int s = 0; s < locs.Count; s++)Line 253: {Line 254: RemedyLocation thisloc = new RemedyLocation();Line 255: thisloc.ItemId = locs[s].ItemID;Line 256: thisloc.Address1 = locs[s].Address1;Line 257: thisloc.Address2 = locs[s].Address2;Line 258: thisloc.City = locs[s].City;Line 259: thisloc.State = locs[s].State;Line 260: thisloc.Zip = locs[s].Zip;Line 261: thisloc.PracticeName = locs[s].PracticeName;Line 262: thisloc.LocationName = locs[s].LocationName;Line 263: thisloc.LocationGooglePlaceId = locs[s].GooglePlaceId;Line 264: thisloc.SpecialtyName = locs[s].SpecialtyName;Line 265: thisloc.RatingsType = locs[s].RatingsType;Line 266: thisloc.OfficePhone = locs[s].OfficePhone;Line 267: thisloc.OfficeFax = locs[s].OfficeFax;Line 268: thisloc.LocPhotoURL = locs[s].LocPhotoURL;Line 269: thisloc.Latitude = locs[s].Latitude.ToString();Line 270: thisloc.Longitude = locs[s].Longitude.ToString();Line 271: locList.Add(thisloc);Line 272: }Line 273: staff.StaffLocations = locList;Line 274: Line 275: //Add Staff SpecialtiesLine 276: Line 277: Line 278: providers.Add(staff);Line 279: }Line 280: dbFind.Dispose();Line 281: #endregionLine 282: Line 283: result = new JavaScriptSerializer().Serialize(providers);Line 284: Line 285: // PrepareLine 286: string callback = HttpContext.Current.Request.Params["callback"];Line 287: string json = "{\"providers\": " + result + ", \"providercount\": " + selections.Count + "}";Line 288: string response = string.IsNullOrEmpty(callback) ? json : string.Format("{0}({1});", callback, json);Line 289: Line 290: // ResponseLine 291: HttpContext.Current.Response.ContentType = "application/json";Line 292: HttpContext.Current.Response.Write(response);Line 293: }Line 294: catch (Exception ex)Line 295: {Line 296: throw ex;Line 297: }Line 298: }Line 299: [WebMethod]Line 300: [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]Line 301: public void AdvocareProviderSearchWithLocation(string searchword, int topnum, int miles, decimal lat, decimal lon, int idZip, int idSpecialty)Line 302: {Line 303: Line 304: var providers = new List<RemedyStaff>();Line 305: string result = string.Empty;Line 306: tryLine 307: {Line 308: #region GetDataLine 309: LocationSearchDataContext dbFind = new LocationSearchDataContext();Line 310: List<remedy_SearchStaffResult> selections = dbFind.remedy_SearchStaff(topnum, miles, searchword, lon, lat, idZip, idSpecialty).ToList();Line 311: //DataSet ds = new DataSet();Line 312: for (int i = 0; i < selections.Count; i++)Line 313: {Line 314: var staff = new RemedyStaff();Line 315: staff.ItemId = selections[i].ItemID;Line 316: staff.BookingURL = selections[i].BookingURL;Line 317: staff.BookingURL2 = selections[i].BookingURL2;Line 318: staff.FirstName = selections[i].FirstName;Line 319: staff.FullName = selections[i].FullName;Line 320: staff.Gender = selections[i].Gender;Line 321: staff.GooglePlaceId = selections[i].GooglePlaceId;Line 322: staff.Language = selections[i].Language;Line 323: staff.LastName = selections[i].LastName;Line 324: staff.MetaDescription = selections[i].MetaDescription;Line 325: staff.MetaTitle = selections[i].MetaTitle;Line 326: staff.MiddleName = selections[i].MiddleName;Line 327: staff.ProfilePhotoURL = selections[i].ProfilePhotoUrl;Line 328: staff.ProfileURL = selections[i].ProfileUrl;Line 329: Line 330: staff.SpecialtyName = selections[i].SpecialtyName;Line 331: staff.StaffCategory = selections[i].StaffCategory;Line 332: staff.StaffPhotoURL = selections[i].StaffPhotoUrl;Line 333: staff.Title = selections[i].Title;Line 334: Line 335: List<RemedyLocation> locList = new List<RemedyLocation>();Line 336: //Add Staff LocationsLine 337: List<remedy_GetLocationsPerStaffResult> locs = dbFind.remedy_GetLocationsPerStaff(staff.ItemId).ToList();Line 338: for (int s = 0; s < locs.Count; s++)Line 339: {Line 340: RemedyLocation thisloc = new RemedyLocation();Line 341: thisloc.ItemId = locs[s].ItemID;Line 342: thisloc.Address1 = locs[s].Address1;Line 343: thisloc.Address2 = locs[s].Address2;Line 344: thisloc.City = locs[s].City;Line 345: thisloc.State = locs[s].State;Line 346: thisloc.Zip = locs[s].Zip;Line 347: thisloc.PracticeName = locs[s].PracticeName;Line 348: thisloc.LocationName = locs[s].LocationName;Line 349: thisloc.LocationGooglePlaceId = locs[s].GooglePlaceId;Line 350: thisloc.SpecialtyName = locs[s].SpecialtyName;Line 351: thisloc.RatingsType = locs[s].RatingsType;Line 352: thisloc.OfficePhone = locs[s].OfficePhone;Line 353: thisloc.OfficeFax = locs[s].OfficeFax;Line 354: thisloc.LocPhotoURL = locs[s].LocPhotoURL;Line 355: thisloc.Latitude = locs[s].Latitude.ToString();Line 356: thisloc.Longitude = locs[s].Longitude.ToString();Line 357: locList.Add(thisloc);Line 358: }Line 359: staff.StaffLocations = locList;Line 360: Line 361: //Add Staff SpecialtiesLine 362: Line 363: Line 364: providers.Add(staff);Line 365: }Line 366: dbFind.Dispose();Line 367: #endregionLine 368: Line 369: result = new JavaScriptSerializer().Serialize(providers);Line 370: Line 371: // PrepareLine 372: string callback = HttpContext.Current.Request.Params["callback"];Line 373: string json = "{\"providers\": " + result + ", \"providercount\": " + selections.Count + "}";Line 374: string response = string.IsNullOrEmpty(callback) ? json : string.Format("{0}({1});", callback, json);Line 375: Line 376: // ResponseLine 377: HttpContext.Current.Response.ContentType = "application/json";Line 378: HttpContext.Current.Response.Write(response);Line 379: }Line 380: catch (Exception ex)Line 381: {Line 382: throw ex;Line 383: }Line 384: }Line 385: Line 386: #endregionLine 387: #region Return AllLine 388: [WebMethod]Line 389: [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]Line 390: Line 391: public void AdvocarePractices()Line 392: {Line 393: var practices = new List<RemedyPractice>();Line 394: string result = string.Empty;Line 395: tryLine 396: {Line 397: #region GetDataLine 398: LocationSearchDataContext dbFind = new LocationSearchDataContext();Line 399: List<remedy_GetAllPracticesResult> selections = dbFind.remedy_GetAllPractices().ToList();Line 400: //DataSet ds = new DataSet();Line 401: for (int i = 0; i < selections.Count; i++)Line 402: {Line 403: var practice = new RemedyPractice();Line 404: practice.ItemId = selections[i].ItemID;Line 405: practice.PracticeName = selections[i].PracticeName;Line 406: practice.DudaSiteId = selections[i].DudaSiteName;Line 407: practice.GooglePlaceId = selections[i].GooglePlaceId;Line 408: practice.PracPhotoURL = selections[i].PracPhotoURL;Line 409: practice.PracticeGroup = selections[i].PracticeGroup;Line 410: practice.PracticePhone = selections[i].PracticePhone;Line 411: practice.SpecialtyName = selections[i].SpecialtyName;Line 412: if (selections[i].WebsiteURL != null)Line 413: {Line 414: string url = selections[i].WebsiteURL.ToString();Line 415: if (url.Length > 0)Line 416: {Line 417: url = url.Replace("https://", "");Line 418: url = url.Replace("http://", "");Line 419: url = url.Replace("https:", "");Line 420: url = url.Replace("http:", "");Line 421: url = url.Replace("/", "");Line 422: }Line 423: practice.WebsiteUrl = url;Line 424: }Line 425: Line 426: if (selections[i].WebsiteLive != null)Line 427: {Line 428: practice.WebsiteLive = bool.Parse(selections[i].WebsiteLive.ToString());Line 429: }Line 430: Line 431: Line 432: //Add Staff LocationsLine 433: //Add Staff SpecialtiesLine 434: Line 435: Line 436: practices.Add(practice);Line 437: }Line 438: dbFind.Dispose();Line 439: #endregionLine 440: Line 441: result = new JavaScriptSerializer().Serialize(practices);Line 442: Line 443: // PrepareLine 444: string callback = HttpContext.Current.Request.Params["callback"];Line 445: string json = "{\"practices\": " + result + ", \"practicecount\": " + selections.Count + "}";Line 446: string response = string.IsNullOrEmpty(callback) ? json : string.Format("{0}({1});", callback, json);Line 447: Line 448: // ResponseLine 449: HttpContext.Current.Response.ContentType = "application/json";Line 450: HttpContext.Current.Response.Write(response);Line 451: }Line 452: catch (Exception ex)Line 453: {Line 454: throw ex;Line 455: }Line 456: }Line 457: Line 458: [WebMethod]Line 459: [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]Line 460: Line 461: public void AdvocareLocations()Line 462: {Line 463: var locations = new List<RemedyLocation>();Line 464: string result = string.Empty;Line 465: tryLine 466: {Line 467: #region GetDataLine 468: LocationSearchDataContext dbFind = new LocationSearchDataContext();Line 469: List<remedy_GetAllLocationsResult> selections = dbFind.remedy_GetAllLocations().ToList();Line 470: //DataSet ds = new DataSet();Line 471: for (int i = 0; i < selections.Count; i++)Line 472: {Line 473: var loc = new RemedyLocation();Line 474: loc.ItemId = selections[i].ItemID;Line 475: loc.PracticeName = selections[i].PracticeName;Line 476: loc.PracticePhone = selections[i].PracticePhone;Line 477: loc.SpecialtyIcon = selections[i].SpecialtyIcon;Line 478: loc.SpecialtyId = int.Parse(selections[i].SpecialtyId.ToString());Line 479: loc.SpecialtyName = selections[i].SpecialtyName;Line 480: loc.PracPhotoURL = selections[i].PracPhotoURL;Line 481: string url = selections[i].WebsiteURL;Line 482: if (url.Length > 0)Line 483: {Line 484: url = url.Replace("https://", "");Line 485: url = url.Replace("http://", "");Line 486: url = url.Replace("https:", "");Line 487: url = url.Replace("http:", "");Line 488: }Line 489: loc.WebsiteUrl = url;Line 490: loc.GooglePlaceId = selections[i].GooglePlaceId;Line 491: loc.LocationGooglePlaceId = selections[i].GooglePlaceId;Line 492: loc.PracticeGroup = selections[i].PracticeGroup;Line 493: loc.LocationName = selections[i].LocationName;Line 494: loc.Address1 = selections[i].Address1;Line 495: loc.Address2 = selections[i].Address2;Line 496: loc.City = selections[i].City;Line 497: loc.State = selections[i].State;Line 498: loc.Zip = selections[i].Zip;Line 499: loc.Latitude = selections[i].Latitude.ToString();Line 500: loc.Longitude = selections[i].Longitude.ToString();Line 501: loc.OfficePhone = selections[i].OfficePhone;Line 502: loc.LocationURL = selections[i].LocationURL;Line 503: loc.LocPhotoURL = selections[i].LocPhotoURL;Line 504: loc.OfficeFax = selections[i].OfficeFax;Line 505: locationMap map = new locationMap();Line 506: locationGeo geo = new locationGeo();Line 507: locationStreetAddress add = new locationStreetAddress();Line 508: decimal tryDec = 0;Line 509: if (decimal.TryParse(loc.Latitude, out tryDec) == true)Line 510: {Line 511: geo.latitude = decimal.Parse(loc.Latitude);Line 512: }Line 513: if (decimal.TryParse(loc.Longitude, out tryDec) == true)Line 514: {Line 515: geo.longitude = decimal.Parse(loc.Longitude);Line 516: }Line 517: map.geo = geo;Line 518: add.streeAddress = loc.Address1 + " " + loc.Address2;Line 519: map.address = add;Line 520: map.address_geolocation = loc.Address1 + " " + loc.City + " " + loc.State + " " + loc.Zip;Line 521: Line 522: loc.MapLocation = map;Line 523: if (selections[i].ShowInSearch != null)Line 524: {Line 525: if (selections[i].ShowInSearch.ToString() != "")Line 526: {Line 527: loc.ShowInSearch = bool.Parse(selections[i].ShowInSearch.ToString());Line 528: }Line 529: elseLine 530: {Line 531: loc.ShowInSearch = false;Line 532: }Line 533: Line 534: }Line 535: loc.RatingsType = selections[i].RatingsType;Line 536: int order = 0;Line 537: if (selections[i].ItemOrder != null)Line 538: {Line 539: order = int.Parse(selections[i].ItemOrder.ToString());Line 540: }Line 541: loc.ItemOrder = order;Line 542: Line 543: Line 544: locations.Add(loc);Line 545: }Line 546: dbFind.Dispose();Line 547: #endregionLine 548: Line 549: result = new JavaScriptSerializer().Serialize(locations);Line 550: Line 551: // PrepareLine 552: string callback = HttpContext.Current.Request.Params["callback"];Line 553: string json = "{\"locations\": " + result + ", \"locationcount\": " + selections.Count + "}";Line 554: string response = string.IsNullOrEmpty(callback) ? json : string.Format("{0}({1});", callback, json);Line 555: Line 556: // ResponseLine 557: HttpContext.Current.Response.ContentType = "application/json";Line 558: HttpContext.Current.Response.Write(response);Line 559: }Line 560: catch (Exception ex)Line 561: {Line 562: throw ex;Line 563: }Line 564: }Line 565: [WebMethod]Line 566: [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]Line 567: Line 568: public void AdvocareProviders()Line 569: {Line 570: var staff = new List<RemedyStaff>();Line 571: string result = string.Empty;Line 572: tryLine 573: {Line 574: #region GetDataLine 575: LocationSearchDataContext dbFind = new LocationSearchDataContext();Line 576: List<remedy_GetAllStaffResult> selections = dbFind.remedy_GetAllStaff().ToList();Line 577: //DataSet ds = new DataSet();Line 578: for (int i = 0; i < selections.Count; i++)Line 579: {Line 580: var prov = new RemedyStaff();Line 581: prov.ItemId = selections[i].ItemID;Line 582: prov.FirstName = selections[i].FirstName;Line 583: prov.LastName = selections[i].LastName;Line 584: prov.MiddleName = selections[i].MiddleName;Line 585: prov.FullName = selections[i].FullName;Line 586: prov.Title = selections[i].Title;Line 587: prov.GooglePlaceId = selections[i].GooglePlaceId;Line 588: prov.BookingURL = selections[i].BookingURL;Line 589: prov.BookingURL2 = selections[i].BookingURL2;Line 590: prov.Gender = selections[i].Gender;Line 591: prov.Language = selections[i].Language;Line 592: prov.MetaDescription = selections[i].MetaDescription;Line 593: prov.MetaTitle = selections[i].MetaTitle;Line 594: prov.ProfilePhotoURL = selections[i].ProfilePhotoUrl;Line 595: prov.ProfileURL = selections[i].ProfileUrl;Line 596: prov.SpecialtyName = selections[i].SpecialtyName;Line 597: prov.StaffCategory = selections[i].StaffCategory;Line 598: prov.StaffPhotoURL = selections[i].StaffPhotoUrl;Line 599: //Add Staff SpecialtiesLine 600: List<RemedySpecialty> specsPerStaff = new List<RemedySpecialty>();Line 601: List<remedy_GetSpecialtiesPerStaffResult> specs = dbFind.remedy_GetSpecialtiesPerStaff(prov.ItemId).ToList();Line 602: foreach (remedy_GetSpecialtiesPerStaffResult spec in specs)Line 603: {Line 604: RemedySpecialty specialty = new RemedySpecialty();Line 605: specialty.ItemId = spec.ItemID;Line 606: specialty.SpecialtyDescription = spec.SpecialtyDesc;Line 607: specialty.SpecialtyIcon = spec.SpecialtyIcon;Line 608: specialty.SpecialtyName = spec.SpecialtyName;Line 609: specsPerStaff.Add(specialty);Line 610: }Line 611: prov.StaffSpecialty = specsPerStaff;Line 612: //Add Staff LocationsLine 613: List<RemedyLocation> locationsPerStaff = new List<RemedyLocation>();Line 614: List<remedy_GetLocationsPerStaffResult> locs = dbFind.remedy_GetLocationsPerStaff(prov.ItemId).ToList();Line 615: Line 616: foreach (remedy_GetLocationsPerStaffResult loc in locs)Line 617: {Line 618: RemedyLocation location = new RemedyLocation();Line 619: location.ItemId = loc.ItemID;Line 620: location.Address1 = loc.Address1;Line 621: location.Address2 = loc.Address2;Line 622: location.City = loc.City;Line 623: location.GooglePlaceId = loc.GooglePlaceId;Line 624: if (loc.ItemOrder != null)Line 625: {Line 626: location.ItemOrder = int.Parse(loc.ItemOrder.ToString());Line 627: }Line 628: if (loc.Latitude != null)Line 629: {Line 630: location.Latitude = loc.Latitude.ToString();Line 631: }Line 632: location.LocationGooglePlaceId = loc.GooglePlaceId;Line 633: location.LocationName = loc.LocationName;Line 634: location.LocationURL = loc.LocationURL;Line 635: location.LocPhotoURL = loc.LocPhotoURL;Line 636: if (loc.Longitude != null)Line 637: {Line 638: location.Longitude = loc.Longitude.ToString();Line 639: }Line 640: location.MetaDescription = loc.MetaDescription;Line 641: location.OfficeFax = loc.OfficeFax;Line 642: location.OfficePhone = loc.OfficePhone;Line 643: if (loc.PracticeName != null)Line 644: {Line 645: if (loc.PracticeName != "")Line 646: {Line 647: location.PracticeName = loc.PracticeName;Line 648: location.PracticeGroup = loc.PracticeGroup;Line 649: location.PracPhotoURL = loc.PracPhotoURL;Line 650: }Line 651: }Line 652: location.RatingsType = loc.RatingsType;Line 653: location.ShowInSearch = bool.Parse(loc.ShowInSearch.ToString());Line 654: location.SpecialtyIcon = loc.SpecialtyIcon;Line 655: location.SpecialtyName = loc.SpecialtyName;Line 656: location.State = loc.State;Line 657: location.Zip = loc.Zip;Line 658: Line 659: locationsPerStaff.Add(location);Line 660: }Line 661: prov.StaffLocations = locationsPerStaff;Line 662: //Line 663: Line 664: int order = 0;Line 665: if (selections[i].ItemOrder != null)Line 666: {Line 667: order = int.Parse(selections[i].ItemOrder.ToString());Line 668: }Line 669: prov.ItemOrder = order;Line 670: Line 671: Line 672: staff.Add(prov);Line 673: Line 674: }Line 675: dbFind.Dispose();Line 676: #endregionLine 677: Line 678: var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();Line 679: serializer.MaxJsonLength = Int32.MaxValue;Line 680: result = serializer.Serialize(staff);Line 681: //result = new JavaScriptSerializer().Serialize(staff);Line 682: Line 683: // PrepareLine 684: string callback = HttpContext.Current.Request.Params["callback"];Line 685: string json = "{\"providers\": " + result + ", \"providercount\": " + selections.Count + "}";Line 686: string response = string.IsNullOrEmpty(callback) ? json : string.Format("{0}({1});", callback, json);Line 687: Line 688: // ResponseLine 689: HttpContext.Current.Response.ContentType = "application/json";Line 690: HttpContext.Current.Response.Write(response);Line 691: }Line 692: catch (Exception ex)Line 693: {Line 694: throw ex;Line 695: Line 696: }Line 697: }Line 698: [WebMethod]Line 699: [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]Line 700: Line 701: public void AdvocareSpecialties()Line 702: {Line 703: var specialties = new List<RemedySpecialty>();Line 704: string result = string.Empty;Line 705: tryLine 706: {Line 707: #region GetDataLine 708: LocationSearchDataContext dbFind = new LocationSearchDataContext();Line 709: List<remedy_GetAllSpecialtiesResult> selections = dbFind.remedy_GetAllSpecialties().ToList();Line 710: //DataSet ds = new DataSet();Line 711: for (int i = 0; i < selections.Count; i++)Line 712: {Line 713: var spec = new RemedySpecialty();Line 714: spec.ItemId = selections[i].ItemID;Line 715: spec.SpecialtyDescription = selections[i].SpecialtyDesc;Line 716: spec.SpecialtyIcon = selections[i].SpecialtyIcon;Line 717: spec.SpecialtyName = selections[i].SpecialtyName;Line 718: Line 719: Line 720: Line 721: specialties.Add(spec);Line 722: }Line 723: dbFind.Dispose();Line 724: #endregionLine 725: Line 726: result = new JavaScriptSerializer().Serialize(specialties);Line 727: Line 728: // PrepareLine 729: string callback = HttpContext.Current.Request.Params["callback"];Line 730: string json = "{\"specialties\": " + result + ", \"specialtycount\": " + selections.Count + "}";Line 731: string response = string.IsNullOrEmpty(callback) ? json : string.Format("{0}({1});", callback, json);Line 732: Line 733: // ResponseLine 734: HttpContext.Current.Response.ContentType = "application/json";Line 735: HttpContext.Current.Response.Write(response);Line 736: }Line 737: catch (Exception ex)Line 738: {Line 739: throw ex;Line 740: }Line 741: }Line 742: Line 743: [WebMethod]Line 744: [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]Line 745: Line 746: public void AdvocareZipCodes()Line 747: {Line 748: var zipcodes = new List<RemedyZipCode>();Line 749: string result = string.Empty;Line 750: tryLine 751: {Line 752: #region GetDataLine 753: LocationSearchDataContext dbFind = new LocationSearchDataContext();Line 754: List<remedy_GetAllZipCodesResult> selections = dbFind.remedy_GetAllZipCodes().ToList();Line 755: //DataSet ds = new DataSet();Line 756: for (int i = 0; i < selections.Count; i++)Line 757: {Line 758: var zip = new RemedyZipCode();Line 759: zip.ItemId = selections[i].ItemID;Line 760: zip.ZipCode = selections[i].ZipCode;Line 761: zip.AreaName = selections[i].AreaName;Line 762: zip.Latitude = selections[i].ZipCodeLatitude;Line 763: zip.Longitude = selections[i].ZipCodeLongitude;Line 764: Line 765: Line 766: zipcodes.Add(zip);Line 767: }Line 768: dbFind.Dispose();Line 769: #endregionLine 770: Line 771: result = new JavaScriptSerializer().Serialize(zipcodes);Line 772: Line 773: // PrepareLine 774: string callback = HttpContext.Current.Request.Params["callback"];Line 775: string json = "{\"zipcodes\": " + result + ", \"zipcodecount\": " + selections.Count + "}";Line 776: string response = string.IsNullOrEmpty(callback) ? json : string.Format("{0}({1});", callback, json);Line 777: Line 778: // ResponseLine 779: HttpContext.Current.Response.ContentType = "application/json";Line 780: HttpContext.Current.Response.Write(response);Line 781: }Line 782: catch (Exception ex)Line 783: {Line 784: throw ex;Line 785: }Line 786: }Line 787: #endregionLine 788: Line 789: Line 790: }Line 791:
|