コード例 #1
0
        private void QueryCounty(Dictionary <string, object> source, MeningoPatient patient)
        {
            if (!QueryCountyEnabled)
            {
                return;
            }
            var json        = new GeonamesService().QueryByPostalCode(source["plz"].ToString());
            var jObject     = JObject.Parse(json);
            var postalCodes = jObject["postalcodes"];

            if (postalCodes.Any())
            {
                var city   = postalCodes[0]["placeName"];
                var county = postalCodes[0]["adminName3"];
                var state  = postalCodes[0]["adminCode1"];
                patient.County = county.ToString();
            }
        }
コード例 #2
0
 public GeonamesController(GeonamesService geonamesService, Func <string, string> readServerFile)
 {
     _geonamesService    = geonamesService;
     this.readServerFile = readServerFile;
 }