//---------------------------------------------------------------------------------------------
// This file was AUTO-GENERATED by "Xomega Data Objects" Xomega.Net generator.
//
// Manual CHANGES to this file WILL BE LOST when the code is regenerated.
//---------------------------------------------------------------------------------------------

using Microsoft.Extensions.DependencyInjection;
using System;
using Xomega.Framework;
using Xomega.Framework.Properties;

namespace AdventureWorks.Client.Objects
{
    public partial class SalesOrderCustomerObject : DataObject
    {
        #region Constants

        public const string AccountNumber = "AccountNumber";
        public const string BillingAddress = "BillingAddress";
        public const string CustomerId = "CustomerId";
        public const string Lookup = "Lookup";
        public const string PersonId = "PersonId";
        public const string PersonName = "PersonName";
        public const string ShippingAddress = "ShippingAddress";
        public const string StoreId = "StoreId";
        public const string StoreName = "StoreName";
        public const string TerritoryId = "TerritoryId";

        #endregion

        #region Properties

        public TextProperty AccountNumberProperty { get; private set; }
        public IntegerKeyProperty CustomerIdProperty { get; private set; }
        public IntegerKeyProperty PersonIdProperty { get; private set; }
        public TextProperty PersonNameProperty { get; private set; }
        public IntegerKeyProperty StoreIdProperty { get; private set; }
        public TextProperty StoreNameProperty { get; private set; }
        public EnumIntProperty TerritoryIdProperty { get; private set; }

        #endregion

        #region Child Objects

        public AddressObject BillingAddressObject { get { return (AddressObject)GetChildObject(BillingAddress); } }
        public SalesCustomerLookupObject LookupObject { get { return (SalesCustomerLookupObject)GetChildObject(Lookup); } }
        public AddressObject ShippingAddressObject { get { return (AddressObject)GetChildObject(ShippingAddress); } }

        #endregion

        #region Construction

        public SalesOrderCustomerObject()
        {
        }

        public SalesOrderCustomerObject(IServiceProvider serviceProvider) : base(serviceProvider)
        {
        }

        protected override void Initialize()
        {
            CustomerIdProperty = new IntegerKeyProperty(this, CustomerId)
            {
                Required = true,
                IsKey = true,
            };
            StoreIdProperty = new IntegerKeyProperty(this, StoreId)
            {
                Editable = false,
            };
            StoreNameProperty = new TextProperty(this, StoreName)
            {
                Editable = false,
            };
            PersonIdProperty = new IntegerKeyProperty(this, PersonId)
            {
                Editable = false,
            };
            PersonNameProperty = new TextProperty(this, PersonName)
            {
                Editable = false,
            };
            AccountNumberProperty = new TextProperty(this, AccountNumber)
            {
                Required = true,
                Size = 10,
                Editable = false,
            };
            TerritoryIdProperty = new EnumIntProperty(this, TerritoryId)
            {
                EnumType = "sales territory",
                Editable = false,
            };
            DataObject objLookup = ServiceProvider.GetService<SalesCustomerLookupObject>();
            AddChildObject(Lookup, objLookup);
            DataObject objBillingAddress = ServiceProvider.GetService<AddressObject>();
            AddChildObject(BillingAddress, objBillingAddress);
            DataObject objShippingAddress = ServiceProvider.GetService<AddressObject>();
            AddChildObject(ShippingAddress, objShippingAddress);
        }

        #endregion
    }
}