using System.Collections.Generic;

using BS.Shared;

namespace BeWo.Data.Entities
{
    public class Customer2Wohnheim : BeWoEntityBase
    {
        public static string PropertyName_Wohnheim = "Wohnheim";

        public static string PropertyName_WohnheimOid = "WohnheimOid";

        public static string PropertyName_Customer = "Customer";

        public static string PropertyName_CustomerOid = "CustomerOid";

        public static string PropertyName_ValueList = "ValueList";

        private Wohnheim _Wohnheim;

        private long? _WohnheimOid;

        private Customer _Customer;

        private long? _CustomerOid;

        private IList<ValueListEntry2Object> _ValueList;

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

        public virtual Wohnheim Wohnheim
        {
            get
            {
                return this._Wohnheim;
            }

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

                    if (this._Wohnheim != null)
                    {
                        this.WohnheimOid = this._Wohnheim.Oid;
                    }
                    else
                    {
                        this.WohnheimOid = null;
                    }
                }
            }
        }

        public virtual long? WohnheimOid
        {
            get
            {
                return this._WohnheimOid;
            }

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

        public virtual Customer Customer
        {
            get
            {
                return this._Customer;
            }

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

                    if (this._Customer != null)
                    {
                        this.CustomerOid = this._Customer.Oid;
                    }
                    else
                    {
                        this.CustomerOid = null;
                    }
                }
            }
        }

        public virtual long? CustomerOid
        {
            get
            {
                return this._CustomerOid;
            }

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

        public virtual IList<ValueListEntry2Object> ValueList
        {
            get
            {
                return this._ValueList ?? (this._ValueList = new List<ValueListEntry2Object>());
            }

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

    }
}