#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace CompleteDataDemo
{
	using System.Data.Linq;
	using System.Data.Linq.Mapping;
	using System.Data;
	using System.Collections.Generic;
	using System.Reflection;
	using System.Linq;
	using System.Linq.Expressions;
	using System.ComponentModel;
	using System;
	
	
	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="Analytics")]
	public partial class CustomersModelDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertCustomer(Customer instance);
    partial void UpdateCustomer(Customer instance);
    partial void DeleteCustomer(Customer instance);
    #endregion
		
		public CustomersModelDataContext() : 
				base(global::CompleteDataDemo.Properties.Settings.Default.AnalyticsConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public CustomersModelDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public CustomersModelDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public CustomersModelDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public CustomersModelDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<Customer> Customers
		{
			get
			{
				return this.GetTable<Customer>();
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Customers")]
	public partial class Customer : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _CustomerKey;
		
		private string _Country;
		
		private string _FirstName;
		
		private string _LastName;
		
		private System.Nullable<char> _MaritalStatus;
		
		private string _Gender;
		
		private string _EmailAddress;
		
		private System.Nullable<decimal> _YearlyIncome;
		
		private System.Nullable<byte> _Children;
		
		private string _Education;
		
		private string _Occupation;
		
		private System.Nullable<char> _HouseOwnerFlag;
		
		private System.Nullable<byte> _NumberCarsOwned;
		
		private string _Phone;
		
		private string _CommuteDistance;
		
		private string _Region;
		
		private System.Nullable<int> _Age;
		
		private System.Nullable<decimal> _Profitability;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnCustomerKeyChanging(int value);
    partial void OnCustomerKeyChanged();
    partial void OnCountryChanging(string value);
    partial void OnCountryChanged();
    partial void OnFirstNameChanging(string value);
    partial void OnFirstNameChanged();
    partial void OnLastNameChanging(string value);
    partial void OnLastNameChanged();
    partial void OnMaritalStatusChanging(System.Nullable<char> value);
    partial void OnMaritalStatusChanged();
    partial void OnGenderChanging(string value);
    partial void OnGenderChanged();
    partial void OnEmailAddressChanging(string value);
    partial void OnEmailAddressChanged();
    partial void OnYearlyIncomeChanging(System.Nullable<decimal> value);
    partial void OnYearlyIncomeChanged();
    partial void OnChildrenChanging(System.Nullable<byte> value);
    partial void OnChildrenChanged();
    partial void OnEducationChanging(string value);
    partial void OnEducationChanged();
    partial void OnOccupationChanging(string value);
    partial void OnOccupationChanged();
    partial void OnHouseOwnerFlagChanging(System.Nullable<char> value);
    partial void OnHouseOwnerFlagChanged();
    partial void OnNumberCarsOwnedChanging(System.Nullable<byte> value);
    partial void OnNumberCarsOwnedChanged();
    partial void OnPhoneChanging(string value);
    partial void OnPhoneChanged();
    partial void OnCommuteDistanceChanging(string value);
    partial void OnCommuteDistanceChanged();
    partial void OnRegionChanging(string value);
    partial void OnRegionChanged();
    partial void OnAgeChanging(System.Nullable<int> value);
    partial void OnAgeChanged();
    partial void OnProfitabilityChanging(System.Nullable<decimal> value);
    partial void OnProfitabilityChanged();
    #endregion
		
		public Customer()
		{
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CustomerKey", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int CustomerKey
		{
			get
			{
				return this._CustomerKey;
			}
			set
			{
				if ((this._CustomerKey != value))
				{
					this.OnCustomerKeyChanging(value);
					this.SendPropertyChanging();
					this._CustomerKey = value;
					this.SendPropertyChanged("CustomerKey");
					this.OnCustomerKeyChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Country", DbType="NVarChar(50)")]
		public string Country
		{
			get
			{
				return this._Country;
			}
			set
			{
				if ((this._Country != value))
				{
					this.OnCountryChanging(value);
					this.SendPropertyChanging();
					this._Country = value;
					this.SendPropertyChanged("Country");
					this.OnCountryChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FirstName", DbType="NVarChar(50)")]
		public string FirstName
		{
			get
			{
				return this._FirstName;
			}
			set
			{
				if ((this._FirstName != value))
				{
					this.OnFirstNameChanging(value);
					this.SendPropertyChanging();
					this._FirstName = value;
					this.SendPropertyChanged("FirstName");
					this.OnFirstNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastName", DbType="NVarChar(50)")]
		public string LastName
		{
			get
			{
				return this._LastName;
			}
			set
			{
				if ((this._LastName != value))
				{
					this.OnLastNameChanging(value);
					this.SendPropertyChanging();
					this._LastName = value;
					this.SendPropertyChanged("LastName");
					this.OnLastNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaritalStatus", DbType="NChar(1)")]
		public System.Nullable<char> MaritalStatus
		{
			get
			{
				return this._MaritalStatus;
			}
			set
			{
				if ((this._MaritalStatus != value))
				{
					this.OnMaritalStatusChanging(value);
					this.SendPropertyChanging();
					this._MaritalStatus = value;
					this.SendPropertyChanged("MaritalStatus");
					this.OnMaritalStatusChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Gender", DbType="NVarChar(1)")]
		public string Gender
		{
			get
			{
				return this._Gender;
			}
			set
			{
				if ((this._Gender != value))
				{
					this.OnGenderChanging(value);
					this.SendPropertyChanging();
					this._Gender = value;
					this.SendPropertyChanged("Gender");
					this.OnGenderChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EmailAddress", DbType="NVarChar(50)")]
		public string EmailAddress
		{
			get
			{
				return this._EmailAddress;
			}
			set
			{
				if ((this._EmailAddress != value))
				{
					this.OnEmailAddressChanging(value);
					this.SendPropertyChanging();
					this._EmailAddress = value;
					this.SendPropertyChanged("EmailAddress");
					this.OnEmailAddressChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearlyIncome", DbType="Money")]
		public System.Nullable<decimal> YearlyIncome
		{
			get
			{
				return this._YearlyIncome;
			}
			set
			{
				if ((this._YearlyIncome != value))
				{
					this.OnYearlyIncomeChanging(value);
					this.SendPropertyChanging();
					this._YearlyIncome = value;
					this.SendPropertyChanged("YearlyIncome");
					this.OnYearlyIncomeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Children", DbType="TinyInt")]
		public System.Nullable<byte> Children
		{
			get
			{
				return this._Children;
			}
			set
			{
				if ((this._Children != value))
				{
					this.OnChildrenChanging(value);
					this.SendPropertyChanging();
					this._Children = value;
					this.SendPropertyChanged("Children");
					this.OnChildrenChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Education", DbType="NVarChar(40)")]
		public string Education
		{
			get
			{
				return this._Education;
			}
			set
			{
				if ((this._Education != value))
				{
					this.OnEducationChanging(value);
					this.SendPropertyChanging();
					this._Education = value;
					this.SendPropertyChanged("Education");
					this.OnEducationChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Occupation", DbType="NVarChar(100)")]
		public string Occupation
		{
			get
			{
				return this._Occupation;
			}
			set
			{
				if ((this._Occupation != value))
				{
					this.OnOccupationChanging(value);
					this.SendPropertyChanging();
					this._Occupation = value;
					this.SendPropertyChanged("Occupation");
					this.OnOccupationChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HouseOwnerFlag", DbType="NChar(1)")]
		public System.Nullable<char> HouseOwnerFlag
		{
			get
			{
				return this._HouseOwnerFlag;
			}
			set
			{
				if ((this._HouseOwnerFlag != value))
				{
					this.OnHouseOwnerFlagChanging(value);
					this.SendPropertyChanging();
					this._HouseOwnerFlag = value;
					this.SendPropertyChanged("HouseOwnerFlag");
					this.OnHouseOwnerFlagChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumberCarsOwned", DbType="TinyInt")]
		public System.Nullable<byte> NumberCarsOwned
		{
			get
			{
				return this._NumberCarsOwned;
			}
			set
			{
				if ((this._NumberCarsOwned != value))
				{
					this.OnNumberCarsOwnedChanging(value);
					this.SendPropertyChanging();
					this._NumberCarsOwned = value;
					this.SendPropertyChanged("NumberCarsOwned");
					this.OnNumberCarsOwnedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Phone", DbType="NVarChar(20)")]
		public string Phone
		{
			get
			{
				return this._Phone;
			}
			set
			{
				if ((this._Phone != value))
				{
					this.OnPhoneChanging(value);
					this.SendPropertyChanging();
					this._Phone = value;
					this.SendPropertyChanged("Phone");
					this.OnPhoneChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CommuteDistance", DbType="NVarChar(15)")]
		public string CommuteDistance
		{
			get
			{
				return this._CommuteDistance;
			}
			set
			{
				if ((this._CommuteDistance != value))
				{
					this.OnCommuteDistanceChanging(value);
					this.SendPropertyChanging();
					this._CommuteDistance = value;
					this.SendPropertyChanged("CommuteDistance");
					this.OnCommuteDistanceChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Region", DbType="NVarChar(50)")]
		public string Region
		{
			get
			{
				return this._Region;
			}
			set
			{
				if ((this._Region != value))
				{
					this.OnRegionChanging(value);
					this.SendPropertyChanging();
					this._Region = value;
					this.SendPropertyChanged("Region");
					this.OnRegionChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Age", DbType="Int")]
		public System.Nullable<int> Age
		{
			get
			{
				return this._Age;
			}
			set
			{
				if ((this._Age != value))
				{
					this.OnAgeChanging(value);
					this.SendPropertyChanging();
					this._Age = value;
					this.SendPropertyChanged("Age");
					this.OnAgeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Profitability", DbType="Money")]
		public System.Nullable<decimal> Profitability
		{
			get
			{
				return this._Profitability;
			}
			set
			{
				if ((this._Profitability != value))
				{
					this.OnProfitabilityChanging(value);
					this.SendPropertyChanging();
					this._Profitability = value;
					this.SendPropertyChanged("Profitability");
					this.OnProfitabilityChanged();
				}
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
#pragma warning restore 1591
