//------------------------------------------------------------------------------ // // 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. // //------------------------------------------------------------------------------ using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.Linq; using System.Data.Linq.Mapping; using System.Linq; using System.Linq.Expressions; using System.Reflection; public partial class Hsbc : System.Data.Linq.DataContext { #region Extensibility Method Definitions partial void OnCreated(); partial void InsertTblAccountCodes(TblAccountCodes instance); partial void UpdateTblAccountCodes(TblAccountCodes instance); partial void DeleteTblAccountCodes(TblAccountCodes instance); partial void InsertTblContacts(TblContacts instance); partial void UpdateTblContacts(TblContacts instance); partial void DeleteTblContacts(TblContacts instance); partial void InsertTblCustomer(TblCustomer instance); partial void UpdateTblCustomer(TblCustomer instance); partial void DeleteTblCustomer(TblCustomer instance); partial void InsertTblExchangeRates(TblExchangeRates instance); partial void UpdateTblExchangeRates(TblExchangeRates instance); partial void DeleteTblExchangeRates(TblExchangeRates instance); partial void InsertTblJournalTransactions(TblJournalTransactions instance); partial void UpdateTblJournalTransactions(TblJournalTransactions instance); partial void DeleteTblJournalTransactions(TblJournalTransactions instance); #endregion public Hsbc(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : base(connection, mappingSource) { OnCreated(); } public Hsbc(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : base(connection, mappingSource) { OnCreated(); } public System.Data.Linq.Table TblAccountCodes { get { return this.GetTable(); } } public System.Data.Linq.Table TblContacts { get { return this.GetTable(); } } public System.Data.Linq.Table TblCustomer { get { return this.GetTable(); } } public System.Data.Linq.Table TblExchangeRates { get { return this.GetTable(); } } public System.Data.Linq.Table TblJournalTransactions { get { return this.GetTable(); } } } public partial class TblContacts : INotifyPropertyChanging, INotifyPropertyChanged { private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); private int _ContactId; private int _CustomerId; private string _FirstName; private string _LastName; private string _BusinessTelephone; private string _MobileTelephone; private string _HomeTelephone; private string _Email1; private string _Email2; private string _Email3; private EntityRef _TblCustomer; #region Extensibility Method Definitions partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); partial void OnCreated(); partial void OnContactIdChanging(int value); partial void OnContactIdChanged(); partial void OnCustomerIdChanging(int value); partial void OnCustomerIdChanged(); partial void OnFirstNameChanging(string value); partial void OnFirstNameChanged(); partial void OnLastNameChanging(string value); partial void OnLastNameChanged(); partial void OnBusinessTelephoneChanging(string value); partial void OnBusinessTelephoneChanged(); partial void OnMobileTelephoneChanging(string value); partial void OnMobileTelephoneChanged(); partial void OnHomeTelephoneChanging(string value); partial void OnHomeTelephoneChanged(); partial void OnEmail1Changing(string value); partial void OnEmail1Changed(); partial void OnEmail2Changing(string value); partial void OnEmail2Changed(); partial void OnEmail3Changing(string value); partial void OnEmail3Changed(); #endregion public TblContacts() { this._TblCustomer = default(EntityRef); OnCreated(); } public int ContactId { get { return this._ContactId; } set { if ((this._ContactId != value)) { this.OnContactIdChanging(value); this.SendPropertyChanging(); this._ContactId = value; this.SendPropertyChanged("ContactId"); this.OnContactIdChanged(); } } } public int CustomerId { get { return this._CustomerId; } set { if ((this._CustomerId != value)) { if (this._TblCustomer.HasLoadedOrAssignedValue) { throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); } this.OnCustomerIdChanging(value); this.SendPropertyChanging(); this._CustomerId = value; this.SendPropertyChanged("CustomerId"); this.OnCustomerIdChanged(); } } } 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(); } } } 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(); } } } public string BusinessTelephone { get { return this._BusinessTelephone; } set { if ((this._BusinessTelephone != value)) { this.OnBusinessTelephoneChanging(value); this.SendPropertyChanging(); this._BusinessTelephone = value; this.SendPropertyChanged("BusinessTelephone"); this.OnBusinessTelephoneChanged(); } } } public string MobileTelephone { get { return this._MobileTelephone; } set { if ((this._MobileTelephone != value)) { this.OnMobileTelephoneChanging(value); this.SendPropertyChanging(); this._MobileTelephone = value; this.SendPropertyChanged("MobileTelephone"); this.OnMobileTelephoneChanged(); } } } public string HomeTelephone { get { return this._HomeTelephone; } set { if ((this._HomeTelephone != value)) { this.OnHomeTelephoneChanging(value); this.SendPropertyChanging(); this._HomeTelephone = value; this.SendPropertyChanged("HomeTelephone"); this.OnHomeTelephoneChanged(); } } } public string Email1 { get { return this._Email1; } set { if ((this._Email1 != value)) { this.OnEmail1Changing(value); this.SendPropertyChanging(); this._Email1 = value; this.SendPropertyChanged("Email1"); this.OnEmail1Changed(); } } } public string Email2 { get { return this._Email2; } set { if ((this._Email2 != value)) { this.OnEmail2Changing(value); this.SendPropertyChanging(); this._Email2 = value; this.SendPropertyChanged("Email2"); this.OnEmail2Changed(); } } } public string Email3 { get { return this._Email3; } set { if ((this._Email3 != value)) { this.OnEmail3Changing(value); this.SendPropertyChanging(); this._Email3 = value; this.SendPropertyChanged("Email3"); this.OnEmail3Changed(); } } } public TblCustomer TblCustomer { get { return this._TblCustomer.Entity; } set { TblCustomer previousValue = this._TblCustomer.Entity; if (((previousValue != value) || (this._TblCustomer.HasLoadedOrAssignedValue == false))) { this.SendPropertyChanging(); if ((previousValue != null)) { this._TblCustomer.Entity = null; previousValue.TblContacts.Remove(this); } this._TblCustomer.Entity = value; if ((value != null)) { value.TblContacts.Add(this); this._CustomerId = value.CustomerId; } else { this._CustomerId = default(int); } this.SendPropertyChanged("TblCustomer"); } } } 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)); } } } public partial class TblCustomer : INotifyPropertyChanging, INotifyPropertyChanged { private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); private int _CustomerId; private string _Company; private string _FirstName; private string _LastName; private string _Address; private int _CountryId; private EntitySet _TblContacts; #region Extensibility Method Definitions partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); partial void OnCreated(); partial void OnCustomerIdChanging(int value); partial void OnCustomerIdChanged(); partial void OnCompanyChanging(string value); partial void OnCompanyChanged(); partial void OnFirstNameChanging(string value); partial void OnFirstNameChanged(); partial void OnLastNameChanging(string value); partial void OnLastNameChanged(); partial void OnAddressChanging(string value); partial void OnAddressChanged(); partial void OnCountryIdChanging(int value); partial void OnCountryIdChanged(); #endregion public TblCustomer() { this._TblContacts = new EntitySet(new Action(this.attach_TblContacts), new Action(this.detach_TblContacts)); OnCreated(); } public int CustomerId { get { return this._CustomerId; } set { if ((this._CustomerId != value)) { this.OnCustomerIdChanging(value); this.SendPropertyChanging(); this._CustomerId = value; this.SendPropertyChanged("CustomerId"); this.OnCustomerIdChanged(); } } } public string Company { get { return this._Company; } set { if ((this._Company != value)) { this.OnCompanyChanging(value); this.SendPropertyChanging(); this._Company = value; this.SendPropertyChanged("Company"); this.OnCompanyChanged(); } } } 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(); } } } 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(); } } } public string Address { get { return this._Address; } set { if ((this._Address != value)) { this.OnAddressChanging(value); this.SendPropertyChanging(); this._Address = value; this.SendPropertyChanged("Address"); this.OnAddressChanged(); } } } public int CountryId { get { return this._CountryId; } set { if ((this._CountryId != value)) { this.OnCountryIdChanging(value); this.SendPropertyChanging(); this._CountryId = value; this.SendPropertyChanged("CountryId"); this.OnCountryIdChanged(); } } } public EntitySet TblContacts { get { return this._TblContacts; } set { this._TblContacts.Assign(value); } } 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_TblContacts(TblContacts entity) { this.SendPropertyChanging(); entity.TblCustomer = this; } private void detach_TblContacts(TblContacts entity) { this.SendPropertyChanging(); entity.TblCustomer = null; } }