예제 #1
0
        private void SaveZip(WebServiceObject result)
        {
            Zip zip = new Zip
            {
                PostCode    = result.PostCode,
                Country     = result.Country,
                CountryCode = result.CountryCode
            };

            BL.Mangers.ZipManager.SaveZip(zip);

            foreach (Place i in result.PlaceList)
            {
                i.PostCode = zip.PostCode;
            }
        }
예제 #2
0
        public async void getZip(string zip)
        {
            var rest = RestService.For <GetUsAddress>(BL.WsHandler.RefitConstants.BASE_URL);

            try
            {
                WebServiceObject result = await rest.getZipData(zip);

                Console.WriteLine(result.PostCode);
                //Zip zip = result as Zip;
                List <Place> places = result.PlaceList;
                SaveZip(result);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }