public SiteArray getSitesForCounty(string fips) { SiteArray result = new SiteArray(); if (fips == "") { result.fault = new FaultTO("Missing fips"); } if (result.fault != null) { return result; } try { SitesApi api = new SitesApi(); Site[] sites = api.getClosestFacilities(fips, mySession.MdwsConfiguration.SqlConnectionString); result = new SiteArray(sites); } catch (Exception e) { result.fault = new FaultTO(e.Message); } return result; }
public TaggedTextArray matchCityAndState(string city, string stateAbbr) { TaggedTextArray result = new TaggedTextArray(); if (city == "") { result.fault = new FaultTO("Missing city"); } else if (stateAbbr == "") { result.fault = new FaultTO("Missing stateAbbr"); } if (result.fault != null) { return result; } try { SitesApi api = new SitesApi(); string[] s = api.matchCityAndState(city, stateAbbr, mySession.MdwsConfiguration.SqlConnectionString); result.results = new TaggedText[s.Length]; for (int i = 0; i < s.Length; i++) { string[] parts = StringUtils.split(s[i],StringUtils.CARET); result.results[i] = new TaggedText(parts[0], parts[1]); } result.count = result.results.Length; } catch (Exception e) { result.fault = new FaultTO(e.Message); } return result; }
public ClosestFacilityTO getNearestFacility(string zipcode) { ClosestFacilityTO result = new ClosestFacilityTO(); if (zipcode == "") { result.fault = new FaultTO("Missing zipcode"); } if (result.fault != null) { return result; } try { SitesApi api = new SitesApi(); ClosestFacility fac = api.getNearestFacility(zipcode, mySession.MdwsConfiguration.SqlConnectionString); result = new ClosestFacilityTO(fac); } catch (Exception e) { result.fault = new FaultTO(e.Message); } return result; }