internal tAdresy CreateAddress(ITravelAgencyService service)
        {
            var country = service.GetCounty(Country.Text);

            if (country == null)
            {
                throw new ArgumentException("Country name is invalid.");
            }
            var a = new tAdresy()
            {
                Adres   = Address.Text,
                Panstwo = country.IDPanstwa,
                Miasto  = City.Text,
                Region  = Region.Text,
                Kod     = ZipCode.Text,
                Faks    = Fax.Text,
                Telefon = Phone.Text
            };

            if (!String.IsNullOrWhiteSpace(AddressId.Value))
            {
                a.IDAdresu = int.Parse(AddressId.Value);
            }
            return(a);
        }
        public void UpdateAddress(tAdresy obj, ITravelAgencyService service)
        {
            var country = service.GetCounty(Country.Text);

            if (country == null)
            {
                throw new ArgumentException("Country name is invalid.");
            }
            obj.Adres    = Address.Text;
            obj.tPanstwa = country;
            obj.Miasto   = City.Text;
            obj.Region   = Region.Text;
            obj.Kod      = ZipCode.Text;
            obj.Faks     = Fax.Text;
            obj.Telefon  = Phone.Text;
        }