gov.va.medora.mdo.api.SitesApi.matchCityAndState C# (CSharp) Method

matchCityAndState() public method

public matchCityAndState ( string city, string stateAbbr, string connectionString ) : string[]
city string
stateAbbr string
connectionString string
return string[]
        public string[] matchCityAndState(string city, string stateAbbr, string connectionString)
        {
            ZipcodeDao dao = new ZipcodeDao(connectionString);
            return dao.matchCityAndState(city, stateAbbr);
        }

Usage Example

コード例 #1
0
ファイル: SitesLib.cs プロジェクト: OSEHRA/mdws
        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;
        }