/geoCRM/geoCRM_Services/Source/Resource Access/geoCRM_Services.DataAccess/ContactDB.designer.cs
C# | 1470 lines | 1304 code | 157 blank | 9 comment | 128 complexity | f15fb7fd3437c5fb5ef658f61786523b MD5 | raw file
- #pragma warning disable 1591
- //------------------------------------------------------------------------------
- // <auto-generated>
- // This code was generated by a tool.
- // Runtime Version:2.0.50727.1434
- //
- // Changes to this file may cause incorrect behavior and will be lost if
- // the code is regenerated.
- // </auto-generated>
- //------------------------------------------------------------------------------
-
- namespace geoCRM_Services.DataAccess
- {
- 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;
-
-
- [System.Data.Linq.Mapping.DatabaseAttribute(Name="geoCRM")]
- public partial class ContactDBDataContext : System.Data.Linq.DataContext
- {
-
- private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
-
- #region Extensibility Method Definitions
- partial void OnCreated();
- partial void InsertAddress(geoCRM_Services.BusinessEntities.Address instance);
- partial void UpdateAddress(geoCRM_Services.BusinessEntities.Address instance);
- partial void DeleteAddress(geoCRM_Services.BusinessEntities.Address instance);
- partial void InsertPhone(geoCRM_Services.BusinessEntities.Phone instance);
- partial void UpdatePhone(geoCRM_Services.BusinessEntities.Phone instance);
- partial void DeletePhone(geoCRM_Services.BusinessEntities.Phone instance);
- partial void InsertContact(geoCRM_Services.BusinessEntities.Contact instance);
- partial void UpdateContact(geoCRM_Services.BusinessEntities.Contact instance);
- partial void DeleteContact(geoCRM_Services.BusinessEntities.Contact instance);
- partial void InsertContact_Address(geoCRM_Services.BusinessEntities.Contact_Address instance);
- partial void UpdateContact_Address(geoCRM_Services.BusinessEntities.Contact_Address instance);
- partial void DeleteContact_Address(geoCRM_Services.BusinessEntities.Contact_Address instance);
- partial void InsertContact_Phone(geoCRM_Services.BusinessEntities.Contact_Phone instance);
- partial void UpdateContact_Phone(geoCRM_Services.BusinessEntities.Contact_Phone instance);
- partial void DeleteContact_Phone(geoCRM_Services.BusinessEntities.Contact_Phone instance);
- partial void InsertLookup(geoCRM_Services.BusinessEntities.Lookup instance);
- partial void UpdateLookup(geoCRM_Services.BusinessEntities.Lookup instance);
- partial void DeleteLookup(geoCRM_Services.BusinessEntities.Lookup instance);
- #endregion
-
- public ContactDBDataContext() :
- base(global::geoCRM_Services.DataAccess.Properties.Settings.Default.geoCRMConnectionString, mappingSource)
- {
- OnCreated();
- }
-
- public ContactDBDataContext(string connection) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public ContactDBDataContext(System.Data.IDbConnection connection) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public ContactDBDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public ContactDBDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Address> Addresses
- {
- get
- {
- return this.GetTable<geoCRM_Services.BusinessEntities.Address>();
- }
- }
-
- public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Phone> Phones
- {
- get
- {
- return this.GetTable<geoCRM_Services.BusinessEntities.Phone>();
- }
- }
-
- public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Contact> Contacts
- {
- get
- {
- return this.GetTable<geoCRM_Services.BusinessEntities.Contact>();
- }
- }
-
- public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Contact_Address> Contact_Addresses
- {
- get
- {
- return this.GetTable<geoCRM_Services.BusinessEntities.Contact_Address>();
- }
- }
-
- public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Contact_Phone> Contact_Phones
- {
- get
- {
- return this.GetTable<geoCRM_Services.BusinessEntities.Contact_Phone>();
- }
- }
-
- public System.Data.Linq.Table<geoCRM_Services.BusinessEntities.Lookup> Lookups
- {
- get
- {
- return this.GetTable<geoCRM_Services.BusinessEntities.Lookup>();
- }
- }
- }
- }
- namespace geoCRM_Services.BusinessEntities
- {
- using System.Data.Linq;
- using System.Data.Linq.Mapping;
- using System.ComponentModel;
- using System;
-
-
- [Table(Name="dbo.Address")]
- public partial class Address : INotifyPropertyChanging, INotifyPropertyChanged
- {
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _ID;
-
- private string _Street;
-
- private string _City;
-
- private string _State;
-
- private string _PostalCode;
-
- private string _Country;
-
- private System.Nullable<double> _Latitude;
-
- private System.Nullable<double> _Longitude;
-
- private System.Nullable<System.DateTime> _TimeStamp;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnIDChanging(int value);
- partial void OnIDChanged();
- partial void OnStreetChanging(string value);
- partial void OnStreetChanged();
- partial void OnCityChanging(string value);
- partial void OnCityChanged();
- partial void OnStateChanging(string value);
- partial void OnStateChanged();
- partial void OnPostalCodeChanging(string value);
- partial void OnPostalCodeChanged();
- partial void OnCountryChanging(string value);
- partial void OnCountryChanged();
- partial void OnLatitudeChanging(System.Nullable<double> value);
- partial void OnLatitudeChanged();
- partial void OnLongitudeChanging(System.Nullable<double> value);
- partial void OnLongitudeChanged();
- partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
- partial void OnTimeStampChanged();
- #endregion
-
- public Address()
- {
- OnCreated();
- }
-
- [Column(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int ID
- {
- get
- {
- return this._ID;
- }
- set
- {
- if ((this._ID != value))
- {
- this.OnIDChanging(value);
- this.SendPropertyChanging();
- this._ID = value;
- this.SendPropertyChanged("ID");
- this.OnIDChanged();
- }
- }
- }
-
- [Column(Storage="_Street", DbType="VarChar(255)")]
- public string Street
- {
- get
- {
- return this._Street;
- }
- set
- {
- if ((this._Street != value))
- {
- this.OnStreetChanging(value);
- this.SendPropertyChanging();
- this._Street = value;
- this.SendPropertyChanged("Street");
- this.OnStreetChanged();
- }
- }
- }
-
- [Column(Storage="_City", DbType="VarChar(128) NOT NULL", CanBeNull=false)]
- public string City
- {
- get
- {
- return this._City;
- }
- set
- {
- if ((this._City != value))
- {
- this.OnCityChanging(value);
- this.SendPropertyChanging();
- this._City = value;
- this.SendPropertyChanged("City");
- this.OnCityChanged();
- }
- }
- }
-
- [Column(Storage="_State", DbType="VarChar(128)")]
- public string State
- {
- get
- {
- return this._State;
- }
- set
- {
- if ((this._State != value))
- {
- this.OnStateChanging(value);
- this.SendPropertyChanging();
- this._State = value;
- this.SendPropertyChanged("State");
- this.OnStateChanged();
- }
- }
- }
-
- [Column(Storage="_PostalCode", DbType="VarChar(50)")]
- public string PostalCode
- {
- get
- {
- return this._PostalCode;
- }
- set
- {
- if ((this._PostalCode != value))
- {
- this.OnPostalCodeChanging(value);
- this.SendPropertyChanging();
- this._PostalCode = value;
- this.SendPropertyChanged("PostalCode");
- this.OnPostalCodeChanged();
- }
- }
- }
-
- [Column(Storage="_Country", DbType="VarChar(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();
- }
- }
- }
-
- [Column(Storage="_Latitude", DbType="Float")]
- public System.Nullable<double> Latitude
- {
- get
- {
- return this._Latitude;
- }
- set
- {
- if ((this._Latitude != value))
- {
- this.OnLatitudeChanging(value);
- this.SendPropertyChanging();
- this._Latitude = value;
- this.SendPropertyChanged("Latitude");
- this.OnLatitudeChanged();
- }
- }
- }
-
- [Column(Storage="_Longitude", DbType="Float")]
- public System.Nullable<double> Longitude
- {
- get
- {
- return this._Longitude;
- }
- set
- {
- if ((this._Longitude != value))
- {
- this.OnLongitudeChanging(value);
- this.SendPropertyChanging();
- this._Longitude = value;
- this.SendPropertyChanged("Longitude");
- this.OnLongitudeChanged();
- }
- }
- }
-
- [Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
- public System.Nullable<System.DateTime> TimeStamp
- {
- get
- {
- return this._TimeStamp;
- }
- set
- {
- if ((this._TimeStamp != value))
- {
- this.OnTimeStampChanging(value);
- this.SendPropertyChanging();
- this._TimeStamp = value;
- this.SendPropertyChanged("TimeStamp");
- this.OnTimeStampChanged();
- }
- }
- }
-
- 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));
- }
- }
- }
-
- [Table(Name="dbo.Phone")]
- public partial class Phone : INotifyPropertyChanging, INotifyPropertyChanged
- {
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _ID;
-
- private string _CountryCode;
-
- private string _RegionCode;
-
- private string _Number;
-
- private System.Nullable<System.DateTime> _TimeStamp;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnIDChanging(int value);
- partial void OnIDChanged();
- partial void OnCountryCodeChanging(string value);
- partial void OnCountryCodeChanged();
- partial void OnRegionCodeChanging(string value);
- partial void OnRegionCodeChanged();
- partial void OnNumberChanging(string value);
- partial void OnNumberChanged();
- partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
- partial void OnTimeStampChanged();
- #endregion
-
- public Phone()
- {
- OnCreated();
- }
-
- [Column(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int ID
- {
- get
- {
- return this._ID;
- }
- set
- {
- if ((this._ID != value))
- {
- this.OnIDChanging(value);
- this.SendPropertyChanging();
- this._ID = value;
- this.SendPropertyChanged("ID");
- this.OnIDChanged();
- }
- }
- }
-
- [Column(Storage="_CountryCode", DbType="VarChar(50)")]
- public string CountryCode
- {
- get
- {
- return this._CountryCode;
- }
- set
- {
- if ((this._CountryCode != value))
- {
- this.OnCountryCodeChanging(value);
- this.SendPropertyChanging();
- this._CountryCode = value;
- this.SendPropertyChanged("CountryCode");
- this.OnCountryCodeChanged();
- }
- }
- }
-
- [Column(Storage="_RegionCode", DbType="VarChar(10)")]
- public string RegionCode
- {
- get
- {
- return this._RegionCode;
- }
- set
- {
- if ((this._RegionCode != value))
- {
- this.OnRegionCodeChanging(value);
- this.SendPropertyChanging();
- this._RegionCode = value;
- this.SendPropertyChanged("RegionCode");
- this.OnRegionCodeChanged();
- }
- }
- }
-
- [Column(Storage="_Number", DbType="VarChar(50)")]
- public string Number
- {
- get
- {
- return this._Number;
- }
- set
- {
- if ((this._Number != value))
- {
- this.OnNumberChanging(value);
- this.SendPropertyChanging();
- this._Number = value;
- this.SendPropertyChanged("Number");
- this.OnNumberChanged();
- }
- }
- }
-
- [Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
- public System.Nullable<System.DateTime> TimeStamp
- {
- get
- {
- return this._TimeStamp;
- }
- set
- {
- if ((this._TimeStamp != value))
- {
- this.OnTimeStampChanging(value);
- this.SendPropertyChanging();
- this._TimeStamp = value;
- this.SendPropertyChanged("TimeStamp");
- this.OnTimeStampChanged();
- }
- }
- }
-
- 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));
- }
- }
- }
-
- [Table(Name="dbo.Contact")]
- public partial class Contact : INotifyPropertyChanging, INotifyPropertyChanged
- {
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _ID;
-
- private System.Nullable<int> _Title_LID;
-
- private System.Nullable<int> _Type_LID;
-
- private string _Firstname;
-
- private string _Lastname;
-
- private System.Nullable<System.DateTime> _TimeStamp;
-
- private EntitySet<Contact_Address> _Contact_Addresses;
-
- private EntitySet<Contact_Phone> _Contact_Phones;
-
- private EntityRef<Lookup> _Lookup;
-
- private EntityRef<Lookup> _Lookup1;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnIDChanging(int value);
- partial void OnIDChanged();
- partial void OnTitle_LIDChanging(System.Nullable<int> value);
- partial void OnTitle_LIDChanged();
- partial void OnType_LIDChanging(System.Nullable<int> value);
- partial void OnType_LIDChanged();
- partial void OnFirstnameChanging(string value);
- partial void OnFirstnameChanged();
- partial void OnLastnameChanging(string value);
- partial void OnLastnameChanged();
- partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
- partial void OnTimeStampChanged();
- #endregion
-
- public Contact()
- {
- this._Contact_Addresses = new EntitySet<Contact_Address>(new Action<Contact_Address>(this.attach_Contact_Addresses), new Action<Contact_Address>(this.detach_Contact_Addresses));
- this._Contact_Phones = new EntitySet<Contact_Phone>(new Action<Contact_Phone>(this.attach_Contact_Phones), new Action<Contact_Phone>(this.detach_Contact_Phones));
- this._Lookup = default(EntityRef<Lookup>);
- this._Lookup1 = default(EntityRef<Lookup>);
- OnCreated();
- }
-
- [Column(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int ID
- {
- get
- {
- return this._ID;
- }
- set
- {
- if ((this._ID != value))
- {
- this.OnIDChanging(value);
- this.SendPropertyChanging();
- this._ID = value;
- this.SendPropertyChanged("ID");
- this.OnIDChanged();
- }
- }
- }
-
- [Column(Storage="_Title_LID", DbType="Int")]
- internal System.Nullable<int> Title_LID
- {
- get
- {
- return this._Title_LID;
- }
- set
- {
- if ((this._Title_LID != value))
- {
- if (this._Lookup.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnTitle_LIDChanging(value);
- this.SendPropertyChanging();
- this._Title_LID = value;
- this.SendPropertyChanged("Title_LID");
- this.OnTitle_LIDChanged();
- }
- }
- }
-
- [Column(Storage="_Type_LID", DbType="Int")]
- internal System.Nullable<int> Type_LID
- {
- get
- {
- return this._Type_LID;
- }
- set
- {
- if ((this._Type_LID != value))
- {
- if (this._Lookup1.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnType_LIDChanging(value);
- this.SendPropertyChanging();
- this._Type_LID = value;
- this.SendPropertyChanged("Type_LID");
- this.OnType_LIDChanged();
- }
- }
- }
-
- [Column(Storage="_Firstname", DbType="VarChar(128)")]
- 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();
- }
- }
- }
-
- [Column(Storage="_Lastname", DbType="VarChar(128)")]
- 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();
- }
- }
- }
-
- [Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
- public System.Nullable<System.DateTime> TimeStamp
- {
- get
- {
- return this._TimeStamp;
- }
- set
- {
- if ((this._TimeStamp != value))
- {
- this.OnTimeStampChanging(value);
- this.SendPropertyChanging();
- this._TimeStamp = value;
- this.SendPropertyChanged("TimeStamp");
- this.OnTimeStampChanged();
- }
- }
- }
-
- [Association(Name="Contact_Contact_Address", Storage="_Contact_Addresses", OtherKey="Contact_ID")]
- public EntitySet<Contact_Address> Contact_Addresses
- {
- get
- {
- return this._Contact_Addresses;
- }
- set
- {
- this._Contact_Addresses.Assign(value);
- }
- }
-
- [Association(Name="Contact_Contact_Phone", Storage="_Contact_Phones", OtherKey="Contact_ID")]
- public EntitySet<Contact_Phone> Contact_Phones
- {
- get
- {
- return this._Contact_Phones;
- }
- set
- {
- this._Contact_Phones.Assign(value);
- }
- }
-
- [Association(Name="Lookup_Contact", Storage="_Lookup", ThisKey="Title_LID", IsForeignKey=true)]
- public Lookup TitleType
- {
- get
- {
- return this._Lookup.Entity;
- }
- set
- {
- if ((this._Lookup.Entity != value))
- {
- this.SendPropertyChanging();
- this._Lookup.Entity = value;
- this.SendPropertyChanged("TitleType");
- }
- }
- }
-
- [Association(Name="Lookup_Contact1", Storage="_Lookup1", ThisKey="Type_LID", IsForeignKey=true)]
- public Lookup ContactType
- {
- get
- {
- return this._Lookup1.Entity;
- }
- set
- {
- if ((this._Lookup1.Entity != value))
- {
- this.SendPropertyChanging();
- this._Lookup1.Entity = value;
- this.SendPropertyChanged("ContactType");
- }
- }
- }
-
- 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));
- }
- }
-
- private void attach_Contact_Addresses(Contact_Address entity)
- {
- this.SendPropertyChanging();
- entity.Contact = this;
- }
-
- private void detach_Contact_Addresses(Contact_Address entity)
- {
- this.SendPropertyChanging();
- entity.Contact = null;
- }
-
- private void attach_Contact_Phones(Contact_Phone entity)
- {
- this.SendPropertyChanging();
- entity.Contact = this;
- }
-
- private void detach_Contact_Phones(Contact_Phone entity)
- {
- this.SendPropertyChanging();
- entity.Contact = null;
- }
- }
-
- [Table(Name="dbo.Contact_Addresses")]
- public partial class Contact_Address : INotifyPropertyChanging, INotifyPropertyChanged
- {
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _Contact_ID;
-
- private int _Address_ID;
-
- private int _Type_LID;
-
- private System.Nullable<System.DateTime> _TimeStamp;
-
- private EntityRef<Address> _Address;
-
- private EntityRef<Contact> _Contact;
-
- private EntityRef<Lookup> _Lookup;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnContact_IDChanging(int value);
- partial void OnContact_IDChanged();
- partial void OnAddress_IDChanging(int value);
- partial void OnAddress_IDChanged();
- partial void OnType_LIDChanging(int value);
- partial void OnType_LIDChanged();
- partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
- partial void OnTimeStampChanged();
- #endregion
-
- public Contact_Address()
- {
- this._Address = default(EntityRef<Address>);
- this._Contact = default(EntityRef<Contact>);
- this._Lookup = default(EntityRef<Lookup>);
- OnCreated();
- }
-
- [Column(Storage="_Contact_ID", DbType="Int NOT NULL", IsPrimaryKey=true)]
- public int Contact_ID
- {
- get
- {
- return this._Contact_ID;
- }
- set
- {
- if ((this._Contact_ID != value))
- {
- if (this._Contact.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnContact_IDChanging(value);
- this.SendPropertyChanging();
- this._Contact_ID = value;
- this.SendPropertyChanged("Contact_ID");
- this.OnContact_IDChanged();
- }
- }
- }
-
- [Column(Storage="_Address_ID", DbType="Int NOT NULL", IsPrimaryKey=true)]
- public int Address_ID
- {
- get
- {
- return this._Address_ID;
- }
- set
- {
- if ((this._Address_ID != value))
- {
- if (this._Address.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnAddress_IDChanging(value);
- this.SendPropertyChanging();
- this._Address_ID = value;
- this.SendPropertyChanged("Address_ID");
- this.OnAddress_IDChanged();
- }
- }
- }
-
- [Column(Storage="_Type_LID", DbType="Int NOT NULL")]
- internal int Type_LID
- {
- get
- {
- return this._Type_LID;
- }
- set
- {
- if ((this._Type_LID != value))
- {
- if (this._Lookup.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnType_LIDChanging(value);
- this.SendPropertyChanging();
- this._Type_LID = value;
- this.SendPropertyChanged("Type_LID");
- this.OnType_LIDChanged();
- }
- }
- }
-
- [Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
- public System.Nullable<System.DateTime> TimeStamp
- {
- get
- {
- return this._TimeStamp;
- }
- set
- {
- if ((this._TimeStamp != value))
- {
- this.OnTimeStampChanging(value);
- this.SendPropertyChanging();
- this._TimeStamp = value;
- this.SendPropertyChanged("TimeStamp");
- this.OnTimeStampChanged();
- }
- }
- }
-
- [Association(Name="Address_Contact_Address", Storage="_Address", ThisKey="Address_ID", IsForeignKey=true)]
- public Address Address
- {
- get
- {
- return this._Address.Entity;
- }
- set
- {
- if ((this._Address.Entity != value))
- {
- this.SendPropertyChanging();
- this._Address.Entity = value;
- this.SendPropertyChanged("Address");
- }
- }
- }
-
- [Association(Name="Contact_Contact_Address", Storage="_Contact", ThisKey="Contact_ID", IsForeignKey=true)]
- internal Contact Contact
- {
- get
- {
- return this._Contact.Entity;
- }
- set
- {
- Contact previousValue = this._Contact.Entity;
- if (((previousValue != value)
- || (this._Contact.HasLoadedOrAssignedValue == false)))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Contact.Entity = null;
- previousValue.Contact_Addresses.Remove(this);
- }
- this._Contact.Entity = value;
- if ((value != null))
- {
- value.Contact_Addresses.Add(this);
- this._Contact_ID = value.ID;
- }
- else
- {
- this._Contact_ID = default(int);
- }
- this.SendPropertyChanged("Contact");
- }
- }
- }
-
- [Association(Name="Lookup_Contact_Address", Storage="_Lookup", ThisKey="Type_LID", IsForeignKey=true)]
- public Lookup ContactAddressType
- {
- get
- {
- return this._Lookup.Entity;
- }
- set
- {
- if ((this._Lookup.Entity != value))
- {
- this.SendPropertyChanging();
- this._Lookup.Entity = value;
- this.SendPropertyChanged("ContactAddressType");
- }
- }
- }
-
- 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));
- }
- }
- }
-
- [Table(Name="dbo.Contact_Phones")]
- public partial class Contact_Phone : INotifyPropertyChanging, INotifyPropertyChanged
- {
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _Contact_ID;
-
- private int _Phone_ID;
-
- private System.Nullable<int> _Type_LID;
-
- private System.Nullable<System.DateTime> _TimeStamp;
-
- private EntityRef<Contact> _Contact;
-
- private EntityRef<Phone> _Phone;
-
- private EntityRef<Lookup> _Lookup;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnContact_IDChanging(int value);
- partial void OnContact_IDChanged();
- partial void OnPhone_IDChanging(int value);
- partial void OnPhone_IDChanged();
- partial void OnType_LIDChanging(System.Nullable<int> value);
- partial void OnType_LIDChanged();
- partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
- partial void OnTimeStampChanged();
- #endregion
-
- public Contact_Phone()
- {
- this._Contact = default(EntityRef<Contact>);
- this._Phone = default(EntityRef<Phone>);
- this._Lookup = default(EntityRef<Lookup>);
- OnCreated();
- }
-
- [Column(Storage="_Contact_ID", DbType="Int NOT NULL", IsPrimaryKey=true)]
- public int Contact_ID
- {
- get
- {
- return this._Contact_ID;
- }
- set
- {
- if ((this._Contact_ID != value))
- {
- if (this._Contact.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnContact_IDChanging(value);
- this.SendPropertyChanging();
- this._Contact_ID = value;
- this.SendPropertyChanged("Contact_ID");
- this.OnContact_IDChanged();
- }
- }
- }
-
- [Column(Storage="_Phone_ID", DbType="Int NOT NULL", IsPrimaryKey=true)]
- public int Phone_ID
- {
- get
- {
- return this._Phone_ID;
- }
- set
- {
- if ((this._Phone_ID != value))
- {
- if (this._Phone.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnPhone_IDChanging(value);
- this.SendPropertyChanging();
- this._Phone_ID = value;
- this.SendPropertyChanged("Phone_ID");
- this.OnPhone_IDChanged();
- }
- }
- }
-
- [Column(Storage="_Type_LID", DbType="Int")]
- internal System.Nullable<int> Type_LID
- {
- get
- {
- return this._Type_LID;
- }
- set
- {
- if ((this._Type_LID != value))
- {
- if (this._Lookup.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnType_LIDChanging(value);
- this.SendPropertyChanging();
- this._Type_LID = value;
- this.SendPropertyChanged("Type_LID");
- this.OnType_LIDChanged();
- }
- }
- }
-
- [Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
- public System.Nullable<System.DateTime> TimeStamp
- {
- get
- {
- return this._TimeStamp;
- }
- set
- {
- if ((this._TimeStamp != value))
- {
- this.OnTimeStampChanging(value);
- this.SendPropertyChanging();
- this._TimeStamp = value;
- this.SendPropertyChanged("TimeStamp");
- this.OnTimeStampChanged();
- }
- }
- }
-
- [Association(Name="Contact_Contact_Phone", Storage="_Contact", ThisKey="Contact_ID", IsForeignKey=true)]
- internal Contact Contact
- {
- get
- {
- return this._Contact.Entity;
- }
- set
- {
- Contact previousValue = this._Contact.Entity;
- if (((previousValue != value)
- || (this._Contact.HasLoadedOrAssignedValue == false)))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Contact.Entity = null;
- previousValue.Contact_Phones.Remove(this);
- }
- this._Contact.Entity = value;
- if ((value != null))
- {
- value.Contact_Phones.Add(this);
- this._Contact_ID = value.ID;
- }
- else
- {
- this._Contact_ID = default(int);
- }
- this.SendPropertyChanged("Contact");
- }
- }
- }
-
- [Association(Name="Phone_Contact_Phone", Storage="_Phone", ThisKey="Phone_ID", IsForeignKey=true)]
- public Phone Phone
- {
- get
- {
- return this._Phone.Entity;
- }
- set
- {
- if ((this._Phone.Entity != value))
- {
- this.SendPropertyChanging();
- this._Phone.Entity = value;
- this.SendPropertyChanged("Phone");
- }
- }
- }
-
- [Association(Name="Lookup_Contact_Phone", Storage="_Lookup", ThisKey="Type_LID", IsForeignKey=true)]
- public Lookup ContactPhoneType
- {
- get
- {
- return this._Lookup.Entity;
- }
- set
- {
- if ((this._Lookup.Entity != value))
- {
- this.SendPropertyChanging();
- this._Lookup.Entity = value;
- this.SendPropertyChanged("ContactPhoneType");
- }
- }
- }
-
- 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));
- }
- }
- }
-
- [Table(Name="dbo.Lookup")]
- public partial class Lookup : INotifyPropertyChanging, INotifyPropertyChanged
- {
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _ID;
-
- private string _Type;
-
- private string _Value;
-
- private string _Text;
-
- private int _DisplayOrder;
-
- private System.Nullable<System.DateTime> _TimeStamp;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnIDChanging(int value);
- partial void OnIDChanged();
- partial void OnTypeChanging(string value);
- partial void OnTypeChanged();
- partial void OnValueChanging(string value);
- partial void OnValueChanged();
- partial void OnTextChanging(string value);
- partial void OnTextChanged();
- partial void OnDisplayOrderChanging(int value);
- partial void OnDisplayOrderChanged();
- partial void OnTimeStampChanging(System.Nullable<System.DateTime> value);
- partial void OnTimeStampChanged();
- #endregion
-
- public Lookup()
- {
- OnCreated();
- }
-
- [Column(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int ID
- {
- get
- {
- return this._ID;
- }
- set
- {
- if ((this._ID != value))
- {
- this.OnIDChanging(value);
- this.SendPropertyChanging();
- this._ID = value;
- this.SendPropertyChanged("ID");
- this.OnIDChanged();
- }
- }
- }
-
- [Column(Storage="_Type", DbType="VarChar(50)")]
- public string Type
- {
- get
- {
- return this._Type;
- }
- set
- {
- if ((this._Type != value))
- {
- this.OnTypeChanging(value);
- this.SendPropertyChanging();
- this._Type = value;
- this.SendPropertyChanged("Type");
- this.OnTypeChanged();
- }
- }
- }
-
- [Column(Storage="_Value", DbType="VarChar(50)")]
- public string Value
- {
- get
- {
- return this._Value;
- }
- set
- {
- if ((this._Value != value))
- {
- this.OnValueChanging(value);
- this.SendPropertyChanging();
- this._Value = value;
- this.SendPropertyChanged("Value");
- this.OnValueChanged();
- }
- }
- }
-
- [Column(Storage="_Text", DbType="VarChar(255)")]
- public string Text
- {
- get
- {
- return this._Text;
- }
- set
- {
- if ((this._Text != value))
- {
- this.OnTextChanging(value);
- this.SendPropertyChanging();
- this._Text = value;
- this.SendPropertyChanged("Text");
- this.OnTextChanged();
- }
- }
- }
-
- [Column(Storage="_DisplayOrder", DbType="Int NOT NULL")]
- public int DisplayOrder
- {
- get
- {
- return this._DisplayOrder;
- }
- set
- {
- if ((this._DisplayOrder != value))
- {
- this.OnDisplayOrderChanging(value);
- this.SendPropertyChanging();
- this._DisplayOrder = value;
- this.SendPropertyChanged("DisplayOrder");
- this.OnDisplayOrderChanged();
- }
- }
- }
-
- [Column(Storage="_TimeStamp", DbType="DateTime", IsDbGenerated=true, IsVersion=true)]
- public System.Nullable<System.DateTime> TimeStamp
- {
- get
- {
- return this._TimeStamp;
- }
- set
- {
- if ((this._TimeStamp != value))
- {
- this.OnTimeStampChanging(value);
- this.SendPropertyChanging();
- this._TimeStamp = value;
- this.SendPropertyChanged("TimeStamp");
- this.OnTimeStampChanged();
- }
- }
- }
-
- 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