using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BeWo.Data.Entities
{
    public class Team2Customer : BeWoEntityBase
    {
        public static string PropertyName_ValueList = "ValueList";
        public static string PropertyName_Customer = "Customer";
        public static string PropertyName_Team = "Team";
        public static string PropertyName_TeamOid = "TeamOid";
        public static string PropertyName_CustomerOid = "CustomerOid";

        private IList<ValueListEntry2Object> _ValueList;
        private Team _Team;
        private Customer _Customer;
        private long? _TeamOid;
        private long? _CustomerOid;
  
        public Team2Customer() { } //_Tid = TableID.Team2Customer; }

        public virtual Customer Customer
        {
            get { return _Customer; }
            set
            {
                if (base.AreDifferent(_Customer, value))
                {
                    _Customer = value;

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

        public virtual Team Team
        {
            get { return _Team; }
            set
            {
                if (base.AreDifferent(_Team, value))
                {
                    _Team = value;

                    if (_Team != null)
                    {
                        TeamOid = _Team.Oid;
                    }
                    else
                    {
                        TeamOid = null;
                    }
                }
            }
        }

        public virtual long? TeamOid
        {
            get { return _TeamOid; }
            set
            {
                if (AreDifferent(_TeamOid, value))
                    _TeamOid = value;
            }
        }

        public virtual long? CustomerOid
        {
            get { return _CustomerOid; }
            set
            {
                if (AreDifferent(_CustomerOid, value))
                    _CustomerOid = value;
            }
        }

        public virtual IList<ValueListEntry2Object> ValueList
        {
            get
            {
                return _ValueList ?? (_ValueList = new List<ValueListEntry2Object>());
            }
            set
            {
                if (base.AreDifferent(_ValueList, value))
                    _ValueList = value;
            }
        }
    }
}