PageRenderTime 54ms CodeModel.GetById 3ms app.highlight 44ms RepoModel.GetById 1ms app.codeStats 0ms

/geoCRM/geoCRM_Services/Source/Resource Access/geoCRM_Services.DataAccess/ContactDB.designer.cs

http://geoCRM.codeplex.com
C# | 1470 lines | 1304 code | 157 blank | 9 comment | 128 complexity | f15fb7fd3437c5fb5ef658f61786523b MD5 | raw file
   1#pragma warning disable 1591
   2//------------------------------------------------------------------------------
   3// <auto-generated>
   4//     This code was generated by a tool.
   5//     Runtime Version:2.0.50727.1434
   6//
   7//     Changes to this file may cause incorrect behavior and will be lost if
   8//     the code is regenerated.
   9// </auto-generated>
  10//------------------------------------------------------------------------------
  11
  12namespace geoCRM_Services.DataAccess
  13{
  14	using System.Data.Linq;
  15	using System.Data.Linq.Mapping;
  16	using System.Data;
  17	using System.Collections.Generic;
  18	using System.Reflection;
  19	using System.Linq;
  20	using System.Linq.Expressions;
  21	
  22	
  23	[System.Data.Linq.Mapping.DatabaseAttribute(Name="geoCRM")]
  24	public partial class ContactDBDataContext : System.Data.Linq.DataContext
  25	{
  26		
  27		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
  28		
  29    #region Extensibility Method Definitions
  30    partial void OnCreated();
  31    partial void InsertAddress(geoCRM_Services.BusinessEntities.Address instance);
  32    partial void UpdateAddress(geoCRM_Services.BusinessEntities.Address instance);
  33    partial void DeleteAddress(geoCRM_Services.BusinessEntities.Address instance);
  34    partial void InsertPhone(geoCRM_Services.BusinessEntities.Phone instance);
  35    partial void UpdatePhone(geoCRM_Services.BusinessEntities.Phone instance);
  36    partial void DeletePhone(geoCRM_Services.BusinessEntities.Phone instance);
  37    partial void InsertContact(geoCRM_Services.BusinessEntities.Contact instance);
  38    partial void UpdateContact(geoCRM_Services.BusinessEntities.Contact instance);
  39    partial void DeleteContact(geoCRM_Services.BusinessEntities.Contact instance);
  40    partial void InsertContact_Address(geoCRM_Services.BusinessEntities.Contact_Address instance);
  41    partial void UpdateContact_Address(geoCRM_Services.BusinessEntities.Contact_Address instance);
  42    partial void DeleteContact_Address(geoCRM_Services.BusinessEntities.Contact_Address instance);
  43    partial void InsertContact_Phone(geoCRM_Services.BusinessEntities.Contact_Phone instance);
  44    partial void UpdateContact_Phone(geoCRM_Services.BusinessEntities.Contact_Phone instance);
  45    partial void DeleteContact_Phone(geoCRM_Services.BusinessEntities.Contact_Phone instance);
  46    partial void InsertLookup(geoCRM_Services.BusinessEntities.Lookup instance);
  47    partial void UpdateLookup(geoCRM_Services.BusinessEntities.Lookup instance);
  48    partial void DeleteLookup(geoCRM_Services.BusinessEntities.Lookup instance);
  49    #endregion
  50		
  51		public ContactDBDataContext() : 
  52				base(global::geoCRM_Services.DataAccess.Properties.Settings.Default.geoCRMConnectionString, mappingSource)
  53		{
  54			OnCreated();
  55		}
  56		
  57		public ContactDBDataContext(string connection) : 
  58				base(connection, mappingSource)
  59		{
  60			OnCreated();
  61		}
  62		
  63		public ContactDBDataContext(System.Data.IDbConnection connection) : 
  64				base(connection, mappingSource)
  65		{
  66			OnCreated();
  67		}
  68		
  69		public ContactDBDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
  70				base(connection, mappingSource)
  71		{
  72			OnCreated();
  73		}
  74		
  75		public ContactDBDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
  76				base(connection, mappingSource)
  77		{
  78			OnCreated();
  79		}
  80		
  81		public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Address> Addresses
  82		{
  83			get
  84			{
  85				return this.GetTable<geoCRM_Services.BusinessEntities.Address>();
  86			}
  87		}
  88		
  89		public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Phone> Phones
  90		{
  91			get
  92			{
  93				return this.GetTable<geoCRM_Services.BusinessEntities.Phone>();
  94			}
  95		}
  96		
  97		public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Contact> Contacts
  98		{
  99			get
 100			{
 101				return this.GetTable<geoCRM_Services.BusinessEntities.Contact>();
 102			}
 103		}
 104		
 105		public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Contact_Address> Contact_Addresses
 106		{
 107			get
 108			{
 109				return this.GetTable<geoCRM_Services.BusinessEntities.Contact_Address>();
 110			}
 111		}
 112		
 113		public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Contact_Phone> Contact_Phones
 114		{
 115			get
 116			{
 117				return this.GetTable<geoCRM_Services.BusinessEntities.Contact_Phone>();
 118			}
 119		}
 120		
 121		public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Lookup> Lookups
 122		{
 123			get
 124			{
 125				return this.GetTable<geoCRM_Services.BusinessEntities.Lookup>();
 126			}
 127		}
 128	}
 129}
 130namespace geoCRM_Services.BusinessEntities
 131{
 132	using System.Data.Linq;
 133	using System.Data.Linq.Mapping;
 134	using System.ComponentModel;
 135	using System;
 136	
 137	
 138	[Table(Name="dbo.Address")]
 139	public partial class Address : INotifyPropertyChanging, INotifyPropertyChanged
 140	{
 141		
 142		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
 143		
 144		private int _ID;
 145		
 146		private string _Street;
 147		
 148		private string _City;
 149		
 150		private string _State;
 151		
 152		private string _PostalCode;
 153		
 154		private string _Country;
 155		
 156		private System.Nullable<double> _Latitude;
 157		
 158		private System.Nullable<double> _Longitude;
 159		
 160		private System.Nullable<System.DateTime> _TimeStamp;
 161		
 162    #region Extensibility Method Definitions
 163    partial void OnLoaded();
 164    partial void OnValidate(System.Data.Linq.ChangeAction action);
 165    partial void OnCreated();
 166    partial void OnIDChanging(int value);
 167    partial void OnIDChanged();
 168    partial void OnStreetChanging(string value);
 169    partial void OnStreetChanged();
 170    partial void OnCityChanging(string value);
 171    partial void OnCityChanged();
 172    partial void OnStateChanging(string value);
 173    partial void OnStateChanged();
 174    partial void OnPostalCodeChanging(string value);
 175    partial void OnPostalCodeChanged();
 176    partial void OnCountryChanging(string value);
 177    partial void OnCountryChanged();
 178    partial void OnLatitudeChanging(System.Nullable<double> value);
 179    partial void OnLatitudeChanged();
 180    partial void OnLongitudeChanging(System.Nullable<double> value);
 181    partial void OnLongitudeChanged();
 182    partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
 183    partial void OnTimeStampChanged();
 184    #endregion
 185		
 186		public Address()
 187		{
 188			OnCreated();
 189		}
 190		
 191		[Column(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
 192		public int ID
 193		{
 194			get
 195			{
 196				return this._ID;
 197			}
 198			set
 199			{
 200				if ((this._ID != value))
 201				{
 202					this.OnIDChanging(value);
 203					this.SendPropertyChanging();
 204					this._ID = value;
 205					this.SendPropertyChanged("ID");
 206					this.OnIDChanged();
 207				}
 208			}
 209		}
 210		
 211		[Column(Storage="_Street", DbType="VarChar(255)")]
 212		public string Street
 213		{
 214			get
 215			{
 216				return this._Street;
 217			}
 218			set
 219			{
 220				if ((this._Street != value))
 221				{
 222					this.OnStreetChanging(value);
 223					this.SendPropertyChanging();
 224					this._Street = value;
 225					this.SendPropertyChanged("Street");
 226					this.OnStreetChanged();
 227				}
 228			}
 229		}
 230		
 231		[Column(Storage="_City", DbType="VarChar(128) NOT NULL", CanBeNull=false)]
 232		public string City
 233		{
 234			get
 235			{
 236				return this._City;
 237			}
 238			set
 239			{
 240				if ((this._City != value))
 241				{
 242					this.OnCityChanging(value);
 243					this.SendPropertyChanging();
 244					this._City = value;
 245					this.SendPropertyChanged("City");
 246					this.OnCityChanged();
 247				}
 248			}
 249		}
 250		
 251		[Column(Storage="_State", DbType="VarChar(128)")]
 252		public string State
 253		{
 254			get
 255			{
 256				return this._State;
 257			}
 258			set
 259			{
 260				if ((this._State != value))
 261				{
 262					this.OnStateChanging(value);
 263					this.SendPropertyChanging();
 264					this._State = value;
 265					this.SendPropertyChanged("State");
 266					this.OnStateChanged();
 267				}
 268			}
 269		}
 270		
 271		[Column(Storage="_PostalCode", DbType="VarChar(50)")]
 272		public string PostalCode
 273		{
 274			get
 275			{
 276				return this._PostalCode;
 277			}
 278			set
 279			{
 280				if ((this._PostalCode != value))
 281				{
 282					this.OnPostalCodeChanging(value);
 283					this.SendPropertyChanging();
 284					this._PostalCode = value;
 285					this.SendPropertyChanged("PostalCode");
 286					this.OnPostalCodeChanged();
 287				}
 288			}
 289		}
 290		
 291		[Column(Storage="_Country", DbType="VarChar(50)")]
 292		public string Country
 293		{
 294			get
 295			{
 296				return this._Country;
 297			}
 298			set
 299			{
 300				if ((this._Country != value))
 301				{
 302					this.OnCountryChanging(value);
 303					this.SendPropertyChanging();
 304					this._Country = value;
 305					this.SendPropertyChanged("Country");
 306					this.OnCountryChanged();
 307				}
 308			}
 309		}
 310		
 311		[Column(Storage="_Latitude", DbType="Float")]
 312		public System.Nullable<double> Latitude
 313		{
 314			get
 315			{
 316				return this._Latitude;
 317			}
 318			set
 319			{
 320				if ((this._Latitude != value))
 321				{
 322					this.OnLatitudeChanging(value);
 323					this.SendPropertyChanging();
 324					this._Latitude = value;
 325					this.SendPropertyChanged("Latitude");
 326					this.OnLatitudeChanged();
 327				}
 328			}
 329		}
 330		
 331		[Column(Storage="_Longitude", DbType="Float")]
 332		public System.Nullable<double> Longitude
 333		{
 334			get
 335			{
 336				return this._Longitude;
 337			}
 338			set
 339			{
 340				if ((this._Longitude != value))
 341				{
 342					this.OnLongitudeChanging(value);
 343					this.SendPropertyChanging();
 344					this._Longitude = value;
 345					this.SendPropertyChanged("Longitude");
 346					this.OnLongitudeChanged();
 347				}
 348			}
 349		}
 350		
 351		[Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
 352		public System.Nullable<System.DateTime> TimeStamp
 353		{
 354			get
 355			{
 356				return this._TimeStamp;
 357			}
 358			set
 359			{
 360				if ((this._TimeStamp != value))
 361				{
 362					this.OnTimeStampChanging(value);
 363					this.SendPropertyChanging();
 364					this._TimeStamp = value;
 365					this.SendPropertyChanged("TimeStamp");
 366					this.OnTimeStampChanged();
 367				}
 368			}
 369		}
 370		
 371		public event PropertyChangingEventHandler PropertyChanging;
 372		
 373		public event PropertyChangedEventHandler PropertyChanged;
 374		
 375		protected virtual void SendPropertyChanging()
 376		{
 377			if ((this.PropertyChanging != null))
 378			{
 379				this.PropertyChanging(this, emptyChangingEventArgs);
 380			}
 381		}
 382		
 383		protected virtual void SendPropertyChanged(String propertyName)
 384		{
 385			if ((this.PropertyChanged != null))
 386			{
 387				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
 388			}
 389		}
 390	}
 391	
 392	[Table(Name="dbo.Phone")]
 393	public partial class Phone : INotifyPropertyChanging, INotifyPropertyChanged
 394	{
 395		
 396		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
 397		
 398		private int _ID;
 399		
 400		private string _CountryCode;
 401		
 402		private string _RegionCode;
 403		
 404		private string _Number;
 405		
 406		private System.Nullable<System.DateTime> _TimeStamp;
 407		
 408    #region Extensibility Method Definitions
 409    partial void OnLoaded();
 410    partial void OnValidate(System.Data.Linq.ChangeAction action);
 411    partial void OnCreated();
 412    partial void OnIDChanging(int value);
 413    partial void OnIDChanged();
 414    partial void OnCountryCodeChanging(string value);
 415    partial void OnCountryCodeChanged();
 416    partial void OnRegionCodeChanging(string value);
 417    partial void OnRegionCodeChanged();
 418    partial void OnNumberChanging(string value);
 419    partial void OnNumberChanged();
 420    partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
 421    partial void OnTimeStampChanged();
 422    #endregion
 423		
 424		public Phone()
 425		{
 426			OnCreated();
 427		}
 428		
 429		[Column(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
 430		public int ID
 431		{
 432			get
 433			{
 434				return this._ID;
 435			}
 436			set
 437			{
 438				if ((this._ID != value))
 439				{
 440					this.OnIDChanging(value);
 441					this.SendPropertyChanging();
 442					this._ID = value;
 443					this.SendPropertyChanged("ID");
 444					this.OnIDChanged();
 445				}
 446			}
 447		}
 448		
 449		[Column(Storage="_CountryCode", DbType="VarChar(50)")]
 450		public string CountryCode
 451		{
 452			get
 453			{
 454				return this._CountryCode;
 455			}
 456			set
 457			{
 458				if ((this._CountryCode != value))
 459				{
 460					this.OnCountryCodeChanging(value);
 461					this.SendPropertyChanging();
 462					this._CountryCode = value;
 463					this.SendPropertyChanged("CountryCode");
 464					this.OnCountryCodeChanged();
 465				}
 466			}
 467		}
 468		
 469		[Column(Storage="_RegionCode", DbType="VarChar(10)")]
 470		public string RegionCode
 471		{
 472			get
 473			{
 474				return this._RegionCode;
 475			}
 476			set
 477			{
 478				if ((this._RegionCode != value))
 479				{
 480					this.OnRegionCodeChanging(value);
 481					this.SendPropertyChanging();
 482					this._RegionCode = value;
 483					this.SendPropertyChanged("RegionCode");
 484					this.OnRegionCodeChanged();
 485				}
 486			}
 487		}
 488		
 489		[Column(Storage="_Number", DbType="VarChar(50)")]
 490		public string Number
 491		{
 492			get
 493			{
 494				return this._Number;
 495			}
 496			set
 497			{
 498				if ((this._Number != value))
 499				{
 500					this.OnNumberChanging(value);
 501					this.SendPropertyChanging();
 502					this._Number = value;
 503					this.SendPropertyChanged("Number");
 504					this.OnNumberChanged();
 505				}
 506			}
 507		}
 508		
 509		[Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
 510		public System.Nullable<System.DateTime> TimeStamp
 511		{
 512			get
 513			{
 514				return this._TimeStamp;
 515			}
 516			set
 517			{
 518				if ((this._TimeStamp != value))
 519				{
 520					this.OnTimeStampChanging(value);
 521					this.SendPropertyChanging();
 522					this._TimeStamp = value;
 523					this.SendPropertyChanged("TimeStamp");
 524					this.OnTimeStampChanged();
 525				}
 526			}
 527		}
 528		
 529		public event PropertyChangingEventHandler PropertyChanging;
 530		
 531		public event PropertyChangedEventHandler PropertyChanged;
 532		
 533		protected virtual void SendPropertyChanging()
 534		{
 535			if ((this.PropertyChanging != null))
 536			{
 537				this.PropertyChanging(this, emptyChangingEventArgs);
 538			}
 539		}
 540		
 541		protected virtual void SendPropertyChanged(String propertyName)
 542		{
 543			if ((this.PropertyChanged != null))
 544			{
 545				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
 546			}
 547		}
 548	}
 549	
 550	[Table(Name="dbo.Contact")]
 551	public partial class Contact : INotifyPropertyChanging, INotifyPropertyChanged
 552	{
 553		
 554		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
 555		
 556		private int _ID;
 557		
 558		private System.Nullable<int> _Title_LID;
 559		
 560		private System.Nullable<int> _Type_LID;
 561		
 562		private string _Firstname;
 563		
 564		private string _Lastname;
 565		
 566		private System.Nullable<System.DateTime> _TimeStamp;
 567		
 568		private EntitySet<Contact_Address> _Contact_Addresses;
 569		
 570		private EntitySet<Contact_Phone> _Contact_Phones;
 571		
 572		private EntityRef<Lookup> _Lookup;
 573		
 574		private EntityRef<Lookup> _Lookup1;
 575		
 576    #region Extensibility Method Definitions
 577    partial void OnLoaded();
 578    partial void OnValidate(System.Data.Linq.ChangeAction action);
 579    partial void OnCreated();
 580    partial void OnIDChanging(int value);
 581    partial void OnIDChanged();
 582    partial void OnTitle_LIDChanging(System.Nullable<int> value);
 583    partial void OnTitle_LIDChanged();
 584    partial void OnType_LIDChanging(System.Nullable<int> value);
 585    partial void OnType_LIDChanged();
 586    partial void OnFirstnameChanging(string value);
 587    partial void OnFirstnameChanged();
 588    partial void OnLastnameChanging(string value);
 589    partial void OnLastnameChanged();
 590    partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
 591    partial void OnTimeStampChanged();
 592    #endregion
 593		
 594		public Contact()
 595		{
 596			this._Contact_Addresses = new EntitySet<Contact_Address>(new Action<Contact_Address>(this.attach_Contact_Addresses), new Action<Contact_Address>(this.detach_Contact_Addresses));
 597			this._Contact_Phones = new EntitySet<Contact_Phone>(new Action<Contact_Phone>(this.attach_Contact_Phones), new Action<Contact_Phone>(this.detach_Contact_Phones));
 598			this._Lookup = default(EntityRef<Lookup>);
 599			this._Lookup1 = default(EntityRef<Lookup>);
 600			OnCreated();
 601		}
 602		
 603		[Column(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
 604		public int ID
 605		{
 606			get
 607			{
 608				return this._ID;
 609			}
 610			set
 611			{
 612				if ((this._ID != value))
 613				{
 614					this.OnIDChanging(value);
 615					this.SendPropertyChanging();
 616					this._ID = value;
 617					this.SendPropertyChanged("ID");
 618					this.OnIDChanged();
 619				}
 620			}
 621		}
 622		
 623		[Column(Storage="_Title_LID", DbType="Int")]
 624		internal System.Nullable<int> Title_LID
 625		{
 626			get
 627			{
 628				return this._Title_LID;
 629			}
 630			set
 631			{
 632				if ((this._Title_LID != value))
 633				{
 634					if (this._Lookup.HasLoadedOrAssignedValue)
 635					{
 636						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
 637					}
 638					this.OnTitle_LIDChanging(value);
 639					this.SendPropertyChanging();
 640					this._Title_LID = value;
 641					this.SendPropertyChanged("Title_LID");
 642					this.OnTitle_LIDChanged();
 643				}
 644			}
 645		}
 646		
 647		[Column(Storage="_Type_LID", DbType="Int")]
 648		internal System.Nullable<int> Type_LID
 649		{
 650			get
 651			{
 652				return this._Type_LID;
 653			}
 654			set
 655			{
 656				if ((this._Type_LID != value))
 657				{
 658					if (this._Lookup1.HasLoadedOrAssignedValue)
 659					{
 660						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
 661					}
 662					this.OnType_LIDChanging(value);
 663					this.SendPropertyChanging();
 664					this._Type_LID = value;
 665					this.SendPropertyChanged("Type_LID");
 666					this.OnType_LIDChanged();
 667				}
 668			}
 669		}
 670		
 671		[Column(Storage="_Firstname", DbType="VarChar(128)")]
 672		public string Firstname
 673		{
 674			get
 675			{
 676				return this._Firstname;
 677			}
 678			set
 679			{
 680				if ((this._Firstname != value))
 681				{
 682					this.OnFirstnameChanging(value);
 683					this.SendPropertyChanging();
 684					this._Firstname = value;
 685					this.SendPropertyChanged("Firstname");
 686					this.OnFirstnameChanged();
 687				}
 688			}
 689		}
 690		
 691		[Column(Storage="_Lastname", DbType="VarChar(128)")]
 692		public string Lastname
 693		{
 694			get
 695			{
 696				return this._Lastname;
 697			}
 698			set
 699			{
 700				if ((this._Lastname != value))
 701				{
 702					this.OnLastnameChanging(value);
 703					this.SendPropertyChanging();
 704					this._Lastname = value;
 705					this.SendPropertyChanged("Lastname");
 706					this.OnLastnameChanged();
 707				}
 708			}
 709		}
 710		
 711		[Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
 712		public System.Nullable<System.DateTime> TimeStamp
 713		{
 714			get
 715			{
 716				return this._TimeStamp;
 717			}
 718			set
 719			{
 720				if ((this._TimeStamp != value))
 721				{
 722					this.OnTimeStampChanging(value);
 723					this.SendPropertyChanging();
 724					this._TimeStamp = value;
 725					this.SendPropertyChanged("TimeStamp");
 726					this.OnTimeStampChanged();
 727				}
 728			}
 729		}
 730		
 731		[Association(Name="Contact_Contact_Address", Storage="_Contact_Addresses", OtherKey="Contact_ID")]
 732		public EntitySet<Contact_Address> Contact_Addresses
 733		{
 734			get
 735			{
 736				return this._Contact_Addresses;
 737			}
 738			set
 739			{
 740				this._Contact_Addresses.Assign(value);
 741			}
 742		}
 743		
 744		[Association(Name="Contact_Contact_Phone", Storage="_Contact_Phones", OtherKey="Contact_ID")]
 745		public EntitySet<Contact_Phone> Contact_Phones
 746		{
 747			get
 748			{
 749				return this._Contact_Phones;
 750			}
 751			set
 752			{
 753				this._Contact_Phones.Assign(value);
 754			}
 755		}
 756		
 757		[Association(Name="Lookup_Contact", Storage="_Lookup", ThisKey="Title_LID", IsForeignKey=true)]
 758		public Lookup TitleType
 759		{
 760			get
 761			{
 762				return this._Lookup.Entity;
 763			}
 764			set
 765			{
 766				if ((this._Lookup.Entity != value))
 767				{
 768					this.SendPropertyChanging();
 769					this._Lookup.Entity = value;
 770					this.SendPropertyChanged("TitleType");
 771				}
 772			}
 773		}
 774		
 775		[Association(Name="Lookup_Contact1", Storage="_Lookup1", ThisKey="Type_LID", IsForeignKey=true)]
 776		public Lookup ContactType
 777		{
 778			get
 779			{
 780				return this._Lookup1.Entity;
 781			}
 782			set
 783			{
 784				if ((this._Lookup1.Entity != value))
 785				{
 786					this.SendPropertyChanging();
 787					this._Lookup1.Entity = value;
 788					this.SendPropertyChanged("ContactType");
 789				}
 790			}
 791		}
 792		
 793		public event PropertyChangingEventHandler PropertyChanging;
 794		
 795		public event PropertyChangedEventHandler PropertyChanged;
 796		
 797		protected virtual void SendPropertyChanging()
 798		{
 799			if ((this.PropertyChanging != null))
 800			{
 801				this.PropertyChanging(this, emptyChangingEventArgs);
 802			}
 803		}
 804		
 805		protected virtual void SendPropertyChanged(String propertyName)
 806		{
 807			if ((this.PropertyChanged != null))
 808			{
 809				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
 810			}
 811		}
 812		
 813		private void attach_Contact_Addresses(Contact_Address entity)
 814		{
 815			this.SendPropertyChanging();
 816			entity.Contact = this;
 817		}
 818		
 819		private void detach_Contact_Addresses(Contact_Address entity)
 820		{
 821			this.SendPropertyChanging();
 822			entity.Contact = null;
 823		}
 824		
 825		private void attach_Contact_Phones(Contact_Phone entity)
 826		{
 827			this.SendPropertyChanging();
 828			entity.Contact = this;
 829		}
 830		
 831		private void detach_Contact_Phones(Contact_Phone entity)
 832		{
 833			this.SendPropertyChanging();
 834			entity.Contact = null;
 835		}
 836	}
 837	
 838	[Table(Name="dbo.Contact_Addresses")]
 839	public partial class Contact_Address : INotifyPropertyChanging, INotifyPropertyChanged
 840	{
 841		
 842		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
 843		
 844		private int _Contact_ID;
 845		
 846		private int _Address_ID;
 847		
 848		private int _Type_LID;
 849		
 850		private System.Nullable<System.DateTime> _TimeStamp;
 851		
 852		private EntityRef<Address> _Address;
 853		
 854		private EntityRef<Contact> _Contact;
 855		
 856		private EntityRef<Lookup> _Lookup;
 857		
 858    #region Extensibility Method Definitions
 859    partial void OnLoaded();
 860    partial void OnValidate(System.Data.Linq.ChangeAction action);
 861    partial void OnCreated();
 862    partial void OnContact_IDChanging(int value);
 863    partial void OnContact_IDChanged();
 864    partial void OnAddress_IDChanging(int value);
 865    partial void OnAddress_IDChanged();
 866    partial void OnType_LIDChanging(int value);
 867    partial void OnType_LIDChanged();
 868    partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
 869    partial void OnTimeStampChanged();
 870    #endregion
 871		
 872		public Contact_Address()
 873		{
 874			this._Address = default(EntityRef<Address>);
 875			this._Contact = default(EntityRef<Contact>);
 876			this._Lookup = default(EntityRef<Lookup>);
 877			OnCreated();
 878		}
 879		
 880		[Column(Storage="_Contact_ID", DbType="Int NOT NULL", IsPrimaryKey=true)]
 881		public int Contact_ID
 882		{
 883			get
 884			{
 885				return this._Contact_ID;
 886			}
 887			set
 888			{
 889				if ((this._Contact_ID != value))
 890				{
 891					if (this._Contact.HasLoadedOrAssignedValue)
 892					{
 893						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
 894					}
 895					this.OnContact_IDChanging(value);
 896					this.SendPropertyChanging();
 897					this._Contact_ID = value;
 898					this.SendPropertyChanged("Contact_ID");
 899					this.OnContact_IDChanged();
 900				}
 901			}
 902		}
 903		
 904		[Column(Storage="_Address_ID", DbType="Int NOT NULL", IsPrimaryKey=true)]
 905		public int Address_ID
 906		{
 907			get
 908			{
 909				return this._Address_ID;
 910			}
 911			set
 912			{
 913				if ((this._Address_ID != value))
 914				{
 915					if (this._Address.HasLoadedOrAssignedValue)
 916					{
 917						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
 918					}
 919					this.OnAddress_IDChanging(value);
 920					this.SendPropertyChanging();
 921					this._Address_ID = value;
 922					this.SendPropertyChanged("Address_ID");
 923					this.OnAddress_IDChanged();
 924				}
 925			}
 926		}
 927		
 928		[Column(Storage="_Type_LID", DbType="Int NOT NULL")]
 929		internal int Type_LID
 930		{
 931			get
 932			{
 933				return this._Type_LID;
 934			}
 935			set
 936			{
 937				if ((this._Type_LID != value))
 938				{
 939					if (this._Lookup.HasLoadedOrAssignedValue)
 940					{
 941						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
 942					}
 943					this.OnType_LIDChanging(value);
 944					this.SendPropertyChanging();
 945					this._Type_LID = value;
 946					this.SendPropertyChanged("Type_LID");
 947					this.OnType_LIDChanged();
 948				}
 949			}
 950		}
 951		
 952		[Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
 953		public System.Nullable<System.DateTime> TimeStamp
 954		{
 955			get
 956			{
 957				return this._TimeStamp;
 958			}
 959			set
 960			{
 961				if ((this._TimeStamp != value))
 962				{
 963					this.OnTimeStampChanging(value);
 964					this.SendPropertyChanging();
 965					this._TimeStamp = value;
 966					this.SendPropertyChanged("TimeStamp");
 967					this.OnTimeStampChanged();
 968				}
 969			}
 970		}
 971		
 972		[Association(Name="Address_Contact_Address", Storage="_Address", ThisKey="Address_ID", IsForeignKey=true)]
 973		public Address Address
 974		{
 975			get
 976			{
 977				return this._Address.Entity;
 978			}
 979			set
 980			{
 981				if ((this._Address.Entity != value))
 982				{
 983					this.SendPropertyChanging();
 984					this._Address.Entity = value;
 985					this.SendPropertyChanged("Address");
 986				}
 987			}
 988		}
 989		
 990		[Association(Name="Contact_Contact_Address", Storage="_Contact", ThisKey="Contact_ID", IsForeignKey=true)]
 991		internal Contact Contact
 992		{
 993			get
 994			{
 995				return this._Contact.Entity;
 996			}
 997			set
 998			{
 999				Contact previousValue = this._Contact.Entity;
1000				if (((previousValue != value) 
1001							|| (this._Contact.HasLoadedOrAssignedValue == false)))
1002				{
1003					this.SendPropertyChanging();
1004					if ((previousValue != null))
1005					{
1006						this._Contact.Entity = null;
1007						previousValue.Contact_Addresses.Remove(this);
1008					}
1009					this._Contact.Entity = value;
1010					if ((value != null))
1011					{
1012						value.Contact_Addresses.Add(this);
1013						this._Contact_ID = value.ID;
1014					}
1015					else
1016					{
1017						this._Contact_ID = default(int);
1018					}
1019					this.SendPropertyChanged("Contact");
1020				}
1021			}
1022		}
1023		
1024		[Association(Name="Lookup_Contact_Address", Storage="_Lookup", ThisKey="Type_LID", IsForeignKey=true)]
1025		public Lookup ContactAddressType
1026		{
1027			get
1028			{
1029				return this._Lookup.Entity;
1030			}
1031			set
1032			{
1033				if ((this._Lookup.Entity != value))
1034				{
1035					this.SendPropertyChanging();
1036					this._Lookup.Entity = value;
1037					this.SendPropertyChanged("ContactAddressType");
1038				}
1039			}
1040		}
1041		
1042		public event PropertyChangingEventHandler PropertyChanging;
1043		
1044		public event PropertyChangedEventHandler PropertyChanged;
1045		
1046		protected virtual void SendPropertyChanging()
1047		{
1048			if ((this.PropertyChanging != null))
1049			{
1050				this.PropertyChanging(this, emptyChangingEventArgs);
1051			}
1052		}
1053		
1054		protected virtual void SendPropertyChanged(String propertyName)
1055		{
1056			if ((this.PropertyChanged != null))
1057			{
1058				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1059			}
1060		}
1061	}
1062	
1063	[Table(Name="dbo.Contact_Phones")]
1064	public partial class Contact_Phone : INotifyPropertyChanging, INotifyPropertyChanged
1065	{
1066		
1067		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1068		
1069		private int _Contact_ID;
1070		
1071		private int _Phone_ID;
1072		
1073		private System.Nullable<int> _Type_LID;
1074		
1075		private System.Nullable<System.DateTime> _TimeStamp;
1076		
1077		private EntityRef<Contact> _Contact;
1078		
1079		private EntityRef<Phone> _Phone;
1080		
1081		private EntityRef<Lookup> _Lookup;
1082		
1083    #region Extensibility Method Definitions
1084    partial void OnLoaded();
1085    partial void OnValidate(System.Data.Linq.ChangeAction action);
1086    partial void OnCreated();
1087    partial void OnContact_IDChanging(int value);
1088    partial void OnContact_IDChanged();
1089    partial void OnPhone_IDChanging(int value);
1090    partial void OnPhone_IDChanged();
1091    partial void OnType_LIDChanging(System.Nullable<int> value);
1092    partial void OnType_LIDChanged();
1093    partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
1094    partial void OnTimeStampChanged();
1095    #endregion
1096		
1097		public Contact_Phone()
1098		{
1099			this._Contact = default(EntityRef<Contact>);
1100			this._Phone = default(EntityRef<Phone>);
1101			this._Lookup = default(EntityRef<Lookup>);
1102			OnCreated();
1103		}
1104		
1105		[Column(Storage="_Contact_ID", DbType="Int NOT NULL", IsPrimaryKey=true)]
1106		public int Contact_ID
1107		{
1108			get
1109			{
1110				return this._Contact_ID;
1111			}
1112			set
1113			{
1114				if ((this._Contact_ID != value))
1115				{
1116					if (this._Contact.HasLoadedOrAssignedValue)
1117					{
1118						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1119					}
1120					this.OnContact_IDChanging(value);
1121					this.SendPropertyChanging();
1122					this._Contact_ID = value;
1123					this.SendPropertyChanged("Contact_ID");
1124					this.OnContact_IDChanged();
1125				}
1126			}
1127		}
1128		
1129		[Column(Storage="_Phone_ID", DbType="Int NOT NULL", IsPrimaryKey=true)]
1130		public int Phone_ID
1131		{
1132			get
1133			{
1134				return this._Phone_ID;
1135			}
1136			set
1137			{
1138				if ((this._Phone_ID != value))
1139				{
1140					if (this._Phone.HasLoadedOrAssignedValue)
1141					{
1142						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1143					}
1144					this.OnPhone_IDChanging(value);
1145					this.SendPropertyChanging();
1146					this._Phone_ID = value;
1147					this.SendPropertyChanged("Phone_ID");
1148					this.OnPhone_IDChanged();
1149				}
1150			}
1151		}
1152		
1153		[Column(Storage="_Type_LID", DbType="Int")]
1154		internal System.Nullable<int> Type_LID
1155		{
1156			get
1157			{
1158				return this._Type_LID;
1159			}
1160			set
1161			{
1162				if ((this._Type_LID != value))
1163				{
1164					if (this._Lookup.HasLoadedOrAssignedValue)
1165					{
1166						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1167					}
1168					this.OnType_LIDChanging(value);
1169					this.SendPropertyChanging();
1170					this._Type_LID = value;
1171					this.SendPropertyChanged("Type_LID");
1172					this.OnType_LIDChanged();
1173				}
1174			}
1175		}
1176		
1177		[Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
1178		public System.Nullable<System.DateTime> TimeStamp
1179		{
1180			get
1181			{
1182				return this._TimeStamp;
1183			}
1184			set
1185			{
1186				if ((this._TimeStamp != value))
1187				{
1188					this.OnTimeStampChanging(value);
1189					this.SendPropertyChanging();
1190					this._TimeStamp = value;
1191					this.SendPropertyChanged("TimeStamp");
1192					this.OnTimeStampChanged();
1193				}
1194			}
1195		}
1196		
1197		[Association(Name="Contact_Contact_Phone", Storage="_Contact", ThisKey="Contact_ID", IsForeignKey=true)]
1198		internal Contact Contact
1199		{
1200			get
1201			{
1202				return this._Contact.Entity;
1203			}
1204			set
1205			{
1206				Contact previousValue = this._Contact.Entity;
1207				if (((previousValue != value) 
1208							|| (this._Contact.HasLoadedOrAssignedValue == false)))
1209				{
1210					this.SendPropertyChanging();
1211					if ((previousValue != null))
1212					{
1213						this._Contact.Entity = null;
1214						previousValue.Contact_Phones.Remove(this);
1215					}
1216					this._Contact.Entity = value;
1217					if ((value != null))
1218					{
1219						value.Contact_Phones.Add(this);
1220						this._Contact_ID = value.ID;
1221					}
1222					else
1223					{
1224						this._Contact_ID = default(int);
1225					}
1226					this.SendPropertyChanged("Contact");
1227				}
1228			}
1229		}
1230		
1231		[Association(Name="Phone_Contact_Phone", Storage="_Phone", ThisKey="Phone_ID", IsForeignKey=true)]
1232		public Phone Phone
1233		{
1234			get
1235			{
1236				return this._Phone.Entity;
1237			}
1238			set
1239			{
1240				if ((this._Phone.Entity != value))
1241				{
1242					this.SendPropertyChanging();
1243					this._Phone.Entity = value;
1244					this.SendPropertyChanged("Phone");
1245				}
1246			}
1247		}
1248		
1249		[Association(Name="Lookup_Contact_Phone", Storage="_Lookup", ThisKey="Type_LID", IsForeignKey=true)]
1250		public Lookup ContactPhoneType
1251		{
1252			get
1253			{
1254				return this._Lookup.Entity;
1255			}
1256			set
1257			{
1258				if ((this._Lookup.Entity != value))
1259				{
1260					this.SendPropertyChanging();
1261					this._Lookup.Entity = value;
1262					this.SendPropertyChanged("ContactPhoneType");
1263				}
1264			}
1265		}
1266		
1267		public event PropertyChangingEventHandler PropertyChanging;
1268		
1269		public event PropertyChangedEventHandler PropertyChanged;
1270		
1271		protected virtual void SendPropertyChanging()
1272		{
1273			if ((this.PropertyChanging != null))
1274			{
1275				this.PropertyChanging(this, emptyChangingEventArgs);
1276			}
1277		}
1278		
1279		protected virtual void SendPropertyChanged(String propertyName)
1280		{
1281			if ((this.PropertyChanged != null))
1282			{
1283				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1284			}
1285		}
1286	}
1287	
1288	[Table(Name="dbo.Lookup")]
1289	public partial class Lookup : INotifyPropertyChanging, INotifyPropertyChanged
1290	{
1291		
1292		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1293		
1294		private int _ID;
1295		
1296		private string _Type;
1297		
1298		private string _Value;
1299		
1300		private string _Text;
1301		
1302		private int _DisplayOrder;
1303		
1304		private System.Nullable<System.DateTime> _TimeStamp;
1305		
1306    #region Extensibility Method Definitions
1307    partial void OnLoaded();
1308    partial void OnValidate(System.Data.Linq.ChangeAction action);
1309    partial void OnCreated();
1310    partial void OnIDChanging(int value);
1311    partial void OnIDChanged();
1312    partial void OnTypeChanging(string value);
1313    partial void OnTypeChanged();
1314    partial void OnValueChanging(string value);
1315    partial void OnValueChanged();
1316    partial void OnTextChanging(string value);
1317    partial void OnTextChanged();
1318    partial void OnDisplayOrderChanging(int value);
1319    partial void OnDisplayOrderChanged();
1320    partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
1321    partial void OnTimeStampChanged();
1322    #endregion
1323		
1324		public Lookup()
1325		{
1326			OnCreated();
1327		}
1328		
1329		[Column(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
1330		public int ID
1331		{
1332			get
1333			{
1334				return this._ID;
1335			}
1336			set
1337			{
1338				if ((this._ID != value))
1339				{
1340					this.OnIDChanging(value);
1341					this.SendPropertyChanging();
1342					this._ID = value;
1343					this.SendPropertyChanged("ID");
1344					this.OnIDChanged();
1345				}
1346			}
1347		}
1348		
1349		[Column(Storage="_Type", DbType="VarChar(50)")]
1350		public string Type
1351		{
1352			get
1353			{
1354				return this._Type;
1355			}
1356			set
1357			{
1358				if ((this._Type != value))
1359				{
1360					this.OnTypeChanging(value);
1361					this.SendPropertyChanging();
1362					this._Type = value;
1363					this.SendPropertyChanged("Type");
1364					this.OnTypeChanged();
1365				}
1366			}
1367		}
1368		
1369		[Column(Storage="_Value", DbType="VarChar(50)")]
1370		public string Value
1371		{
1372			get
1373			{
1374				return this._Value;
1375			}
1376			set
1377			{
1378				if ((this._Value != value))
1379				{
1380					this.OnValueChanging(value);
1381					this.SendPropertyChanging();
1382					this._Value = value;
1383					this.SendPropertyChanged("Value");
1384					this.OnValueChanged();
1385				}
1386			}
1387		}
1388		
1389		[Column(Storage="_Text", DbType="VarChar(255)")]
1390		public string Text
1391		{
1392			get
1393			{
1394				return this._Text;
1395			}
1396			set
1397			{
1398				if ((this._Text != value))
1399				{
1400					this.OnTextChanging(value);
1401					this.SendPropertyChanging();
1402					this._Text = value;
1403					this.SendPropertyChanged("Text");
1404					this.OnTextChanged();
1405				}
1406			}
1407		}
1408		
1409		[Column(Storage="_DisplayOrder", DbType="Int NOT NULL")]
1410		public int DisplayOrder
1411		{
1412			get
1413			{
1414				return this._DisplayOrder;
1415			}
1416			set
1417			{
1418				if ((this._DisplayOrder != value))
1419				{
1420					this.OnDisplayOrderChanging(value);
1421					this.SendPropertyChanging();
1422					this._DisplayOrder = value;
1423					this.SendPropertyChanged("DisplayOrder");
1424					this.OnDisplayOrderChanged();
1425				}
1426			}
1427		}
1428		
1429		[Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
1430		public System.Nullable<System.DateTime> TimeStamp
1431		{
1432			get
1433			{
1434				return this._TimeStamp;
1435			}
1436			set
1437			{
1438				if ((this._TimeStamp != value))
1439				{
1440					this.OnTimeStampChanging(value);
1441					this.SendPropertyChanging();
1442					this._TimeStamp = value;
1443					this.SendPropertyChanged("TimeStamp");
1444					this.OnTimeStampChanged();
1445				}
1446			}
1447		}
1448		
1449		public event PropertyChangingEventHandler PropertyChanging;
1450		
1451		public event PropertyChangedEventHandler PropertyChanged;
1452		
1453		protected virtual void SendPropertyChanging()
1454		{
1455			if ((this.PropertyChanging != null))
1456			{
1457				this.PropertyChanging(this, emptyChangingEventArgs);
1458			}
1459		}
1460		
1461		protected virtual void SendPropertyChanged(String propertyName)
1462		{
1463			if ((this.PropertyChanged != null))
1464			{
1465				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1466			}
1467		}
1468	}
1469}
1470#pragma warning restore 1591