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