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);
        }
Ejemplo n.º 2
0
 public void UpdateFirm(tFirmy firm, ITravelAgencyService service)
 {
     firm.REGON      = REGON.Text;
     firm.NIP        = NIP.Text;
     firm.NazwaFirmy = Name.Text;
     Address.UpdateAddress(firm.tAdresy, service);
 }
Ejemplo n.º 3
0
 public void UpdatePerson(tOsoby person, ITravelAgencyService service)
 {
     person.NIP      = NIP.Text;
     person.Imie     = FirstName.Text;
     person.Nazwisko = Surname.Text;
     Address.UpdateAddress(person.tAdresy, service);
 }
        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;
        }
Ejemplo n.º 5
0
 public AccountController()
 {
     this.service = new TravelAgencyService();
 }
Ejemplo n.º 6
0
 public IEnumerable <MvcTravelAgency> TravelAgencies([FromServices] ITravelAgencyService service)
 {
     return(service.GetTravelAgencies().Select((agency) => agency.ToMvcTravelAgency()));
 }
Ejemplo n.º 7
0
 public tAdresy GetAddressEntity(ITravelAgencyService service)
 {
     return(Address.CreateAddress(service));
 }