kashiash
4/27/2019 - 5:10 PM

#XAF customers and Adresses

#XAF customers and Adresses

    [NavigationItem]
    public class Customer : BaseObject {
        public Customer(Session session) : base(session) { }
        public string Name {
            get { return GetPropertyValue<string>("Name"); }
            set { SetPropertyValue<string>("Name", value); }
        }
        [DataSourceProperty("Addresses")]
        public CustomerAddress CurrentAddress {
            get { return GetPropertyValue<CustomerAddress>("CurrentAddress"); }
            set { SetPropertyValue<CustomerAddress>("CurrentAddress", value); }
        }
        [Association]
        [Aggregated]
        public XPCollection<CustomerAddress> Addresses {
            get { return GetCollection<CustomerAddress>("Addresses"); }
        }
    }
    [DefaultProperty("Address")]
    public class CustomerAddress : BaseObject {
        public CustomerAddress(Session session) : base(session) { }
        public string Address {
            get { return GetPropertyValue<string>("Address"); }
            set { SetPropertyValue<string>("Address", value); }
        }
        [Association]
        public Customer Customer {
            get { return GetPropertyValue<Customer>("Customer"); }
            set { SetPropertyValue<Customer>("Customer", value); }
        }
    }