using System.Collections.Generic;

using BS.Shared;

namespace BeWo.Data.Entities
{
    public class Organisation : BeWoEntityBase
    {
        public static string PropertyName_Address = "Address";

        public static string PropertyName_BankAccount = "BankAccount";

        public static string PropertyName_Contacts = "Contacts";

        public static string PropertyName_CostBearer = "CostBearer";

        public static string PropertyName_InvoiceAddress = "InvoiceAddress";

        public static string PropertyName_Name = "Name";

        public static string PropertyName_DebitorNumber = "DebitorNumber";

        public static string PropertyName_Organisation2PersonList = "Organisation2PersonList";

        private Address _Address;

        private BankAccount _BankAccount;

        private IList<Contact> _Contacts;

        private CostBearer _CostBearer;

        private Address _InvoiceAddress;

        private string _Name;

        private string _DebitorNumber;

        private IList<Organisation2Person> _Organisation2PersonList;

		private IList<VarFieldValue> _VarFieldValueList;

        public Organisation()
        {
            this._Tid = TableID.Organisation;
        }

        public virtual Address Address
        {
            get
            {
                return this._Address;
            }

            set
            {
                if (this.AreDifferent(this._Address, value))
                {
                    this._Address = value;
                }
            }
        }

        public virtual BankAccount BankAccount
        {
            get
            {
                return this._BankAccount;
            }

            set
            {
                if (this.AreDifferent(this._BankAccount, value))
                {
                    this._BankAccount = value;
                }
            }
        }

        public virtual IList<Contact> Contacts
        {
            get
            {
                return this._Contacts ?? (this._Contacts = new List<Contact>());
            }

            set
            {
                if (this.AreDifferent(this._Contacts, value))
                {
                    this._Contacts = value;
                }
            }
        }

        public virtual CostBearer CostBearer
        {
            get
            {
                return this._CostBearer;
            }

            set
            {
                if (this.AreDifferent(this._CostBearer, value))
                {
                    this._CostBearer = value;
                }
            }
        }

        public virtual Address InvoiceAddress
        {
            get
            {
                return this._InvoiceAddress;
            }

            set
            {
                if (this.AreDifferent(this._InvoiceAddress, value))
                {
                    this._InvoiceAddress = value;
                }
            }
        }

        public virtual string Name
        {
            get
            {
                return this._Name;
            }

            set
            {
                if (this.AreDifferent(this._Name, value))
                {
                    this._Name = value;
                }
            }
        }

        public virtual string DebitorNumber
        {
            get
            {
                return this._DebitorNumber;
            }

            set
            {
                if (this.AreDifferent(this._DebitorNumber, value))
                {
                    this._DebitorNumber = value;
                }
            }
        }

        public virtual IList<Organisation2Person> Organisation2PersonList
        {
            get { return this._Organisation2PersonList ?? (this._Organisation2PersonList = new List<Organisation2Person>()); }

            set
            {
                if (this.AreDifferent(this._Organisation2PersonList, value))
                {
                    this._Organisation2PersonList = value;
                }
            }
        }
		public virtual IList<VarFieldValue> VarFieldValueList
		{
			get
			{
				return this._VarFieldValueList ?? (this._VarFieldValueList = new List<VarFieldValue>());
			}

			set
			{
				if (this.AreDifferent(this._VarFieldValueList, value))
				{
					this._VarFieldValueList = value;
				}
			}
		}
    }
}