PageRenderTime 51ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/MvcBlanket.Security/DataAccess/DataContexts/Security.designer.cs

http://mvcblanket.codeplex.com
C# | 1285 lines | 1143 code | 133 blank | 9 comment | 117 complexity | db880a08d4e941902043c11f9249efa2 MD5 | raw file
Possible License(s): LGPL-3.0
  1. #pragma warning disable 1591
  2. //------------------------------------------------------------------------------
  3. // <auto-generated>
  4. // This code was generated by a tool.
  5. // Runtime Version:4.0.30319.488
  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 MvcBlanket.Security.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. [global::System.Data.Linq.Mapping.DatabaseAttribute(Name="EasyPartner")]
  21. internal partial class SecurityDataContext : 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 InsertRole(MvcBlanket.Security.DataAccess.DataContexts.Role instance);
  27. partial void UpdateRole(MvcBlanket.Security.DataAccess.DataContexts.Role instance);
  28. partial void DeleteRole(MvcBlanket.Security.DataAccess.DataContexts.Role instance);
  29. partial void InsertUser2Role(MvcBlanket.Security.DataAccess.DataContexts.User2Role instance);
  30. partial void UpdateUser2Role(MvcBlanket.Security.DataAccess.DataContexts.User2Role instance);
  31. partial void DeleteUser2Role(MvcBlanket.Security.DataAccess.DataContexts.User2Role instance);
  32. partial void InsertUser(MvcBlanket.Security.DataAccess.DataContexts.User instance);
  33. partial void UpdateUser(MvcBlanket.Security.DataAccess.DataContexts.User instance);
  34. partial void DeleteUser(MvcBlanket.Security.DataAccess.DataContexts.User instance);
  35. partial void InsertUser2ParentUser(MvcBlanket.Security.DataAccess.DataContexts.User2ParentUser instance);
  36. partial void UpdateUser2ParentUser(MvcBlanket.Security.DataAccess.DataContexts.User2ParentUser instance);
  37. partial void DeleteUser2ParentUser(MvcBlanket.Security.DataAccess.DataContexts.User2ParentUser instance);
  38. #endregion
  39. public SecurityDataContext() :
  40. base(global::MvcBlanket.Security.Properties.Settings.Default.SecurityConnectionString, mappingSource)
  41. {
  42. OnCreated();
  43. }
  44. public SecurityDataContext(string connection) :
  45. base(connection, mappingSource)
  46. {
  47. OnCreated();
  48. }
  49. public SecurityDataContext(System.Data.IDbConnection connection) :
  50. base(connection, mappingSource)
  51. {
  52. OnCreated();
  53. }
  54. public SecurityDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
  55. base(connection, mappingSource)
  56. {
  57. OnCreated();
  58. }
  59. public SecurityDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
  60. base(connection, mappingSource)
  61. {
  62. OnCreated();
  63. }
  64. public System.Data.Linq.Table<MvcBlanket.Security.DataAccess.DataContexts.Role> Roles
  65. {
  66. get
  67. {
  68. return this.GetTable<MvcBlanket.Security.DataAccess.DataContexts.Role>();
  69. }
  70. }
  71. public System.Data.Linq.Table<MvcBlanket.Security.DataAccess.DataContexts.User2Role> User2Roles
  72. {
  73. get
  74. {
  75. return this.GetTable<MvcBlanket.Security.DataAccess.DataContexts.User2Role>();
  76. }
  77. }
  78. public System.Data.Linq.Table<MvcBlanket.Security.DataAccess.DataContexts.User> Users
  79. {
  80. get
  81. {
  82. return this.GetTable<MvcBlanket.Security.DataAccess.DataContexts.User>();
  83. }
  84. }
  85. public System.Data.Linq.Table<MvcBlanket.Security.DataAccess.DataContexts.User2ParentUser> User2ParentUsers
  86. {
  87. get
  88. {
  89. return this.GetTable<MvcBlanket.Security.DataAccess.DataContexts.User2ParentUser>();
  90. }
  91. }
  92. }
  93. }
  94. namespace MvcBlanket.Security.DataAccess.DataContexts
  95. {
  96. using System.Data.Linq;
  97. using System.Data.Linq.Mapping;
  98. using System.ComponentModel;
  99. using System;
  100. [global::System.Data.Linq.Mapping.TableAttribute(Name="Security.Role")]
  101. public partial class Role : INotifyPropertyChanging, INotifyPropertyChanged
  102. {
  103. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  104. private int _Id;
  105. private string _Name;
  106. private string _Description;
  107. private EntitySet<User2Role> _User2Roles;
  108. #region Extensibility Method Definitions
  109. partial void OnLoaded();
  110. partial void OnValidate(System.Data.Linq.ChangeAction action);
  111. partial void OnCreated();
  112. partial void OnIdChanging(int value);
  113. partial void OnIdChanged();
  114. partial void OnNameChanging(string value);
  115. partial void OnNameChanged();
  116. partial void OnDescriptionChanging(string value);
  117. partial void OnDescriptionChanged();
  118. #endregion
  119. public Role()
  120. {
  121. this._User2Roles = new EntitySet<User2Role>(new Action<User2Role>(this.attach_User2Roles), new Action<User2Role>(this.detach_User2Roles));
  122. OnCreated();
  123. }
  124. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  125. public int Id
  126. {
  127. get
  128. {
  129. return this._Id;
  130. }
  131. set
  132. {
  133. if ((this._Id != value))
  134. {
  135. this.OnIdChanging(value);
  136. this.SendPropertyChanging();
  137. this._Id = value;
  138. this.SendPropertyChanged("Id");
  139. this.OnIdChanged();
  140. }
  141. }
  142. }
  143. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
  144. public string Name
  145. {
  146. get
  147. {
  148. return this._Name;
  149. }
  150. set
  151. {
  152. if ((this._Name != value))
  153. {
  154. this.OnNameChanging(value);
  155. this.SendPropertyChanging();
  156. this._Name = value;
  157. this.SendPropertyChanged("Name");
  158. this.OnNameChanged();
  159. }
  160. }
  161. }
  162. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="NVarChar(MAX)")]
  163. public string Description
  164. {
  165. get
  166. {
  167. return this._Description;
  168. }
  169. set
  170. {
  171. if ((this._Description != value))
  172. {
  173. this.OnDescriptionChanging(value);
  174. this.SendPropertyChanging();
  175. this._Description = value;
  176. this.SendPropertyChanged("Description");
  177. this.OnDescriptionChanged();
  178. }
  179. }
  180. }
  181. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Role_User2Role", Storage="_User2Roles", ThisKey="Id", OtherKey="RoleId")]
  182. public EntitySet<User2Role> User2Roles
  183. {
  184. get
  185. {
  186. return this._User2Roles;
  187. }
  188. set
  189. {
  190. this._User2Roles.Assign(value);
  191. }
  192. }
  193. public event PropertyChangingEventHandler PropertyChanging;
  194. public event PropertyChangedEventHandler PropertyChanged;
  195. protected virtual void SendPropertyChanging()
  196. {
  197. if ((this.PropertyChanging != null))
  198. {
  199. this.PropertyChanging(this, emptyChangingEventArgs);
  200. }
  201. }
  202. protected virtual void SendPropertyChanged(String propertyName)
  203. {
  204. if ((this.PropertyChanged != null))
  205. {
  206. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  207. }
  208. }
  209. private void attach_User2Roles(User2Role entity)
  210. {
  211. this.SendPropertyChanging();
  212. entity.Role = this;
  213. }
  214. private void detach_User2Roles(User2Role entity)
  215. {
  216. this.SendPropertyChanging();
  217. entity.Role = null;
  218. }
  219. }
  220. [global::System.Data.Linq.Mapping.TableAttribute(Name="Security.User2Role")]
  221. public partial class User2Role : INotifyPropertyChanging, INotifyPropertyChanged
  222. {
  223. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  224. private int _Id;
  225. private int _UserId;
  226. private int _RoleId;
  227. private System.Nullable<bool> _Access;
  228. private EntityRef<Role> _Role;
  229. private EntityRef<User> _User;
  230. #region Extensibility Method Definitions
  231. partial void OnLoaded();
  232. partial void OnValidate(System.Data.Linq.ChangeAction action);
  233. partial void OnCreated();
  234. partial void OnIdChanging(int value);
  235. partial void OnIdChanged();
  236. partial void OnUserIdChanging(int value);
  237. partial void OnUserIdChanged();
  238. partial void OnRoleIdChanging(int value);
  239. partial void OnRoleIdChanged();
  240. partial void OnAccessChanging(System.Nullable<bool> value);
  241. partial void OnAccessChanged();
  242. #endregion
  243. public User2Role()
  244. {
  245. this._Role = default(EntityRef<Role>);
  246. this._User = default(EntityRef<User>);
  247. OnCreated();
  248. }
  249. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  250. public int Id
  251. {
  252. get
  253. {
  254. return this._Id;
  255. }
  256. set
  257. {
  258. if ((this._Id != value))
  259. {
  260. this.OnIdChanging(value);
  261. this.SendPropertyChanging();
  262. this._Id = value;
  263. this.SendPropertyChanged("Id");
  264. this.OnIdChanged();
  265. }
  266. }
  267. }
  268. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="Int NOT NULL")]
  269. public int UserId
  270. {
  271. get
  272. {
  273. return this._UserId;
  274. }
  275. set
  276. {
  277. if ((this._UserId != value))
  278. {
  279. if (this._User.HasLoadedOrAssignedValue)
  280. {
  281. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  282. }
  283. this.OnUserIdChanging(value);
  284. this.SendPropertyChanging();
  285. this._UserId = value;
  286. this.SendPropertyChanged("UserId");
  287. this.OnUserIdChanged();
  288. }
  289. }
  290. }
  291. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleId", DbType="Int NOT NULL")]
  292. public int RoleId
  293. {
  294. get
  295. {
  296. return this._RoleId;
  297. }
  298. set
  299. {
  300. if ((this._RoleId != value))
  301. {
  302. if (this._Role.HasLoadedOrAssignedValue)
  303. {
  304. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  305. }
  306. this.OnRoleIdChanging(value);
  307. this.SendPropertyChanging();
  308. this._RoleId = value;
  309. this.SendPropertyChanged("RoleId");
  310. this.OnRoleIdChanged();
  311. }
  312. }
  313. }
  314. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Access", DbType="bit")]
  315. public System.Nullable<bool> Access
  316. {
  317. get
  318. {
  319. return this._Access;
  320. }
  321. set
  322. {
  323. if ((this._Access != value))
  324. {
  325. this.OnAccessChanging(value);
  326. this.SendPropertyChanging();
  327. this._Access = value;
  328. this.SendPropertyChanged("Access");
  329. this.OnAccessChanged();
  330. }
  331. }
  332. }
  333. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Role_User2Role", Storage="_Role", ThisKey="RoleId", OtherKey="Id", IsForeignKey=true)]
  334. public Role Role
  335. {
  336. get
  337. {
  338. return this._Role.Entity;
  339. }
  340. set
  341. {
  342. Role previousValue = this._Role.Entity;
  343. if (((previousValue != value)
  344. || (this._Role.HasLoadedOrAssignedValue == false)))
  345. {
  346. this.SendPropertyChanging();
  347. if ((previousValue != null))
  348. {
  349. this._Role.Entity = null;
  350. previousValue.User2Roles.Remove(this);
  351. }
  352. this._Role.Entity = value;
  353. if ((value != null))
  354. {
  355. value.User2Roles.Add(this);
  356. this._RoleId = value.Id;
  357. }
  358. else
  359. {
  360. this._RoleId = default(int);
  361. }
  362. this.SendPropertyChanged("Role");
  363. }
  364. }
  365. }
  366. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User2Role", Storage="_User", ThisKey="UserId", OtherKey="Id", IsForeignKey=true)]
  367. public User User
  368. {
  369. get
  370. {
  371. return this._User.Entity;
  372. }
  373. set
  374. {
  375. User previousValue = this._User.Entity;
  376. if (((previousValue != value)
  377. || (this._User.HasLoadedOrAssignedValue == false)))
  378. {
  379. this.SendPropertyChanging();
  380. if ((previousValue != null))
  381. {
  382. this._User.Entity = null;
  383. previousValue.User2Roles.Remove(this);
  384. }
  385. this._User.Entity = value;
  386. if ((value != null))
  387. {
  388. value.User2Roles.Add(this);
  389. this._UserId = value.Id;
  390. }
  391. else
  392. {
  393. this._UserId = default(int);
  394. }
  395. this.SendPropertyChanged("User");
  396. }
  397. }
  398. }
  399. public event PropertyChangingEventHandler PropertyChanging;
  400. public event PropertyChangedEventHandler PropertyChanged;
  401. protected virtual void SendPropertyChanging()
  402. {
  403. if ((this.PropertyChanging != null))
  404. {
  405. this.PropertyChanging(this, emptyChangingEventArgs);
  406. }
  407. }
  408. protected virtual void SendPropertyChanged(String propertyName)
  409. {
  410. if ((this.PropertyChanged != null))
  411. {
  412. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  413. }
  414. }
  415. }
  416. [global::System.Data.Linq.Mapping.TableAttribute(Name="Security.[User]")]
  417. public partial class User : INotifyPropertyChanging, INotifyPropertyChanged
  418. {
  419. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  420. private int _Id;
  421. private System.Nullable<int> _GroupId;
  422. private string _Login;
  423. private System.Data.Linq.Binary _Password;
  424. private byte[] _Salt;
  425. private string _PasswordQuestion;
  426. private string _PasswordAnswer;
  427. private string _FirstName;
  428. private string _SecondName;
  429. private string _LastName;
  430. private string _EMail;
  431. private System.DateTime _RegDate;
  432. private System.DateTime _Modified;
  433. private System.Nullable<System.DateTime> _LastLogon;
  434. private System.Nullable<System.DateTime> _LastActivity;
  435. private bool _IsActive;
  436. private bool _IsGroup;
  437. private System.Guid _ActivationKey;
  438. private EntitySet<User2Role> _User2Roles;
  439. private EntitySet<User> _Users;
  440. private EntitySet<User2ParentUser> _ChildUsers;
  441. private EntitySet<User2ParentUser> _ParentUsers;
  442. private EntityRef<User> _User1;
  443. #region Extensibility Method Definitions
  444. partial void OnLoaded();
  445. partial void OnValidate(System.Data.Linq.ChangeAction action);
  446. partial void OnCreated();
  447. partial void OnIdChanging(int value);
  448. partial void OnIdChanged();
  449. partial void OnGroupIdChanging(System.Nullable<int> value);
  450. partial void OnGroupIdChanged();
  451. partial void OnLoginChanging(string value);
  452. partial void OnLoginChanged();
  453. partial void OnPasswordChanging(System.Data.Linq.Binary value);
  454. partial void OnPasswordChanged();
  455. partial void OnSaltChanging(byte[] value);
  456. partial void OnSaltChanged();
  457. partial void OnPasswordQuestionChanging(string value);
  458. partial void OnPasswordQuestionChanged();
  459. partial void OnPasswordAnswerChanging(string value);
  460. partial void OnPasswordAnswerChanged();
  461. partial void OnFirstNameChanging(string value);
  462. partial void OnFirstNameChanged();
  463. partial void OnSecondNameChanging(string value);
  464. partial void OnSecondNameChanged();
  465. partial void OnLastNameChanging(string value);
  466. partial void OnLastNameChanged();
  467. partial void OnEMailChanging(string value);
  468. partial void OnEMailChanged();
  469. partial void OnRegDateChanging(System.DateTime value);
  470. partial void OnRegDateChanged();
  471. partial void OnModifiedChanging(System.DateTime value);
  472. partial void OnModifiedChanged();
  473. partial void OnLastLogonChanging(System.Nullable<System.DateTime> value);
  474. partial void OnLastLogonChanged();
  475. partial void OnLastActivityChanging(System.Nullable<System.DateTime> value);
  476. partial void OnLastActivityChanged();
  477. partial void OnIsActiveChanging(bool value);
  478. partial void OnIsActiveChanged();
  479. partial void OnIsGroupChanging(bool value);
  480. partial void OnIsGroupChanged();
  481. partial void OnActivationKeyChanging(System.Guid value);
  482. partial void OnActivationKeyChanged();
  483. #endregion
  484. public User()
  485. {
  486. this._User2Roles = new EntitySet<User2Role>(new Action<User2Role>(this.attach_User2Roles), new Action<User2Role>(this.detach_User2Roles));
  487. this._Users = new EntitySet<User>(new Action<User>(this.attach_Users), new Action<User>(this.detach_Users));
  488. this._ChildUsers = new EntitySet<User2ParentUser>(new Action<User2ParentUser>(this.attach_ChildUsers), new Action<User2ParentUser>(this.detach_ChildUsers));
  489. this._ParentUsers = new EntitySet<User2ParentUser>(new Action<User2ParentUser>(this.attach_ParentUsers), new Action<User2ParentUser>(this.detach_ParentUsers));
  490. this._User1 = default(EntityRef<User>);
  491. OnCreated();
  492. }
  493. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  494. public int Id
  495. {
  496. get
  497. {
  498. return this._Id;
  499. }
  500. set
  501. {
  502. if ((this._Id != value))
  503. {
  504. this.OnIdChanging(value);
  505. this.SendPropertyChanging();
  506. this._Id = value;
  507. this.SendPropertyChanged("Id");
  508. this.OnIdChanged();
  509. }
  510. }
  511. }
  512. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GroupId", DbType="Int")]
  513. public System.Nullable<int> GroupId
  514. {
  515. get
  516. {
  517. return this._GroupId;
  518. }
  519. set
  520. {
  521. if ((this._GroupId != value))
  522. {
  523. if (this._User1.HasLoadedOrAssignedValue)
  524. {
  525. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  526. }
  527. this.OnGroupIdChanging(value);
  528. this.SendPropertyChanging();
  529. this._GroupId = value;
  530. this.SendPropertyChanged("GroupId");
  531. this.OnGroupIdChanged();
  532. }
  533. }
  534. }
  535. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Login", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  536. public string Login
  537. {
  538. get
  539. {
  540. return this._Login;
  541. }
  542. set
  543. {
  544. if ((this._Login != value))
  545. {
  546. this.OnLoginChanging(value);
  547. this.SendPropertyChanging();
  548. this._Login = value;
  549. this.SendPropertyChanged("Login");
  550. this.OnLoginChanged();
  551. }
  552. }
  553. }
  554. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Password", DbType="Binary(64)", UpdateCheck=UpdateCheck.Never)]
  555. public System.Data.Linq.Binary Password
  556. {
  557. get
  558. {
  559. return this._Password;
  560. }
  561. set
  562. {
  563. if ((this._Password != value))
  564. {
  565. this.OnPasswordChanging(value);
  566. this.SendPropertyChanging();
  567. this._Password = value;
  568. this.SendPropertyChanged("Password");
  569. this.OnPasswordChanged();
  570. }
  571. }
  572. }
  573. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Salt", DbType="binary(8) NOT NULL", CanBeNull=false)]
  574. public byte[] Salt
  575. {
  576. get
  577. {
  578. return this._Salt;
  579. }
  580. set
  581. {
  582. if ((this._Salt != value))
  583. {
  584. this.OnSaltChanging(value);
  585. this.SendPropertyChanging();
  586. this._Salt = value;
  587. this.SendPropertyChanged("Salt");
  588. this.OnSaltChanged();
  589. }
  590. }
  591. }
  592. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PasswordQuestion", DbType="NVarChar(500)")]
  593. public string PasswordQuestion
  594. {
  595. get
  596. {
  597. return this._PasswordQuestion;
  598. }
  599. set
  600. {
  601. if ((this._PasswordQuestion != value))
  602. {
  603. this.OnPasswordQuestionChanging(value);
  604. this.SendPropertyChanging();
  605. this._PasswordQuestion = value;
  606. this.SendPropertyChanged("PasswordQuestion");
  607. this.OnPasswordQuestionChanged();
  608. }
  609. }
  610. }
  611. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PasswordAnswer", DbType="NVarChar(500)")]
  612. public string PasswordAnswer
  613. {
  614. get
  615. {
  616. return this._PasswordAnswer;
  617. }
  618. set
  619. {
  620. if ((this._PasswordAnswer != value))
  621. {
  622. this.OnPasswordAnswerChanging(value);
  623. this.SendPropertyChanging();
  624. this._PasswordAnswer = value;
  625. this.SendPropertyChanged("PasswordAnswer");
  626. this.OnPasswordAnswerChanged();
  627. }
  628. }
  629. }
  630. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FirstName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  631. public string FirstName
  632. {
  633. get
  634. {
  635. return this._FirstName;
  636. }
  637. set
  638. {
  639. if ((this._FirstName != value))
  640. {
  641. this.OnFirstNameChanging(value);
  642. this.SendPropertyChanging();
  643. this._FirstName = value;
  644. this.SendPropertyChanged("FirstName");
  645. this.OnFirstNameChanged();
  646. }
  647. }
  648. }
  649. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SecondName", DbType="NVarChar(50)")]
  650. public string SecondName
  651. {
  652. get
  653. {
  654. return this._SecondName;
  655. }
  656. set
  657. {
  658. if ((this._SecondName != value))
  659. {
  660. this.OnSecondNameChanging(value);
  661. this.SendPropertyChanging();
  662. this._SecondName = value;
  663. this.SendPropertyChanged("SecondName");
  664. this.OnSecondNameChanged();
  665. }
  666. }
  667. }
  668. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  669. public string LastName
  670. {
  671. get
  672. {
  673. return this._LastName;
  674. }
  675. set
  676. {
  677. if ((this._LastName != value))
  678. {
  679. this.OnLastNameChanging(value);
  680. this.SendPropertyChanging();
  681. this._LastName = value;
  682. this.SendPropertyChanged("LastName");
  683. this.OnLastNameChanged();
  684. }
  685. }
  686. }
  687. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EMail", DbType="NVarChar(200) NOT NULL", CanBeNull=false)]
  688. public string EMail
  689. {
  690. get
  691. {
  692. return this._EMail;
  693. }
  694. set
  695. {
  696. if ((this._EMail != value))
  697. {
  698. this.OnEMailChanging(value);
  699. this.SendPropertyChanging();
  700. this._EMail = value;
  701. this.SendPropertyChanged("EMail");
  702. this.OnEMailChanged();
  703. }
  704. }
  705. }
  706. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegDate", DbType="DateTime NOT NULL")]
  707. public System.DateTime RegDate
  708. {
  709. get
  710. {
  711. return this._RegDate;
  712. }
  713. set
  714. {
  715. if ((this._RegDate != value))
  716. {
  717. this.OnRegDateChanging(value);
  718. this.SendPropertyChanging();
  719. this._RegDate = value;
  720. this.SendPropertyChanged("RegDate");
  721. this.OnRegDateChanged();
  722. }
  723. }
  724. }
  725. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Modified", DbType="DateTime NOT NULL")]
  726. public System.DateTime Modified
  727. {
  728. get
  729. {
  730. return this._Modified;
  731. }
  732. set
  733. {
  734. if ((this._Modified != value))
  735. {
  736. this.OnModifiedChanging(value);
  737. this.SendPropertyChanging();
  738. this._Modified = value;
  739. this.SendPropertyChanged("Modified");
  740. this.OnModifiedChanged();
  741. }
  742. }
  743. }
  744. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastLogon", DbType="DateTime")]
  745. public System.Nullable<System.DateTime> LastLogon
  746. {
  747. get
  748. {
  749. return this._LastLogon;
  750. }
  751. set
  752. {
  753. if ((this._LastLogon != value))
  754. {
  755. this.OnLastLogonChanging(value);
  756. this.SendPropertyChanging();
  757. this._LastLogon = value;
  758. this.SendPropertyChanged("LastLogon");
  759. this.OnLastLogonChanged();
  760. }
  761. }
  762. }
  763. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastActivity", DbType="DateTime")]
  764. public System.Nullable<System.DateTime> LastActivity
  765. {
  766. get
  767. {
  768. return this._LastActivity;
  769. }
  770. set
  771. {
  772. if ((this._LastActivity != value))
  773. {
  774. this.OnLastActivityChanging(value);
  775. this.SendPropertyChanging();
  776. this._LastActivity = value;
  777. this.SendPropertyChanged("LastActivity");
  778. this.OnLastActivityChanged();
  779. }
  780. }
  781. }
  782. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsActive", DbType="Bit NOT NULL")]
  783. public bool IsActive
  784. {
  785. get
  786. {
  787. return this._IsActive;
  788. }
  789. set
  790. {
  791. if ((this._IsActive != value))
  792. {
  793. this.OnIsActiveChanging(value);
  794. this.SendPropertyChanging();
  795. this._IsActive = value;
  796. this.SendPropertyChanged("IsActive");
  797. this.OnIsActiveChanged();
  798. }
  799. }
  800. }
  801. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsGroup", DbType="Bit NOT NULL")]
  802. public bool IsGroup
  803. {
  804. get
  805. {
  806. return this._IsGroup;
  807. }
  808. set
  809. {
  810. if ((this._IsGroup != value))
  811. {
  812. this.OnIsGroupChanging(value);
  813. this.SendPropertyChanging();
  814. this._IsGroup = value;
  815. this.SendPropertyChanged("IsGroup");
  816. this.OnIsGroupChanged();
  817. }
  818. }
  819. }
  820. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActivationKey", DbType="uniqueidentifier")]
  821. public System.Guid ActivationKey
  822. {
  823. get
  824. {
  825. return this._ActivationKey;
  826. }
  827. set
  828. {
  829. if ((this._ActivationKey != value))
  830. {
  831. this.OnActivationKeyChanging(value);
  832. this.SendPropertyChanging();
  833. this._ActivationKey = value;
  834. this.SendPropertyChanged("ActivationKey");
  835. this.OnActivationKeyChanged();
  836. }
  837. }
  838. }
  839. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User2Role", Storage="_User2Roles", ThisKey="Id", OtherKey="UserId")]
  840. public EntitySet<User2Role> User2Roles
  841. {
  842. get
  843. {
  844. return this._User2Roles;
  845. }
  846. set
  847. {
  848. this._User2Roles.Assign(value);
  849. }
  850. }
  851. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User", Storage="_Users", ThisKey="Id", OtherKey="GroupId")]
  852. public EntitySet<User> Users
  853. {
  854. get
  855. {
  856. return this._Users;
  857. }
  858. set
  859. {
  860. this._Users.Assign(value);
  861. }
  862. }
  863. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User2ParentUser", Storage="_ChildUsers", ThisKey="Id", OtherKey="ParentUserId")]
  864. public EntitySet<User2ParentUser> ChildUsers
  865. {
  866. get
  867. {
  868. return this._ChildUsers;
  869. }
  870. set
  871. {
  872. this._ChildUsers.Assign(value);
  873. }
  874. }
  875. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User2ParentUser1", Storage="_ParentUsers", ThisKey="Id", OtherKey="UserId")]
  876. public EntitySet<User2ParentUser> ParentUsers
  877. {
  878. get
  879. {
  880. return this._ParentUsers;
  881. }
  882. set
  883. {
  884. this._ParentUsers.Assign(value);
  885. }
  886. }
  887. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User", Storage="_User1", ThisKey="GroupId", OtherKey="Id", IsForeignKey=true)]
  888. public User Group
  889. {
  890. get
  891. {
  892. return this._User1.Entity;
  893. }
  894. set
  895. {
  896. User previousValue = this._User1.Entity;
  897. if (((previousValue != value)
  898. || (this._User1.HasLoadedOrAssignedValue == false)))
  899. {
  900. this.SendPropertyChanging();
  901. if ((previousValue != null))
  902. {
  903. this._User1.Entity = null;
  904. previousValue.Users.Remove(this);
  905. }
  906. this._User1.Entity = value;
  907. if ((value != null))
  908. {
  909. value.Users.Add(this);
  910. this._GroupId = value.Id;
  911. }
  912. else
  913. {
  914. this._GroupId = default(Nullable<int>);
  915. }
  916. this.SendPropertyChanged("Group");
  917. }
  918. }
  919. }
  920. public event PropertyChangingEventHandler PropertyChanging;
  921. public event PropertyChangedEventHandler PropertyChanged;
  922. protected virtual void SendPropertyChanging()
  923. {
  924. if ((this.PropertyChanging != null))
  925. {
  926. this.PropertyChanging(this, emptyChangingEventArgs);
  927. }
  928. }
  929. protected virtual void SendPropertyChanged(String propertyName)
  930. {
  931. if ((this.PropertyChanged != null))
  932. {
  933. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  934. }
  935. }
  936. private void attach_User2Roles(User2Role entity)
  937. {
  938. this.SendPropertyChanging();
  939. entity.User = this;
  940. }
  941. private void detach_User2Roles(User2Role entity)
  942. {
  943. this.SendPropertyChanging();
  944. entity.User = null;
  945. }
  946. private void attach_Users(User entity)
  947. {
  948. this.SendPropertyChanging();
  949. entity.Group = this;
  950. }
  951. private void detach_Users(User entity)
  952. {
  953. this.SendPropertyChanging();
  954. entity.Group = null;
  955. }
  956. private void attach_ChildUsers(User2ParentUser entity)
  957. {
  958. this.SendPropertyChanging();
  959. entity.ParentUser = this;
  960. }
  961. private void detach_ChildUsers(User2ParentUser entity)
  962. {
  963. this.SendPropertyChanging();
  964. entity.ParentUser = null;
  965. }
  966. private void attach_ParentUsers(User2ParentUser entity)
  967. {
  968. this.SendPropertyChanging();
  969. entity.ChildUser = this;
  970. }
  971. private void detach_ParentUsers(User2ParentUser entity)
  972. {
  973. this.SendPropertyChanging();
  974. entity.ChildUser = null;
  975. }
  976. }
  977. [global::System.Data.Linq.Mapping.TableAttribute(Name="Security.User2ParentUser")]
  978. public partial class User2ParentUser : INotifyPropertyChanging, INotifyPropertyChanged
  979. {
  980. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  981. private int _Id;
  982. private int _UserId;
  983. private int _ParentUserId;
  984. private EntityRef<User> _ParentUser;
  985. private EntityRef<User> _ChildUser;
  986. #region Extensibility Method Definitions
  987. partial void OnLoaded();
  988. partial void OnValidate(System.Data.Linq.ChangeAction action);
  989. partial void OnCreated();
  990. partial void OnIdChanging(int value);
  991. partial void OnIdChanged();
  992. partial void OnUserIdChanging(int value);
  993. partial void OnUserIdChanged();
  994. partial void OnParentUserIdChanging(int value);
  995. partial void OnParentUserIdChanged();
  996. #endregion
  997. public User2ParentUser()
  998. {
  999. this._ParentUser = default(EntityRef<User>);
  1000. this._ChildUser = default(EntityRef<User>);
  1001. OnCreated();
  1002. }
  1003. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1004. public int Id
  1005. {
  1006. get
  1007. {
  1008. return this._Id;
  1009. }
  1010. set
  1011. {
  1012. if ((this._Id != value))
  1013. {
  1014. this.OnIdChanging(value);
  1015. this.SendPropertyChanging();
  1016. this._Id = value;
  1017. this.SendPropertyChanged("Id");
  1018. this.OnIdChanged();
  1019. }
  1020. }
  1021. }
  1022. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="Int NOT NULL")]
  1023. public int UserId
  1024. {
  1025. get
  1026. {
  1027. return this._UserId;
  1028. }
  1029. set
  1030. {
  1031. if ((this._UserId != value))
  1032. {
  1033. if (this._ChildUser.HasLoadedOrAssignedValue)
  1034. {
  1035. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1036. }
  1037. this.OnUserIdChanging(value);
  1038. this.SendPropertyChanging();
  1039. this._UserId = value;
  1040. this.SendPropertyChanged("UserId");
  1041. this.OnUserIdChanged();
  1042. }
  1043. }
  1044. }
  1045. [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentUserId", DbType="Int NOT NULL")]
  1046. public int ParentUserId
  1047. {
  1048. get
  1049. {
  1050. return this._ParentUserId;
  1051. }
  1052. set
  1053. {
  1054. if ((this._ParentUserId != value))
  1055. {
  1056. if (this._ParentUser.HasLoadedOrAssignedValue)
  1057. {
  1058. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1059. }
  1060. this.OnParentUserIdChanging(value);
  1061. this.SendPropertyChanging();
  1062. this._ParentUserId = value;
  1063. this.SendPropertyChanged("ParentUserId");
  1064. this.OnParentUserIdChanged();
  1065. }
  1066. }
  1067. }
  1068. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User2ParentUser", Storage="_ParentUser", ThisKey="ParentUserId", OtherKey="Id", IsForeignKey=true)]
  1069. public User ParentUser
  1070. {
  1071. get
  1072. {
  1073. return this._ParentUser.Entity;
  1074. }
  1075. set
  1076. {
  1077. User previousValue = this._ParentUser.Entity;
  1078. if (((previousValue != value)
  1079. || (this._ParentUser.HasLoadedOrAssignedValue == false)))
  1080. {
  1081. this.SendPropertyChanging();
  1082. if ((previousValue != null))
  1083. {
  1084. this._ParentUser.Entity = null;
  1085. previousValue.ChildUsers.Remove(this);
  1086. }
  1087. this._ParentUser.Entity = value;
  1088. if ((value != null))
  1089. {
  1090. value.ChildUsers.Add(this);
  1091. this._ParentUserId = value.Id;
  1092. }
  1093. else
  1094. {
  1095. this._ParentUserId = default(int);
  1096. }
  1097. this.SendPropertyChanged("ParentUser");
  1098. }
  1099. }
  1100. }
  1101. [global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User2ParentUser1", Storage="_ChildUser", ThisKey="UserId", OtherKey="Id", IsForeignKey=true)]
  1102. public User ChildUser
  1103. {
  1104. get
  1105. {
  1106. return this._ChildUser.Entity;
  1107. }
  1108. set
  1109. {
  1110. User previousValue = this._ChildUser.Entity;
  1111. if (((previousValue != value)
  1112. || (this._ChildUser.HasLoadedOrAssignedValue == false)))
  1113. {
  1114. this.SendPropertyChanging();
  1115. if ((previousValue != null))
  1116. {
  1117. this._ChildUser.Entity = null;
  1118. previousValue.ParentUsers.Remove(this);
  1119. }
  1120. this._ChildUser.Entity = value;
  1121. if ((value != null))
  1122. {
  1123. value.ParentUsers.Add(this);
  1124. this._UserId = value.Id;
  1125. }
  1126. else
  1127. {
  1128. this._UserId = default(int);
  1129. }
  1130. this.SendPropertyChanged("ChildUser");
  1131. }
  1132. }
  1133. }
  1134. public event PropertyChangingEventHandler PropertyChanging;
  1135. public event PropertyChangedEventHandler PropertyChanged;
  1136. protected virtual void SendPropertyChanging()
  1137. {
  1138. if ((this.PropertyChanging != null))
  1139. {
  1140. this.PropertyChanging(this, emptyChangingEventArgs);
  1141. }
  1142. }
  1143. protected virtual void SendPropertyChanged(String propertyName)
  1144. {
  1145. if ((this.PropertyChanged != null))
  1146. {
  1147. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1148. }
  1149. }
  1150. }
  1151. }
  1152. #pragma warning restore 1591