using System.ComponentModel;
using System.Collections.Generic;

namespace MultipleChildDataInTabControl
{
    public class Customer : INotifyPropertyChanged
    {
        private string name;
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                if (name != value)
                {
                    this.OnPropertyChanged("Name");
                    name = value;
                }
            }
        }

        public int Age
        {
            get;
            set;
        }

        public int? JobCode
        {
            get;
            set;
        }

        public bool Boolean
        {
            get;
            set;
        }

        public List<Order> Orders
        {
            get;
            set;
        }

        public List<Order> CancelledOrders
        {
            get;
            set;
        }

        public override string ToString()
        {
            return string.Format("Age: {0}, JobCode: {1}", this.Age, this.JobCode);
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}