PageRenderTime 60ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/DV_Enterprises.Web/DV_Enterprises.Web/DataContext.designer.cs

https://github.com/gatla001/seniorproject2009
C# | 3564 lines | 3199 code | 356 blank | 9 comment | 327 complexity | 627bc39a1c293f06f4fb84e2d6eb6145 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.3074
  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 DV_Enterprises.Web.DAL
  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="ASPNETDB")]
  21. public partial class DataContext : 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 InsertCrop(DV_Enterprises.Web.BLL.Crop instance);
  27. partial void UpdateCrop(DV_Enterprises.Web.BLL.Crop instance);
  28. partial void DeleteCrop(DV_Enterprises.Web.BLL.Crop instance);
  29. partial void InsertSectionLog(DV_Enterprises.Web.BLL.SectionLog instance);
  30. partial void UpdateSectionLog(DV_Enterprises.Web.BLL.SectionLog instance);
  31. partial void DeleteSectionLog(DV_Enterprises.Web.BLL.SectionLog instance);
  32. partial void InsertEnvironment(DV_Enterprises.Web.BLL.Environment instance);
  33. partial void UpdateEnvironment(DV_Enterprises.Web.BLL.Environment instance);
  34. partial void DeleteEnvironment(DV_Enterprises.Web.BLL.Environment instance);
  35. partial void InsertGreenhouse(DV_Enterprises.Web.BLL.Greenhouse instance);
  36. partial void UpdateGreenhouse(DV_Enterprises.Web.BLL.Greenhouse instance);
  37. partial void DeleteGreenhouse(DV_Enterprises.Web.BLL.Greenhouse instance);
  38. partial void InsertSchedule(DV_Enterprises.Web.BLL.Schedule instance);
  39. partial void UpdateSchedule(DV_Enterprises.Web.BLL.Schedule instance);
  40. partial void DeleteSchedule(DV_Enterprises.Web.BLL.Schedule instance);
  41. partial void InsertScheduleType(DV_Enterprises.Web.BLL.ScheduleType instance);
  42. partial void UpdateScheduleType(DV_Enterprises.Web.BLL.ScheduleType instance);
  43. partial void DeleteScheduleType(DV_Enterprises.Web.BLL.ScheduleType instance);
  44. partial void InsertSection(DV_Enterprises.Web.BLL.Section instance);
  45. partial void UpdateSection(DV_Enterprises.Web.BLL.Section instance);
  46. partial void DeleteSection(DV_Enterprises.Web.BLL.Section instance);
  47. partial void InsertLocation(DV_Enterprises.Web.BLL.Location instance);
  48. partial void UpdateLocation(DV_Enterprises.Web.BLL.Location instance);
  49. partial void DeleteLocation(DV_Enterprises.Web.BLL.Location instance);
  50. partial void InsertMembership(DV_Enterprises.Web.BLL.Membership instance);
  51. partial void UpdateMembership(DV_Enterprises.Web.BLL.Membership instance);
  52. partial void DeleteMembership(DV_Enterprises.Web.BLL.Membership instance);
  53. partial void InsertUser(DV_Enterprises.Web.BLL.User instance);
  54. partial void UpdateUser(DV_Enterprises.Web.BLL.User instance);
  55. partial void DeleteUser(DV_Enterprises.Web.BLL.User instance);
  56. partial void InsertCustomer(DV_Enterprises.Web.BLL.Customer instance);
  57. partial void UpdateCustomer(DV_Enterprises.Web.BLL.Customer instance);
  58. partial void DeleteCustomer(DV_Enterprises.Web.BLL.Customer instance);
  59. #endregion
  60. public DataContext() :
  61. base(global::DV_Enterprises.Web.Properties.Settings.Default.ASPNETDBConnectionString, mappingSource)
  62. {
  63. OnCreated();
  64. }
  65. public DataContext(string connection) :
  66. base(connection, mappingSource)
  67. {
  68. OnCreated();
  69. }
  70. public DataContext(System.Data.IDbConnection connection) :
  71. base(connection, mappingSource)
  72. {
  73. OnCreated();
  74. }
  75. public DataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
  76. base(connection, mappingSource)
  77. {
  78. OnCreated();
  79. }
  80. public DataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
  81. base(connection, mappingSource)
  82. {
  83. OnCreated();
  84. }
  85. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Crop> Crops
  86. {
  87. get
  88. {
  89. return this.GetTable<DV_Enterprises.Web.BLL.Crop>();
  90. }
  91. }
  92. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.SectionLog> SectionLogs
  93. {
  94. get
  95. {
  96. return this.GetTable<DV_Enterprises.Web.BLL.SectionLog>();
  97. }
  98. }
  99. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Environment> Environments
  100. {
  101. get
  102. {
  103. return this.GetTable<DV_Enterprises.Web.BLL.Environment>();
  104. }
  105. }
  106. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Greenhouse> Greenhouses
  107. {
  108. get
  109. {
  110. return this.GetTable<DV_Enterprises.Web.BLL.Greenhouse>();
  111. }
  112. }
  113. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Schedule> Schedules
  114. {
  115. get
  116. {
  117. return this.GetTable<DV_Enterprises.Web.BLL.Schedule>();
  118. }
  119. }
  120. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.ScheduleType> ScheduleTypes
  121. {
  122. get
  123. {
  124. return this.GetTable<DV_Enterprises.Web.BLL.ScheduleType>();
  125. }
  126. }
  127. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Section> Sections
  128. {
  129. get
  130. {
  131. return this.GetTable<DV_Enterprises.Web.BLL.Section>();
  132. }
  133. }
  134. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Location> Locations
  135. {
  136. get
  137. {
  138. return this.GetTable<DV_Enterprises.Web.BLL.Location>();
  139. }
  140. }
  141. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Membership> Memberships
  142. {
  143. get
  144. {
  145. return this.GetTable<DV_Enterprises.Web.BLL.Membership>();
  146. }
  147. }
  148. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.User> Users
  149. {
  150. get
  151. {
  152. return this.GetTable<DV_Enterprises.Web.BLL.User>();
  153. }
  154. }
  155. public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Customer> Customers
  156. {
  157. get
  158. {
  159. return this.GetTable<DV_Enterprises.Web.BLL.Customer>();
  160. }
  161. }
  162. }
  163. }
  164. namespace DV_Enterprises.Web.BLL
  165. {
  166. using System.Data.Linq;
  167. using System.Data.Linq.Mapping;
  168. using System.ComponentModel;
  169. using System;
  170. [Table(Name="dbo.dvent_Crop")]
  171. public partial class Crop : INotifyPropertyChanging, INotifyPropertyChanged
  172. {
  173. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  174. private int _CropId;
  175. private string _Name;
  176. private int _Length;
  177. private int _Width;
  178. private int _Height;
  179. private int _MinTemperature;
  180. private int _MaxTemperature;
  181. private int _MinHumidity;
  182. private int _MaxHumidity;
  183. private System.DateTime _DateCreated;
  184. private System.Nullable<System.DateTime> _DateDeleted;
  185. private EntitySet<Environment> _Environments;
  186. #region Extensibility Method Definitions
  187. partial void OnLoaded();
  188. partial void OnValidate(System.Data.Linq.ChangeAction action);
  189. partial void OnCreated();
  190. partial void OnCropIdChanging(int value);
  191. partial void OnCropIdChanged();
  192. partial void OnNameChanging(string value);
  193. partial void OnNameChanged();
  194. partial void OnLengthChanging(int value);
  195. partial void OnLengthChanged();
  196. partial void OnWidthChanging(int value);
  197. partial void OnWidthChanged();
  198. partial void OnHeightChanging(int value);
  199. partial void OnHeightChanged();
  200. partial void OnMinTemperatureChanging(int value);
  201. partial void OnMinTemperatureChanged();
  202. partial void OnMaxTemperatureChanging(int value);
  203. partial void OnMaxTemperatureChanged();
  204. partial void OnMinHumidityChanging(int value);
  205. partial void OnMinHumidityChanged();
  206. partial void OnMaxHumidityChanging(int value);
  207. partial void OnMaxHumidityChanged();
  208. partial void OnDateCreatedChanging(System.DateTime value);
  209. partial void OnDateCreatedChanged();
  210. partial void OnDateDeletedChanging(System.Nullable<System.DateTime> value);
  211. partial void OnDateDeletedChanged();
  212. #endregion
  213. public Crop()
  214. {
  215. this._Environments = new EntitySet<Environment>(new Action<Environment>(this.attach_Environments), new Action<Environment>(this.detach_Environments));
  216. OnCreated();
  217. }
  218. [Column(Storage="_CropId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  219. public int CropId
  220. {
  221. get
  222. {
  223. return this._CropId;
  224. }
  225. set
  226. {
  227. if ((this._CropId != value))
  228. {
  229. this.OnCropIdChanging(value);
  230. this.SendPropertyChanging();
  231. this._CropId = value;
  232. this.SendPropertyChanged("CropId");
  233. this.OnCropIdChanged();
  234. }
  235. }
  236. }
  237. [Column(Storage="_Name", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
  238. public string Name
  239. {
  240. get
  241. {
  242. return this._Name;
  243. }
  244. set
  245. {
  246. if ((this._Name != value))
  247. {
  248. this.OnNameChanging(value);
  249. this.SendPropertyChanging();
  250. this._Name = value;
  251. this.SendPropertyChanged("Name");
  252. this.OnNameChanged();
  253. }
  254. }
  255. }
  256. [Column(Storage="_Length", DbType="Int NOT NULL")]
  257. public int Length
  258. {
  259. get
  260. {
  261. return this._Length;
  262. }
  263. set
  264. {
  265. if ((this._Length != value))
  266. {
  267. this.OnLengthChanging(value);
  268. this.SendPropertyChanging();
  269. this._Length = value;
  270. this.SendPropertyChanged("Length");
  271. this.OnLengthChanged();
  272. }
  273. }
  274. }
  275. [Column(Storage="_Width", DbType="Int NOT NULL")]
  276. public int Width
  277. {
  278. get
  279. {
  280. return this._Width;
  281. }
  282. set
  283. {
  284. if ((this._Width != value))
  285. {
  286. this.OnWidthChanging(value);
  287. this.SendPropertyChanging();
  288. this._Width = value;
  289. this.SendPropertyChanged("Width");
  290. this.OnWidthChanged();
  291. }
  292. }
  293. }
  294. [Column(Storage="_Height", DbType="Int NOT NULL")]
  295. public int Height
  296. {
  297. get
  298. {
  299. return this._Height;
  300. }
  301. set
  302. {
  303. if ((this._Height != value))
  304. {
  305. this.OnHeightChanging(value);
  306. this.SendPropertyChanging();
  307. this._Height = value;
  308. this.SendPropertyChanged("Height");
  309. this.OnHeightChanged();
  310. }
  311. }
  312. }
  313. [Column(Storage="_MinTemperature", DbType="Int NOT NULL")]
  314. public int MinTemperature
  315. {
  316. get
  317. {
  318. return this._MinTemperature;
  319. }
  320. set
  321. {
  322. if ((this._MinTemperature != value))
  323. {
  324. this.OnMinTemperatureChanging(value);
  325. this.SendPropertyChanging();
  326. this._MinTemperature = value;
  327. this.SendPropertyChanged("MinTemperature");
  328. this.OnMinTemperatureChanged();
  329. }
  330. }
  331. }
  332. [Column(Storage="_MaxTemperature", DbType="Int NOT NULL")]
  333. public int MaxTemperature
  334. {
  335. get
  336. {
  337. return this._MaxTemperature;
  338. }
  339. set
  340. {
  341. if ((this._MaxTemperature != value))
  342. {
  343. this.OnMaxTemperatureChanging(value);
  344. this.SendPropertyChanging();
  345. this._MaxTemperature = value;
  346. this.SendPropertyChanged("MaxTemperature");
  347. this.OnMaxTemperatureChanged();
  348. }
  349. }
  350. }
  351. [Column(Storage="_MinHumidity", DbType="Int NOT NULL")]
  352. public int MinHumidity
  353. {
  354. get
  355. {
  356. return this._MinHumidity;
  357. }
  358. set
  359. {
  360. if ((this._MinHumidity != value))
  361. {
  362. this.OnMinHumidityChanging(value);
  363. this.SendPropertyChanging();
  364. this._MinHumidity = value;
  365. this.SendPropertyChanged("MinHumidity");
  366. this.OnMinHumidityChanged();
  367. }
  368. }
  369. }
  370. [Column(Storage="_MaxHumidity", DbType="Int NOT NULL")]
  371. public int MaxHumidity
  372. {
  373. get
  374. {
  375. return this._MaxHumidity;
  376. }
  377. set
  378. {
  379. if ((this._MaxHumidity != value))
  380. {
  381. this.OnMaxHumidityChanging(value);
  382. this.SendPropertyChanging();
  383. this._MaxHumidity = value;
  384. this.SendPropertyChanged("MaxHumidity");
  385. this.OnMaxHumidityChanged();
  386. }
  387. }
  388. }
  389. [Column(Storage="_DateCreated", DbType="DateTime NOT NULL")]
  390. public System.DateTime DateCreated
  391. {
  392. get
  393. {
  394. return this._DateCreated;
  395. }
  396. set
  397. {
  398. if ((this._DateCreated != value))
  399. {
  400. this.OnDateCreatedChanging(value);
  401. this.SendPropertyChanging();
  402. this._DateCreated = value;
  403. this.SendPropertyChanged("DateCreated");
  404. this.OnDateCreatedChanged();
  405. }
  406. }
  407. }
  408. [Column(Storage="_DateDeleted", DbType="DateTime")]
  409. public System.Nullable<System.DateTime> DateDeleted
  410. {
  411. get
  412. {
  413. return this._DateDeleted;
  414. }
  415. set
  416. {
  417. if ((this._DateDeleted != value))
  418. {
  419. this.OnDateDeletedChanging(value);
  420. this.SendPropertyChanging();
  421. this._DateDeleted = value;
  422. this.SendPropertyChanged("DateDeleted");
  423. this.OnDateDeletedChanged();
  424. }
  425. }
  426. }
  427. [Association(Name="Crop_Environment", Storage="_Environments", ThisKey="CropId", OtherKey="CropId")]
  428. public EntitySet<Environment> Environments
  429. {
  430. get
  431. {
  432. return this._Environments;
  433. }
  434. set
  435. {
  436. this._Environments.Assign(value);
  437. }
  438. }
  439. public event PropertyChangingEventHandler PropertyChanging;
  440. public event PropertyChangedEventHandler PropertyChanged;
  441. protected virtual void SendPropertyChanging()
  442. {
  443. if ((this.PropertyChanging != null))
  444. {
  445. this.PropertyChanging(this, emptyChangingEventArgs);
  446. }
  447. }
  448. protected virtual void SendPropertyChanged(String propertyName)
  449. {
  450. if ((this.PropertyChanged != null))
  451. {
  452. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  453. }
  454. }
  455. private void attach_Environments(Environment entity)
  456. {
  457. this.SendPropertyChanging();
  458. entity.Crop = this;
  459. }
  460. private void detach_Environments(Environment entity)
  461. {
  462. this.SendPropertyChanging();
  463. entity.Crop = null;
  464. }
  465. }
  466. [Table(Name="dbo.dvent_SectionLog")]
  467. public partial class SectionLog : INotifyPropertyChanging, INotifyPropertyChanged
  468. {
  469. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  470. private int _SectionLogId;
  471. private System.Data.Linq.Binary _Time;
  472. private int _Temperature;
  473. private int _Humidity;
  474. private bool _isLightOn;
  475. private int _SectionId;
  476. private EntityRef<Section> _Section;
  477. #region Extensibility Method Definitions
  478. partial void OnLoaded();
  479. partial void OnValidate(System.Data.Linq.ChangeAction action);
  480. partial void OnCreated();
  481. partial void OnSectionLogIdChanging(int value);
  482. partial void OnSectionLogIdChanged();
  483. partial void OnTimeChanging(System.Data.Linq.Binary value);
  484. partial void OnTimeChanged();
  485. partial void OnTemperatureChanging(int value);
  486. partial void OnTemperatureChanged();
  487. partial void OnHumidityChanging(int value);
  488. partial void OnHumidityChanged();
  489. partial void OnisLightOnChanging(bool value);
  490. partial void OnisLightOnChanged();
  491. partial void OnSectionIdChanging(int value);
  492. partial void OnSectionIdChanged();
  493. #endregion
  494. public SectionLog()
  495. {
  496. this._Section = default(EntityRef<Section>);
  497. OnCreated();
  498. }
  499. [Column(Storage="_SectionLogId", DbType="Int NOT NULL", IsPrimaryKey=true, UpdateCheck=UpdateCheck.Never)]
  500. public int SectionLogId
  501. {
  502. get
  503. {
  504. return this._SectionLogId;
  505. }
  506. set
  507. {
  508. if ((this._SectionLogId != value))
  509. {
  510. this.OnSectionLogIdChanging(value);
  511. this.SendPropertyChanging();
  512. this._SectionLogId = value;
  513. this.SendPropertyChanged("SectionLogId");
  514. this.OnSectionLogIdChanged();
  515. }
  516. }
  517. }
  518. [Column(Storage="_Time", AutoSync=AutoSync.Always, DbType="rowversion NOT NULL", CanBeNull=false, IsDbGenerated=true, IsVersion=true, UpdateCheck=UpdateCheck.Never)]
  519. public System.Data.Linq.Binary Time
  520. {
  521. get
  522. {
  523. return this._Time;
  524. }
  525. set
  526. {
  527. if ((this._Time != value))
  528. {
  529. this.OnTimeChanging(value);
  530. this.SendPropertyChanging();
  531. this._Time = value;
  532. this.SendPropertyChanged("Time");
  533. this.OnTimeChanged();
  534. }
  535. }
  536. }
  537. [Column(Storage="_Temperature", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
  538. public int Temperature
  539. {
  540. get
  541. {
  542. return this._Temperature;
  543. }
  544. set
  545. {
  546. if ((this._Temperature != value))
  547. {
  548. this.OnTemperatureChanging(value);
  549. this.SendPropertyChanging();
  550. this._Temperature = value;
  551. this.SendPropertyChanged("Temperature");
  552. this.OnTemperatureChanged();
  553. }
  554. }
  555. }
  556. [Column(Storage="_Humidity", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
  557. public int Humidity
  558. {
  559. get
  560. {
  561. return this._Humidity;
  562. }
  563. set
  564. {
  565. if ((this._Humidity != value))
  566. {
  567. this.OnHumidityChanging(value);
  568. this.SendPropertyChanging();
  569. this._Humidity = value;
  570. this.SendPropertyChanged("Humidity");
  571. this.OnHumidityChanged();
  572. }
  573. }
  574. }
  575. [Column(Storage="_isLightOn", DbType="Bit NOT NULL", UpdateCheck=UpdateCheck.Never)]
  576. public bool isLightOn
  577. {
  578. get
  579. {
  580. return this._isLightOn;
  581. }
  582. set
  583. {
  584. if ((this._isLightOn != value))
  585. {
  586. this.OnisLightOnChanging(value);
  587. this.SendPropertyChanging();
  588. this._isLightOn = value;
  589. this.SendPropertyChanged("isLightOn");
  590. this.OnisLightOnChanged();
  591. }
  592. }
  593. }
  594. [Column(Storage="_SectionId", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
  595. public int SectionId
  596. {
  597. get
  598. {
  599. return this._SectionId;
  600. }
  601. set
  602. {
  603. if ((this._SectionId != value))
  604. {
  605. if (this._Section.HasLoadedOrAssignedValue)
  606. {
  607. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  608. }
  609. this.OnSectionIdChanging(value);
  610. this.SendPropertyChanging();
  611. this._SectionId = value;
  612. this.SendPropertyChanged("SectionId");
  613. this.OnSectionIdChanged();
  614. }
  615. }
  616. }
  617. [Association(Name="Section_SectionLog", Storage="_Section", ThisKey="SectionId", OtherKey="SectionId", IsForeignKey=true)]
  618. public Section Section
  619. {
  620. get
  621. {
  622. return this._Section.Entity;
  623. }
  624. set
  625. {
  626. Section previousValue = this._Section.Entity;
  627. if (((previousValue != value)
  628. || (this._Section.HasLoadedOrAssignedValue == false)))
  629. {
  630. this.SendPropertyChanging();
  631. if ((previousValue != null))
  632. {
  633. this._Section.Entity = null;
  634. previousValue.SectionLogs.Remove(this);
  635. }
  636. this._Section.Entity = value;
  637. if ((value != null))
  638. {
  639. value.SectionLogs.Add(this);
  640. this._SectionId = value.SectionId;
  641. }
  642. else
  643. {
  644. this._SectionId = default(int);
  645. }
  646. this.SendPropertyChanged("Section");
  647. }
  648. }
  649. }
  650. public event PropertyChangingEventHandler PropertyChanging;
  651. public event PropertyChangedEventHandler PropertyChanged;
  652. protected virtual void SendPropertyChanging()
  653. {
  654. if ((this.PropertyChanging != null))
  655. {
  656. this.PropertyChanging(this, emptyChangingEventArgs);
  657. }
  658. }
  659. protected virtual void SendPropertyChanged(String propertyName)
  660. {
  661. if ((this.PropertyChanged != null))
  662. {
  663. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  664. }
  665. }
  666. }
  667. [Table(Name="dbo.dvent_Environment")]
  668. public partial class Environment : INotifyPropertyChanging, INotifyPropertyChanged
  669. {
  670. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  671. private int _EnvironmentId;
  672. private int _CropId;
  673. private System.Nullable<int> _MaxTemp;
  674. private System.Nullable<int> _MinTemp;
  675. private System.Nullable<int> _MaxHumidity;
  676. private System.Nullable<int> _MinHumidity;
  677. private System.DateTime _DateCreated;
  678. private System.Nullable<System.DateTime> _DateDeleted;
  679. private EntitySet<Schedule> _Schedules;
  680. private EntitySet<Section> _Sections;
  681. private EntityRef<Crop> _Crop;
  682. #region Extensibility Method Definitions
  683. partial void OnLoaded();
  684. partial void OnValidate(System.Data.Linq.ChangeAction action);
  685. partial void OnCreated();
  686. partial void OnEnvironmentIdChanging(int value);
  687. partial void OnEnvironmentIdChanged();
  688. partial void OnCropIdChanging(int value);
  689. partial void OnCropIdChanged();
  690. partial void OnMaxTempChanging(System.Nullable<int> value);
  691. partial void OnMaxTempChanged();
  692. partial void OnMinTempChanging(System.Nullable<int> value);
  693. partial void OnMinTempChanged();
  694. partial void OnMaxHumidityChanging(System.Nullable<int> value);
  695. partial void OnMaxHumidityChanged();
  696. partial void OnMinHumidityChanging(System.Nullable<int> value);
  697. partial void OnMinHumidityChanged();
  698. partial void OnDateCreatedChanging(System.DateTime value);
  699. partial void OnDateCreatedChanged();
  700. partial void OnDateDeletedChanging(System.Nullable<System.DateTime> value);
  701. partial void OnDateDeletedChanged();
  702. #endregion
  703. public Environment()
  704. {
  705. this._Schedules = new EntitySet<Schedule>(new Action<Schedule>(this.attach_Schedules), new Action<Schedule>(this.detach_Schedules));
  706. this._Sections = new EntitySet<Section>(new Action<Section>(this.attach_Sections), new Action<Section>(this.detach_Sections));
  707. this._Crop = default(EntityRef<Crop>);
  708. OnCreated();
  709. }
  710. [Column(Storage="_EnvironmentId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  711. public int EnvironmentId
  712. {
  713. get
  714. {
  715. return this._EnvironmentId;
  716. }
  717. set
  718. {
  719. if ((this._EnvironmentId != value))
  720. {
  721. this.OnEnvironmentIdChanging(value);
  722. this.SendPropertyChanging();
  723. this._EnvironmentId = value;
  724. this.SendPropertyChanged("EnvironmentId");
  725. this.OnEnvironmentIdChanged();
  726. }
  727. }
  728. }
  729. [Column(Storage="_CropId", DbType="Int NOT NULL")]
  730. public int CropId
  731. {
  732. get
  733. {
  734. return this._CropId;
  735. }
  736. set
  737. {
  738. if ((this._CropId != value))
  739. {
  740. if (this._Crop.HasLoadedOrAssignedValue)
  741. {
  742. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  743. }
  744. this.OnCropIdChanging(value);
  745. this.SendPropertyChanging();
  746. this._CropId = value;
  747. this.SendPropertyChanged("CropId");
  748. this.OnCropIdChanged();
  749. }
  750. }
  751. }
  752. [Column(Storage="_MaxTemp", DbType="Int")]
  753. public System.Nullable<int> MaxTemp
  754. {
  755. get
  756. {
  757. return this._MaxTemp;
  758. }
  759. set
  760. {
  761. if ((this._MaxTemp != value))
  762. {
  763. this.OnMaxTempChanging(value);
  764. this.SendPropertyChanging();
  765. this._MaxTemp = value;
  766. this.SendPropertyChanged("MaxTemp");
  767. this.OnMaxTempChanged();
  768. }
  769. }
  770. }
  771. [Column(Storage="_MinTemp", DbType="Int")]
  772. public System.Nullable<int> MinTemp
  773. {
  774. get
  775. {
  776. return this._MinTemp;
  777. }
  778. set
  779. {
  780. if ((this._MinTemp != value))
  781. {
  782. this.OnMinTempChanging(value);
  783. this.SendPropertyChanging();
  784. this._MinTemp = value;
  785. this.SendPropertyChanged("MinTemp");
  786. this.OnMinTempChanged();
  787. }
  788. }
  789. }
  790. [Column(Storage="_MaxHumidity", DbType="Int")]
  791. public System.Nullable<int> MaxHumidity
  792. {
  793. get
  794. {
  795. return this._MaxHumidity;
  796. }
  797. set
  798. {
  799. if ((this._MaxHumidity != value))
  800. {
  801. this.OnMaxHumidityChanging(value);
  802. this.SendPropertyChanging();
  803. this._MaxHumidity = value;
  804. this.SendPropertyChanged("MaxHumidity");
  805. this.OnMaxHumidityChanged();
  806. }
  807. }
  808. }
  809. [Column(Storage="_MinHumidity", DbType="Int")]
  810. public System.Nullable<int> MinHumidity
  811. {
  812. get
  813. {
  814. return this._MinHumidity;
  815. }
  816. set
  817. {
  818. if ((this._MinHumidity != value))
  819. {
  820. this.OnMinHumidityChanging(value);
  821. this.SendPropertyChanging();
  822. this._MinHumidity = value;
  823. this.SendPropertyChanged("MinHumidity");
  824. this.OnMinHumidityChanged();
  825. }
  826. }
  827. }
  828. [Column(Storage="_DateCreated", DbType="DateTime NOT NULL")]
  829. public System.DateTime DateCreated
  830. {
  831. get
  832. {
  833. return this._DateCreated;
  834. }
  835. set
  836. {
  837. if ((this._DateCreated != value))
  838. {
  839. this.OnDateCreatedChanging(value);
  840. this.SendPropertyChanging();
  841. this._DateCreated = value;
  842. this.SendPropertyChanged("DateCreated");
  843. this.OnDateCreatedChanged();
  844. }
  845. }
  846. }
  847. [Column(Storage="_DateDeleted", DbType="DateTime")]
  848. public System.Nullable<System.DateTime> DateDeleted
  849. {
  850. get
  851. {
  852. return this._DateDeleted;
  853. }
  854. set
  855. {
  856. if ((this._DateDeleted != value))
  857. {
  858. this.OnDateDeletedChanging(value);
  859. this.SendPropertyChanging();
  860. this._DateDeleted = value;
  861. this.SendPropertyChanged("DateDeleted");
  862. this.OnDateDeletedChanged();
  863. }
  864. }
  865. }
  866. [Association(Name="Environment_Schedule", Storage="_Schedules", ThisKey="EnvironmentId", OtherKey="EnviromentId")]
  867. public EntitySet<Schedule> Schedules
  868. {
  869. get
  870. {
  871. return this._Schedules;
  872. }
  873. set
  874. {
  875. this._Schedules.Assign(value);
  876. }
  877. }
  878. [Association(Name="Environment_Section", Storage="_Sections", ThisKey="EnvironmentId", OtherKey="EnviromentId")]
  879. public EntitySet<Section> Sections
  880. {
  881. get
  882. {
  883. return this._Sections;
  884. }
  885. set
  886. {
  887. this._Sections.Assign(value);
  888. }
  889. }
  890. [Association(Name="Crop_Environment", Storage="_Crop", ThisKey="CropId", OtherKey="CropId", IsForeignKey=true)]
  891. public Crop Crop
  892. {
  893. get
  894. {
  895. return this._Crop.Entity;
  896. }
  897. set
  898. {
  899. Crop previousValue = this._Crop.Entity;
  900. if (((previousValue != value)
  901. || (this._Crop.HasLoadedOrAssignedValue == false)))
  902. {
  903. this.SendPropertyChanging();
  904. if ((previousValue != null))
  905. {
  906. this._Crop.Entity = null;
  907. previousValue.Environments.Remove(this);
  908. }
  909. this._Crop.Entity = value;
  910. if ((value != null))
  911. {
  912. value.Environments.Add(this);
  913. this._CropId = value.CropId;
  914. }
  915. else
  916. {
  917. this._CropId = default(int);
  918. }
  919. this.SendPropertyChanged("Crop");
  920. }
  921. }
  922. }
  923. public event PropertyChangingEventHandler PropertyChanging;
  924. public event PropertyChangedEventHandler PropertyChanged;
  925. protected virtual void SendPropertyChanging()
  926. {
  927. if ((this.PropertyChanging != null))
  928. {
  929. this.PropertyChanging(this, emptyChangingEventArgs);
  930. }
  931. }
  932. protected virtual void SendPropertyChanged(String propertyName)
  933. {
  934. if ((this.PropertyChanged != null))
  935. {
  936. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  937. }
  938. }
  939. private void attach_Schedules(Schedule entity)
  940. {
  941. this.SendPropertyChanging();
  942. entity.Environment = this;
  943. }
  944. private void detach_Schedules(Schedule entity)
  945. {
  946. this.SendPropertyChanging();
  947. entity.Environment = null;
  948. }
  949. private void attach_Sections(Section entity)
  950. {
  951. this.SendPropertyChanging();
  952. entity.Environment = this;
  953. }
  954. private void detach_Sections(Section entity)
  955. {
  956. this.SendPropertyChanging();
  957. entity.Environment = null;
  958. }
  959. }
  960. [Table(Name="dbo.dvent_Greenhouse")]
  961. public partial class Greenhouse : INotifyPropertyChanging, INotifyPropertyChanged
  962. {
  963. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  964. private int _GreenhouseId;
  965. private int _Width;
  966. private int _Height;
  967. private int _Length;
  968. private int _LocationId;
  969. private EntitySet<Section> _Sections;
  970. private EntityRef<Location> _Location;
  971. #region Extensibility Method Definitions
  972. partial void OnLoaded();
  973. partial void OnValidate(System.Data.Linq.ChangeAction action);
  974. partial void OnCreated();
  975. partial void OnGreenhouseIdChanging(int value);
  976. partial void OnGreenhouseIdChanged();
  977. partial void OnWidthChanging(int value);
  978. partial void OnWidthChanged();
  979. partial void OnHeightChanging(int value);
  980. partial void OnHeightChanged();
  981. partial void OnLengthChanging(int value);
  982. partial void OnLengthChanged();
  983. partial void OnLocationIdChanging(int value);
  984. partial void OnLocationIdChanged();
  985. #endregion
  986. public Greenhouse()
  987. {
  988. this._Sections = new EntitySet<Section>(new Action<Section>(this.attach_Sections), new Action<Section>(this.detach_Sections));
  989. this._Location = default(EntityRef<Location>);
  990. OnCreated();
  991. }
  992. [Column(Storage="_GreenhouseId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  993. public int GreenhouseId
  994. {
  995. get
  996. {
  997. return this._GreenhouseId;
  998. }
  999. set
  1000. {
  1001. if ((this._GreenhouseId != value))
  1002. {
  1003. this.OnGreenhouseIdChanging(value);
  1004. this.SendPropertyChanging();
  1005. this._GreenhouseId = value;
  1006. this.SendPropertyChanged("GreenhouseId");
  1007. this.OnGreenhouseIdChanged();
  1008. }
  1009. }
  1010. }
  1011. [Column(Storage="_Width", DbType="Int NOT NULL")]
  1012. public int Width
  1013. {
  1014. get
  1015. {
  1016. return this._Width;
  1017. }
  1018. set
  1019. {
  1020. if ((this._Width != value))
  1021. {
  1022. this.OnWidthChanging(value);
  1023. this.SendPropertyChanging();
  1024. this._Width = value;
  1025. this.SendPropertyChanged("Width");
  1026. this.OnWidthChanged();
  1027. }
  1028. }
  1029. }
  1030. [Column(Storage="_Height", DbType="Int NOT NULL")]
  1031. public int Height
  1032. {
  1033. get
  1034. {
  1035. return this._Height;
  1036. }
  1037. set
  1038. {
  1039. if ((this._Height != value))
  1040. {
  1041. this.OnHeightChanging(value);
  1042. this.SendPropertyChanging();
  1043. this._Height = value;
  1044. this.SendPropertyChanged("Height");
  1045. this.OnHeightChanged();
  1046. }
  1047. }
  1048. }
  1049. [Column(Storage="_Length", DbType="Int NOT NULL")]
  1050. public int Length
  1051. {
  1052. get
  1053. {
  1054. return this._Length;
  1055. }
  1056. set
  1057. {
  1058. if ((this._Length != value))
  1059. {
  1060. this.OnLengthChanging(value);
  1061. this.SendPropertyChanging();
  1062. this._Length = value;
  1063. this.SendPropertyChanged("Length");
  1064. this.OnLengthChanged();
  1065. }
  1066. }
  1067. }
  1068. [Column(Storage="_LocationId", DbType="Int NOT NULL")]
  1069. public int LocationId
  1070. {
  1071. get
  1072. {
  1073. return this._LocationId;
  1074. }
  1075. set
  1076. {
  1077. if ((this._LocationId != value))
  1078. {
  1079. if (this._Location.HasLoadedOrAssignedValue)
  1080. {
  1081. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1082. }
  1083. this.OnLocationIdChanging(value);
  1084. this.SendPropertyChanging();
  1085. this._LocationId = value;
  1086. this.SendPropertyChanged("LocationId");
  1087. this.OnLocationIdChanged();
  1088. }
  1089. }
  1090. }
  1091. [Association(Name="Greenhouse_Section", Storage="_Sections", ThisKey="GreenhouseId", OtherKey="GreenhouseId")]
  1092. public EntitySet<Section> Sections
  1093. {
  1094. get
  1095. {
  1096. return this._Sections;
  1097. }
  1098. set
  1099. {
  1100. this._Sections.Assign(value);
  1101. }
  1102. }
  1103. [Association(Name="Location_Greenhouse", Storage="_Location", ThisKey="LocationId", OtherKey="LocationId", IsForeignKey=true)]
  1104. public Location Location
  1105. {
  1106. get
  1107. {
  1108. return this._Location.Entity;
  1109. }
  1110. set
  1111. {
  1112. Location previousValue = this._Location.Entity;
  1113. if (((previousValue != value)
  1114. || (this._Location.HasLoadedOrAssignedValue == false)))
  1115. {
  1116. this.SendPropertyChanging();
  1117. if ((previousValue != null))
  1118. {
  1119. this._Location.Entity = null;
  1120. previousValue.Greenhouses.Remove(this);
  1121. }
  1122. this._Location.Entity = value;
  1123. if ((value != null))
  1124. {
  1125. value.Greenhouses.Add(this);
  1126. this._LocationId = value.LocationId;
  1127. }
  1128. else
  1129. {
  1130. this._LocationId = default(int);
  1131. }
  1132. this.SendPropertyChanged("Location");
  1133. }
  1134. }
  1135. }
  1136. public event PropertyChangingEventHandler PropertyChanging;
  1137. public event PropertyChangedEventHandler PropertyChanged;
  1138. protected virtual void SendPropertyChanging()
  1139. {
  1140. if ((this.PropertyChanging != null))
  1141. {
  1142. this.PropertyChanging(this, emptyChangingEventArgs);
  1143. }
  1144. }
  1145. protected virtual void SendPropertyChanged(String propertyName)
  1146. {
  1147. if ((this.PropertyChanged != null))
  1148. {
  1149. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1150. }
  1151. }
  1152. private void attach_Sections(Section entity)
  1153. {
  1154. this.SendPropertyChanging();
  1155. entity.Greenhouse = this;
  1156. }
  1157. private void detach_Sections(Section entity)
  1158. {
  1159. this.SendPropertyChanging();
  1160. entity.Greenhouse = null;
  1161. }
  1162. }
  1163. [Table(Name="dbo.dvent_Schedule")]
  1164. public partial class Schedule : INotifyPropertyChanging, INotifyPropertyChanged
  1165. {
  1166. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1167. private int _ScheduleId;
  1168. private System.DateTime _Time;
  1169. private int _interval;
  1170. private int _EnviromentId;
  1171. private int _ScheduleTypeId;
  1172. private System.DateTime _DateCreated;
  1173. private System.Nullable<System.DateTime> _DateDeleted;
  1174. private EntityRef<Environment> _Environment;
  1175. private EntityRef<ScheduleType> _ScheduleType;
  1176. #region Extensibility Method Definitions
  1177. partial void OnLoaded();
  1178. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1179. partial void OnCreated();
  1180. partial void OnScheduleIdChanging(int value);
  1181. partial void OnScheduleIdChanged();
  1182. partial void OnTimeChanging(System.DateTime value);
  1183. partial void OnTimeChanged();
  1184. partial void OnintervalChanging(int value);
  1185. partial void OnintervalChanged();
  1186. partial void OnEnviromentIdChanging(int value);
  1187. partial void OnEnviromentIdChanged();
  1188. partial void OnScheduleTypeIdChanging(int value);
  1189. partial void OnScheduleTypeIdChanged();
  1190. partial void OnDateCreatedChanging(System.DateTime value);
  1191. partial void OnDateCreatedChanged();
  1192. partial void OnDateDeletedChanging(System.Nullable<System.DateTime> value);
  1193. partial void OnDateDeletedChanged();
  1194. #endregion
  1195. public Schedule()
  1196. {
  1197. this._Environment = default(EntityRef<Environment>);
  1198. this._ScheduleType = default(EntityRef<ScheduleType>);
  1199. OnCreated();
  1200. }
  1201. [Column(Storage="_ScheduleId", DbType="Int NOT NULL", IsPrimaryKey=true)]
  1202. public int ScheduleId
  1203. {
  1204. get
  1205. {
  1206. return this._ScheduleId;
  1207. }
  1208. set
  1209. {
  1210. if ((this._ScheduleId != value))
  1211. {
  1212. this.OnScheduleIdChanging(value);
  1213. this.SendPropertyChanging();
  1214. this._ScheduleId = value;
  1215. this.SendPropertyChanged("ScheduleId");
  1216. this.OnScheduleIdChanged();
  1217. }
  1218. }
  1219. }
  1220. [Column(Storage="_Time", DbType="DateTime NOT NULL")]
  1221. public System.DateTime Time
  1222. {
  1223. get
  1224. {
  1225. return this._Time;
  1226. }
  1227. set
  1228. {
  1229. if ((this._Time != value))
  1230. {
  1231. this.OnTimeChanging(value);
  1232. this.SendPropertyChanging();
  1233. this._Time = value;
  1234. this.SendPropertyChanged("Time");
  1235. this.OnTimeChanged();
  1236. }
  1237. }
  1238. }
  1239. [Column(Storage="_interval", DbType="Int NOT NULL")]
  1240. public int interval
  1241. {
  1242. get
  1243. {
  1244. return this._interval;
  1245. }
  1246. set
  1247. {
  1248. if ((this._interval != value))
  1249. {
  1250. this.OnintervalChanging(value);
  1251. this.SendPropertyChanging();
  1252. this._interval = value;
  1253. this.SendPropertyChanged("interval");
  1254. this.OnintervalChanged();
  1255. }
  1256. }
  1257. }
  1258. [Column(Storage="_EnviromentId", DbType="Int NOT NULL")]
  1259. public int EnviromentId
  1260. {
  1261. get
  1262. {
  1263. return this._EnviromentId;
  1264. }
  1265. set
  1266. {
  1267. if ((this._EnviromentId != value))
  1268. {
  1269. if (this._Environment.HasLoadedOrAssignedValue)
  1270. {
  1271. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1272. }
  1273. this.OnEnviromentIdChanging(value);
  1274. this.SendPropertyChanging();
  1275. this._EnviromentId = value;
  1276. this.SendPropertyChanged("EnviromentId");
  1277. this.OnEnviromentIdChanged();
  1278. }
  1279. }
  1280. }
  1281. [Column(Storage="_ScheduleTypeId", DbType="Int NOT NULL")]
  1282. public int ScheduleTypeId
  1283. {
  1284. get
  1285. {
  1286. return this._ScheduleTypeId;
  1287. }
  1288. set
  1289. {
  1290. if ((this._ScheduleTypeId != value))
  1291. {
  1292. if (this._ScheduleType.HasLoadedOrAssignedValue)
  1293. {
  1294. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1295. }
  1296. this.OnScheduleTypeIdChanging(value);
  1297. this.SendPropertyChanging();
  1298. this._ScheduleTypeId = value;
  1299. this.SendPropertyChanged("ScheduleTypeId");
  1300. this.OnScheduleTypeIdChanged();
  1301. }
  1302. }
  1303. }
  1304. [Column(Storage="_DateCreated", DbType="DateTime NOT NULL")]
  1305. public System.DateTime DateCreated
  1306. {
  1307. get
  1308. {
  1309. return this._DateCreated;
  1310. }
  1311. set
  1312. {
  1313. if ((this._DateCreated != value))
  1314. {
  1315. this.OnDateCreatedChanging(value);
  1316. this.SendPropertyChanging();
  1317. this._DateCreated = value;
  1318. this.SendPropertyChanged("DateCreated");
  1319. this.OnDateCreatedChanged();
  1320. }
  1321. }
  1322. }
  1323. [Column(Storage="_DateDeleted", DbType="DateTime")]
  1324. public System.Nullable<System.DateTime> DateDeleted
  1325. {
  1326. get
  1327. {
  1328. return this._DateDeleted;
  1329. }
  1330. set
  1331. {
  1332. if ((this._DateDeleted != value))
  1333. {
  1334. this.OnDateDeletedChanging(value);
  1335. this.SendPropertyChanging();
  1336. this._DateDeleted = value;
  1337. this.SendPropertyChanged("DateDeleted");
  1338. this.OnDateDeletedChanged();
  1339. }
  1340. }
  1341. }
  1342. [Association(Name="Environment_Schedule", Storage="_Environment", ThisKey="EnviromentId", OtherKey="EnvironmentId", IsForeignKey=true)]
  1343. public Environment Environment
  1344. {
  1345. get
  1346. {
  1347. return this._Environment.Entity;
  1348. }
  1349. set
  1350. {
  1351. Environment previousValue = this._Environment.Entity;
  1352. if (((previousValue != value)
  1353. || (this._Environment.HasLoadedOrAssignedValue == false)))
  1354. {
  1355. this.SendPropertyChanging();
  1356. if ((previousValue != null))
  1357. {
  1358. this._Environment.Entity = null;
  1359. previousValue.Schedules.Remove(this);
  1360. }
  1361. this._Environment.Entity = value;
  1362. if ((value != null))
  1363. {
  1364. value.Schedules.Add(this);
  1365. this._EnviromentId = value.EnvironmentId;
  1366. }
  1367. else
  1368. {
  1369. this._EnviromentId = default(int);
  1370. }
  1371. this.SendPropertyChanged("Environment");
  1372. }
  1373. }
  1374. }
  1375. [Association(Name="ScheduleType_Schedule", Storage="_ScheduleType", ThisKey="ScheduleTypeId", OtherKey="ScheduleTypeId", IsForeignKey=true)]
  1376. public ScheduleType ScheduleType
  1377. {
  1378. get
  1379. {
  1380. return this._ScheduleType.Entity;
  1381. }
  1382. set
  1383. {
  1384. ScheduleType previousValue = this._ScheduleType.Entity;
  1385. if (((previousValue != value)
  1386. || (this._ScheduleType.HasLoadedOrAssignedValue == false)))
  1387. {
  1388. this.SendPropertyChanging();
  1389. if ((previousValue != null))
  1390. {
  1391. this._ScheduleType.Entity = null;
  1392. previousValue.Schedules.Remove(this);
  1393. }
  1394. this._ScheduleType.Entity = value;
  1395. if ((value != null))
  1396. {
  1397. value.Schedules.Add(this);
  1398. this._ScheduleTypeId = value.ScheduleTypeId;
  1399. }
  1400. else
  1401. {
  1402. this._ScheduleTypeId = default(int);
  1403. }
  1404. this.SendPropertyChanged("ScheduleType");
  1405. }
  1406. }
  1407. }
  1408. public event PropertyChangingEventHandler PropertyChanging;
  1409. public event PropertyChangedEventHandler PropertyChanged;
  1410. protected virtual void SendPropertyChanging()
  1411. {
  1412. if ((this.PropertyChanging != null))
  1413. {
  1414. this.PropertyChanging(this, emptyChangingEventArgs);
  1415. }
  1416. }
  1417. protected virtual void SendPropertyChanged(String propertyName)
  1418. {
  1419. if ((this.PropertyChanged != null))
  1420. {
  1421. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1422. }
  1423. }
  1424. }
  1425. [Table(Name="dbo.dvent_ScheduleType")]
  1426. public partial class ScheduleType : INotifyPropertyChanging, INotifyPropertyChanged
  1427. {
  1428. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1429. private int _ScheduleTypeId;
  1430. private string _name;
  1431. private EntitySet<Schedule> _Schedules;
  1432. #region Extensibility Method Definitions
  1433. partial void OnLoaded();
  1434. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1435. partial void OnCreated();
  1436. partial void OnScheduleTypeIdChanging(int value);
  1437. partial void OnScheduleTypeIdChanged();
  1438. partial void OnnameChanging(string value);
  1439. partial void OnnameChanged();
  1440. #endregion
  1441. public ScheduleType()
  1442. {
  1443. this._Schedules = new EntitySet<Schedule>(new Action<Schedule>(this.attach_Schedules), new Action<Schedule>(this.detach_Schedules));
  1444. OnCreated();
  1445. }
  1446. [Column(Storage="_ScheduleTypeId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1447. public int ScheduleTypeId
  1448. {
  1449. get
  1450. {
  1451. return this._ScheduleTypeId;
  1452. }
  1453. set
  1454. {
  1455. if ((this._ScheduleTypeId != value))
  1456. {
  1457. this.OnScheduleTypeIdChanging(value);
  1458. this.SendPropertyChanging();
  1459. this._ScheduleTypeId = value;
  1460. this.SendPropertyChanged("ScheduleTypeId");
  1461. this.OnScheduleTypeIdChanged();
  1462. }
  1463. }
  1464. }
  1465. [Column(Storage="_name", DbType="NVarChar(253) NOT NULL", CanBeNull=false)]
  1466. public string name
  1467. {
  1468. get
  1469. {
  1470. return this._name;
  1471. }
  1472. set
  1473. {
  1474. if ((this._name != value))
  1475. {
  1476. this.OnnameChanging(value);
  1477. this.SendPropertyChanging();
  1478. this._name = value;
  1479. this.SendPropertyChanged("name");
  1480. this.OnnameChanged();
  1481. }
  1482. }
  1483. }
  1484. [Association(Name="ScheduleType_Schedule", Storage="_Schedules", ThisKey="ScheduleTypeId", OtherKey="ScheduleTypeId")]
  1485. public EntitySet<Schedule> Schedules
  1486. {
  1487. get
  1488. {
  1489. return this._Schedules;
  1490. }
  1491. set
  1492. {
  1493. this._Schedules.Assign(value);
  1494. }
  1495. }
  1496. public event PropertyChangingEventHandler PropertyChanging;
  1497. public event PropertyChangedEventHandler PropertyChanged;
  1498. protected virtual void SendPropertyChanging()
  1499. {
  1500. if ((this.PropertyChanging != null))
  1501. {
  1502. this.PropertyChanging(this, emptyChangingEventArgs);
  1503. }
  1504. }
  1505. protected virtual void SendPropertyChanged(String propertyName)
  1506. {
  1507. if ((this.PropertyChanged != null))
  1508. {
  1509. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1510. }
  1511. }
  1512. private void attach_Schedules(Schedule entity)
  1513. {
  1514. this.SendPropertyChanging();
  1515. entity.ScheduleType = this;
  1516. }
  1517. private void detach_Schedules(Schedule entity)
  1518. {
  1519. this.SendPropertyChanging();
  1520. entity.ScheduleType = null;
  1521. }
  1522. }
  1523. [Table(Name="dbo.dvent_Section")]
  1524. public partial class Section : INotifyPropertyChanging, INotifyPropertyChanged
  1525. {
  1526. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1527. private int _SectionId;
  1528. private int _GreenhouseId;
  1529. private int _EnviromentId;
  1530. private int _CropId;
  1531. private string _Name;
  1532. private System.Nullable<int> _OwnerId;
  1533. private int _Length;
  1534. private int _Width;
  1535. private int _Height;
  1536. private EntitySet<SectionLog> _SectionLogs;
  1537. private EntityRef<Environment> _Environment;
  1538. private EntityRef<Greenhouse> _Greenhouse;
  1539. #region Extensibility Method Definitions
  1540. partial void OnLoaded();
  1541. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1542. partial void OnCreated();
  1543. partial void OnSectionIdChanging(int value);
  1544. partial void OnSectionIdChanged();
  1545. partial void OnGreenhouseIdChanging(int value);
  1546. partial void OnGreenhouseIdChanged();
  1547. partial void OnEnviromentIdChanging(int value);
  1548. partial void OnEnviromentIdChanged();
  1549. partial void OnCropIdChanging(int value);
  1550. partial void OnCropIdChanged();
  1551. partial void OnNameChanging(string value);
  1552. partial void OnNameChanged();
  1553. partial void OnCustomerIdChanging(System.Nullable<int> value);
  1554. partial void OnCustomerIdChanged();
  1555. partial void OnLengthChanging(int value);
  1556. partial void OnLengthChanged();
  1557. partial void OnWidthChanging(int value);
  1558. partial void OnWidthChanged();
  1559. partial void OnHeightChanging(int value);
  1560. partial void OnHeightChanged();
  1561. #endregion
  1562. public Section()
  1563. {
  1564. this._SectionLogs = new EntitySet<SectionLog>(new Action<SectionLog>(this.attach_SectionLogs), new Action<SectionLog>(this.detach_SectionLogs));
  1565. this._Environment = default(EntityRef<Environment>);
  1566. this._Greenhouse = default(EntityRef<Greenhouse>);
  1567. OnCreated();
  1568. }
  1569. [Column(Storage="_SectionId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1570. public int SectionId
  1571. {
  1572. get
  1573. {
  1574. return this._SectionId;
  1575. }
  1576. set
  1577. {
  1578. if ((this._SectionId != value))
  1579. {
  1580. this.OnSectionIdChanging(value);
  1581. this.SendPropertyChanging();
  1582. this._SectionId = value;
  1583. this.SendPropertyChanged("SectionId");
  1584. this.OnSectionIdChanged();
  1585. }
  1586. }
  1587. }
  1588. [Column(Storage="_GreenhouseId", DbType="Int NOT NULL")]
  1589. public int GreenhouseId
  1590. {
  1591. get
  1592. {
  1593. return this._GreenhouseId;
  1594. }
  1595. set
  1596. {
  1597. if ((this._GreenhouseId != value))
  1598. {
  1599. if (this._Greenhouse.HasLoadedOrAssignedValue)
  1600. {
  1601. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1602. }
  1603. this.OnGreenhouseIdChanging(value);
  1604. this.SendPropertyChanging();
  1605. this._GreenhouseId = value;
  1606. this.SendPropertyChanged("GreenhouseId");
  1607. this.OnGreenhouseIdChanged();
  1608. }
  1609. }
  1610. }
  1611. [Column(Storage="_EnviromentId", DbType="Int NOT NULL")]
  1612. public int EnviromentId
  1613. {
  1614. get
  1615. {
  1616. return this._EnviromentId;
  1617. }
  1618. set
  1619. {
  1620. if ((this._EnviromentId != value))
  1621. {
  1622. if (this._Environment.HasLoadedOrAssignedValue)
  1623. {
  1624. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  1625. }
  1626. this.OnEnviromentIdChanging(value);
  1627. this.SendPropertyChanging();
  1628. this._EnviromentId = value;
  1629. this.SendPropertyChanged("EnviromentId");
  1630. this.OnEnviromentIdChanged();
  1631. }
  1632. }
  1633. }
  1634. [Column(Storage="_CropId", DbType="Int NOT NULL")]
  1635. public int CropId
  1636. {
  1637. get
  1638. {
  1639. return this._CropId;
  1640. }
  1641. set
  1642. {
  1643. if ((this._CropId != value))
  1644. {
  1645. this.OnCropIdChanging(value);
  1646. this.SendPropertyChanging();
  1647. this._CropId = value;
  1648. this.SendPropertyChanged("CropId");
  1649. this.OnCropIdChanged();
  1650. }
  1651. }
  1652. }
  1653. [Column(Storage="_Name", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
  1654. public string Name
  1655. {
  1656. get
  1657. {
  1658. return this._Name;
  1659. }
  1660. set
  1661. {
  1662. if ((this._Name != value))
  1663. {
  1664. this.OnNameChanging(value);
  1665. this.SendPropertyChanging();
  1666. this._Name = value;
  1667. this.SendPropertyChanged("Name");
  1668. this.OnNameChanged();
  1669. }
  1670. }
  1671. }
  1672. [Column(Name="OwnerId", Storage="_OwnerId", DbType="Int")]
  1673. public System.Nullable<int> CustomerId
  1674. {
  1675. get
  1676. {
  1677. return this._OwnerId;
  1678. }
  1679. set
  1680. {
  1681. if ((this._OwnerId != value))
  1682. {
  1683. this.OnCustomerIdChanging(value);
  1684. this.SendPropertyChanging();
  1685. this._OwnerId = value;
  1686. this.SendPropertyChanged("CustomerId");
  1687. this.OnCustomerIdChanged();
  1688. }
  1689. }
  1690. }
  1691. [Column(Storage="_Length", DbType="Int NOT NULL")]
  1692. public int Length
  1693. {
  1694. get
  1695. {
  1696. return this._Length;
  1697. }
  1698. set
  1699. {
  1700. if ((this._Length != value))
  1701. {
  1702. this.OnLengthChanging(value);
  1703. this.SendPropertyChanging();
  1704. this._Length = value;
  1705. this.SendPropertyChanged("Length");
  1706. this.OnLengthChanged();
  1707. }
  1708. }
  1709. }
  1710. [Column(Storage="_Width", DbType="Int NOT NULL")]
  1711. public int Width
  1712. {
  1713. get
  1714. {
  1715. return this._Width;
  1716. }
  1717. set
  1718. {
  1719. if ((this._Width != value))
  1720. {
  1721. this.OnWidthChanging(value);
  1722. this.SendPropertyChanging();
  1723. this._Width = value;
  1724. this.SendPropertyChanged("Width");
  1725. this.OnWidthChanged();
  1726. }
  1727. }
  1728. }
  1729. [Column(Storage="_Height", DbType="Int NOT NULL")]
  1730. public int Height
  1731. {
  1732. get
  1733. {
  1734. return this._Height;
  1735. }
  1736. set
  1737. {
  1738. if ((this._Height != value))
  1739. {
  1740. this.OnHeightChanging(value);
  1741. this.SendPropertyChanging();
  1742. this._Height = value;
  1743. this.SendPropertyChanged("Height");
  1744. this.OnHeightChanged();
  1745. }
  1746. }
  1747. }
  1748. [Association(Name="Section_SectionLog", Storage="_SectionLogs", ThisKey="SectionId", OtherKey="SectionId")]
  1749. public EntitySet<SectionLog> SectionLogs
  1750. {
  1751. get
  1752. {
  1753. return this._SectionLogs;
  1754. }
  1755. set
  1756. {
  1757. this._SectionLogs.Assign(value);
  1758. }
  1759. }
  1760. [Association(Name="Environment_Section", Storage="_Environment", ThisKey="EnviromentId", OtherKey="EnvironmentId", IsForeignKey=true)]
  1761. public Environment Environment
  1762. {
  1763. get
  1764. {
  1765. return this._Environment.Entity;
  1766. }
  1767. set
  1768. {
  1769. Environment previousValue = this._Environment.Entity;
  1770. if (((previousValue != value)
  1771. || (this._Environment.HasLoadedOrAssignedValue == false)))
  1772. {
  1773. this.SendPropertyChanging();
  1774. if ((previousValue != null))
  1775. {
  1776. this._Environment.Entity = null;
  1777. previousValue.Sections.Remove(this);
  1778. }
  1779. this._Environment.Entity = value;
  1780. if ((value != null))
  1781. {
  1782. value.Sections.Add(this);
  1783. this._EnviromentId = value.EnvironmentId;
  1784. }
  1785. else
  1786. {
  1787. this._EnviromentId = default(int);
  1788. }
  1789. this.SendPropertyChanged("Environment");
  1790. }
  1791. }
  1792. }
  1793. [Association(Name="Greenhouse_Section", Storage="_Greenhouse", ThisKey="GreenhouseId", OtherKey="GreenhouseId", IsForeignKey=true)]
  1794. public Greenhouse Greenhouse
  1795. {
  1796. get
  1797. {
  1798. return this._Greenhouse.Entity;
  1799. }
  1800. set
  1801. {
  1802. Greenhouse previousValue = this._Greenhouse.Entity;
  1803. if (((previousValue != value)
  1804. || (this._Greenhouse.HasLoadedOrAssignedValue == false)))
  1805. {
  1806. this.SendPropertyChanging();
  1807. if ((previousValue != null))
  1808. {
  1809. this._Greenhouse.Entity = null;
  1810. previousValue.Sections.Remove(this);
  1811. }
  1812. this._Greenhouse.Entity = value;
  1813. if ((value != null))
  1814. {
  1815. value.Sections.Add(this);
  1816. this._GreenhouseId = value.GreenhouseId;
  1817. }
  1818. else
  1819. {
  1820. this._GreenhouseId = default(int);
  1821. }
  1822. this.SendPropertyChanged("Greenhouse");
  1823. }
  1824. }
  1825. }
  1826. public event PropertyChangingEventHandler PropertyChanging;
  1827. public event PropertyChangedEventHandler PropertyChanged;
  1828. protected virtual void SendPropertyChanging()
  1829. {
  1830. if ((this.PropertyChanging != null))
  1831. {
  1832. this.PropertyChanging(this, emptyChangingEventArgs);
  1833. }
  1834. }
  1835. protected virtual void SendPropertyChanged(String propertyName)
  1836. {
  1837. if ((this.PropertyChanged != null))
  1838. {
  1839. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  1840. }
  1841. }
  1842. private void attach_SectionLogs(SectionLog entity)
  1843. {
  1844. this.SendPropertyChanging();
  1845. entity.Section = this;
  1846. }
  1847. private void detach_SectionLogs(SectionLog entity)
  1848. {
  1849. this.SendPropertyChanging();
  1850. entity.Section = null;
  1851. }
  1852. }
  1853. [Table(Name="dbo.dvent_Location")]
  1854. public partial class Location : INotifyPropertyChanging, INotifyPropertyChanged
  1855. {
  1856. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  1857. private int _LocationId;
  1858. private string _City;
  1859. private string _State;
  1860. private string _AddressLine1;
  1861. private string _AddressLine2;
  1862. private System.Nullable<int> _Zip;
  1863. private string _Country;
  1864. private EntitySet<Greenhouse> _Greenhouses;
  1865. #region Extensibility Method Definitions
  1866. partial void OnLoaded();
  1867. partial void OnValidate(System.Data.Linq.ChangeAction action);
  1868. partial void OnCreated();
  1869. partial void OnLocationIdChanging(int value);
  1870. partial void OnLocationIdChanged();
  1871. partial void OnCityChanging(string value);
  1872. partial void OnCityChanged();
  1873. partial void OnStateChanging(string value);
  1874. partial void OnStateChanged();
  1875. partial void OnAddressLine1Changing(string value);
  1876. partial void OnAddressLine1Changed();
  1877. partial void OnAddressLine2Changing(string value);
  1878. partial void OnAddressLine2Changed();
  1879. partial void OnZipChanging(System.Nullable<int> value);
  1880. partial void OnZipChanged();
  1881. partial void OnCountryChanging(string value);
  1882. partial void OnCountryChanged();
  1883. #endregion
  1884. public Location()
  1885. {
  1886. this._Greenhouses = new EntitySet<Greenhouse>(new Action<Greenhouse>(this.attach_Greenhouses), new Action<Greenhouse>(this.detach_Greenhouses));
  1887. OnCreated();
  1888. }
  1889. [Column(Storage="_LocationId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  1890. public int LocationId
  1891. {
  1892. get
  1893. {
  1894. return this._LocationId;
  1895. }
  1896. set
  1897. {
  1898. if ((this._LocationId != value))
  1899. {
  1900. this.OnLocationIdChanging(value);
  1901. this.SendPropertyChanging();
  1902. this._LocationId = value;
  1903. this.SendPropertyChanged("LocationId");
  1904. this.OnLocationIdChanged();
  1905. }
  1906. }
  1907. }
  1908. [Column(Storage="_City", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
  1909. public string City
  1910. {
  1911. get
  1912. {
  1913. return this._City;
  1914. }
  1915. set
  1916. {
  1917. if ((this._City != value))
  1918. {
  1919. this.OnCityChanging(value);
  1920. this.SendPropertyChanging();
  1921. this._City = value;
  1922. this.SendPropertyChanged("City");
  1923. this.OnCityChanged();
  1924. }
  1925. }
  1926. }
  1927. [Column(Storage="_State", DbType="NVarChar(50)")]
  1928. public string State
  1929. {
  1930. get
  1931. {
  1932. return this._State;
  1933. }
  1934. set
  1935. {
  1936. if ((this._State != value))
  1937. {
  1938. this.OnStateChanging(value);
  1939. this.SendPropertyChanging();
  1940. this._State = value;
  1941. this.SendPropertyChanged("State");
  1942. this.OnStateChanged();
  1943. }
  1944. }
  1945. }
  1946. [Column(Storage="_AddressLine1", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
  1947. public string AddressLine1
  1948. {
  1949. get
  1950. {
  1951. return this._AddressLine1;
  1952. }
  1953. set
  1954. {
  1955. if ((this._AddressLine1 != value))
  1956. {
  1957. this.OnAddressLine1Changing(value);
  1958. this.SendPropertyChanging();
  1959. this._AddressLine1 = value;
  1960. this.SendPropertyChanged("AddressLine1");
  1961. this.OnAddressLine1Changed();
  1962. }
  1963. }
  1964. }
  1965. [Column(Storage="_AddressLine2", DbType="NVarChar(255)")]
  1966. public string AddressLine2
  1967. {
  1968. get
  1969. {
  1970. return this._AddressLine2;
  1971. }
  1972. set
  1973. {
  1974. if ((this._AddressLine2 != value))
  1975. {
  1976. this.OnAddressLine2Changing(value);
  1977. this.SendPropertyChanging();
  1978. this._AddressLine2 = value;
  1979. this.SendPropertyChanged("AddressLine2");
  1980. this.OnAddressLine2Changed();
  1981. }
  1982. }
  1983. }
  1984. [Column(Storage="_Zip", DbType="Int")]
  1985. public System.Nullable<int> Zip
  1986. {
  1987. get
  1988. {
  1989. return this._Zip;
  1990. }
  1991. set
  1992. {
  1993. if ((this._Zip != value))
  1994. {
  1995. this.OnZipChanging(value);
  1996. this.SendPropertyChanging();
  1997. this._Zip = value;
  1998. this.SendPropertyChanged("Zip");
  1999. this.OnZipChanged();
  2000. }
  2001. }
  2002. }
  2003. [Column(Storage="_Country", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
  2004. public string Country
  2005. {
  2006. get
  2007. {
  2008. return this._Country;
  2009. }
  2010. set
  2011. {
  2012. if ((this._Country != value))
  2013. {
  2014. this.OnCountryChanging(value);
  2015. this.SendPropertyChanging();
  2016. this._Country = value;
  2017. this.SendPropertyChanged("Country");
  2018. this.OnCountryChanged();
  2019. }
  2020. }
  2021. }
  2022. [Association(Name="Location_Greenhouse", Storage="_Greenhouses", ThisKey="LocationId", OtherKey="LocationId")]
  2023. public EntitySet<Greenhouse> Greenhouses
  2024. {
  2025. get
  2026. {
  2027. return this._Greenhouses;
  2028. }
  2029. set
  2030. {
  2031. this._Greenhouses.Assign(value);
  2032. }
  2033. }
  2034. public event PropertyChangingEventHandler PropertyChanging;
  2035. public event PropertyChangedEventHandler PropertyChanged;
  2036. protected virtual void SendPropertyChanging()
  2037. {
  2038. if ((this.PropertyChanging != null))
  2039. {
  2040. this.PropertyChanging(this, emptyChangingEventArgs);
  2041. }
  2042. }
  2043. protected virtual void SendPropertyChanged(String propertyName)
  2044. {
  2045. if ((this.PropertyChanged != null))
  2046. {
  2047. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  2048. }
  2049. }
  2050. private void attach_Greenhouses(Greenhouse entity)
  2051. {
  2052. this.SendPropertyChanging();
  2053. entity.Location = this;
  2054. }
  2055. private void detach_Greenhouses(Greenhouse entity)
  2056. {
  2057. this.SendPropertyChanging();
  2058. entity.Location = null;
  2059. }
  2060. }
  2061. [Table(Name="dbo.aspnet_Membership")]
  2062. public partial class Membership : INotifyPropertyChanging, INotifyPropertyChanged
  2063. {
  2064. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  2065. private System.Guid _ApplicationId;
  2066. private System.Guid _UserId;
  2067. private string _Password;
  2068. private int _PasswordFormat;
  2069. private string _PasswordSalt;
  2070. private string _MobilePIN;
  2071. private string _Email;
  2072. private string _LoweredEmail;
  2073. private string _PasswordQuestion;
  2074. private string _PasswordAnswer;
  2075. private bool _IsApproved;
  2076. private bool _IsLockedOut;
  2077. private System.DateTime _CreateDate;
  2078. private System.DateTime _LastLoginDate;
  2079. private System.DateTime _LastPasswordChangedDate;
  2080. private System.DateTime _LastLockoutDate;
  2081. private int _FailedPasswordAttemptCount;
  2082. private System.DateTime _FailedPasswordAttemptWindowStart;
  2083. private int _FailedPasswordAnswerAttemptCount;
  2084. private System.DateTime _FailedPasswordAnswerAttemptWindowStart;
  2085. private string _Comment;
  2086. private EntityRef<User> _User;
  2087. #region Extensibility Method Definitions
  2088. partial void OnLoaded();
  2089. partial void OnValidate(System.Data.Linq.ChangeAction action);
  2090. partial void OnCreated();
  2091. partial void OnApplicationIdChanging(System.Guid value);
  2092. partial void OnApplicationIdChanged();
  2093. partial void OnUserIdChanging(System.Guid value);
  2094. partial void OnUserIdChanged();
  2095. partial void OnPasswordChanging(string value);
  2096. partial void OnPasswordChanged();
  2097. partial void OnPasswordFormatChanging(int value);
  2098. partial void OnPasswordFormatChanged();
  2099. partial void OnPasswordSaltChanging(string value);
  2100. partial void OnPasswordSaltChanged();
  2101. partial void OnMobilePINChanging(string value);
  2102. partial void OnMobilePINChanged();
  2103. partial void OnEmailChanging(string value);
  2104. partial void OnEmailChanged();
  2105. partial void OnLoweredEmailChanging(string value);
  2106. partial void OnLoweredEmailChanged();
  2107. partial void OnPasswordQuestionChanging(string value);
  2108. partial void OnPasswordQuestionChanged();
  2109. partial void OnPasswordAnswerChanging(string value);
  2110. partial void OnPasswordAnswerChanged();
  2111. partial void OnIsApprovedChanging(bool value);
  2112. partial void OnIsApprovedChanged();
  2113. partial void OnIsLockedOutChanging(bool value);
  2114. partial void OnIsLockedOutChanged();
  2115. partial void OnCreateDateChanging(System.DateTime value);
  2116. partial void OnCreateDateChanged();
  2117. partial void OnLastLoginDateChanging(System.DateTime value);
  2118. partial void OnLastLoginDateChanged();
  2119. partial void OnLastPasswordChangedDateChanging(System.DateTime value);
  2120. partial void OnLastPasswordChangedDateChanged();
  2121. partial void OnLastLockoutDateChanging(System.DateTime value);
  2122. partial void OnLastLockoutDateChanged();
  2123. partial void OnFailedPasswordAttemptCountChanging(int value);
  2124. partial void OnFailedPasswordAttemptCountChanged();
  2125. partial void OnFailedPasswordAttemptWindowStartChanging(System.DateTime value);
  2126. partial void OnFailedPasswordAttemptWindowStartChanged();
  2127. partial void OnFailedPasswordAnswerAttemptCountChanging(int value);
  2128. partial void OnFailedPasswordAnswerAttemptCountChanged();
  2129. partial void OnFailedPasswordAnswerAttemptWindowStartChanging(System.DateTime value);
  2130. partial void OnFailedPasswordAnswerAttemptWindowStartChanged();
  2131. partial void OnCommentChanging(string value);
  2132. partial void OnCommentChanged();
  2133. #endregion
  2134. public Membership()
  2135. {
  2136. this._User = default(EntityRef<User>);
  2137. OnCreated();
  2138. }
  2139. [Column(Storage="_ApplicationId", DbType="UniqueIdentifier NOT NULL")]
  2140. public System.Guid ApplicationId
  2141. {
  2142. get
  2143. {
  2144. return this._ApplicationId;
  2145. }
  2146. set
  2147. {
  2148. if ((this._ApplicationId != value))
  2149. {
  2150. this.OnApplicationIdChanging(value);
  2151. this.SendPropertyChanging();
  2152. this._ApplicationId = value;
  2153. this.SendPropertyChanged("ApplicationId");
  2154. this.OnApplicationIdChanged();
  2155. }
  2156. }
  2157. }
  2158. [Column(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
  2159. public System.Guid UserId
  2160. {
  2161. get
  2162. {
  2163. return this._UserId;
  2164. }
  2165. set
  2166. {
  2167. if ((this._UserId != value))
  2168. {
  2169. if (this._User.HasLoadedOrAssignedValue)
  2170. {
  2171. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  2172. }
  2173. this.OnUserIdChanging(value);
  2174. this.SendPropertyChanging();
  2175. this._UserId = value;
  2176. this.SendPropertyChanged("UserId");
  2177. this.OnUserIdChanged();
  2178. }
  2179. }
  2180. }
  2181. [Column(Storage="_Password", DbType="NVarChar(128) NOT NULL", CanBeNull=false)]
  2182. public string Password
  2183. {
  2184. get
  2185. {
  2186. return this._Password;
  2187. }
  2188. set
  2189. {
  2190. if ((this._Password != value))
  2191. {
  2192. this.OnPasswordChanging(value);
  2193. this.SendPropertyChanging();
  2194. this._Password = value;
  2195. this.SendPropertyChanged("Password");
  2196. this.OnPasswordChanged();
  2197. }
  2198. }
  2199. }
  2200. [Column(Storage="_PasswordFormat", DbType="Int NOT NULL")]
  2201. public int PasswordFormat
  2202. {
  2203. get
  2204. {
  2205. return this._PasswordFormat;
  2206. }
  2207. set
  2208. {
  2209. if ((this._PasswordFormat != value))
  2210. {
  2211. this.OnPasswordFormatChanging(value);
  2212. this.SendPropertyChanging();
  2213. this._PasswordFormat = value;
  2214. this.SendPropertyChanged("PasswordFormat");
  2215. this.OnPasswordFormatChanged();
  2216. }
  2217. }
  2218. }
  2219. [Column(Storage="_PasswordSalt", DbType="NVarChar(128) NOT NULL", CanBeNull=false)]
  2220. public string PasswordSalt
  2221. {
  2222. get
  2223. {
  2224. return this._PasswordSalt;
  2225. }
  2226. set
  2227. {
  2228. if ((this._PasswordSalt != value))
  2229. {
  2230. this.OnPasswordSaltChanging(value);
  2231. this.SendPropertyChanging();
  2232. this._PasswordSalt = value;
  2233. this.SendPropertyChanged("PasswordSalt");
  2234. this.OnPasswordSaltChanged();
  2235. }
  2236. }
  2237. }
  2238. [Column(Storage="_MobilePIN", DbType="NVarChar(16)")]
  2239. public string MobilePIN
  2240. {
  2241. get
  2242. {
  2243. return this._MobilePIN;
  2244. }
  2245. set
  2246. {
  2247. if ((this._MobilePIN != value))
  2248. {
  2249. this.OnMobilePINChanging(value);
  2250. this.SendPropertyChanging();
  2251. this._MobilePIN = value;
  2252. this.SendPropertyChanged("MobilePIN");
  2253. this.OnMobilePINChanged();
  2254. }
  2255. }
  2256. }
  2257. [Column(Storage="_Email", DbType="NVarChar(256)")]
  2258. public string Email
  2259. {
  2260. get
  2261. {
  2262. return this._Email;
  2263. }
  2264. set
  2265. {
  2266. if ((this._Email != value))
  2267. {
  2268. this.OnEmailChanging(value);
  2269. this.SendPropertyChanging();
  2270. this._Email = value;
  2271. this.SendPropertyChanged("Email");
  2272. this.OnEmailChanged();
  2273. }
  2274. }
  2275. }
  2276. [Column(Storage="_LoweredEmail", DbType="NVarChar(256)")]
  2277. public string LoweredEmail
  2278. {
  2279. get
  2280. {
  2281. return this._LoweredEmail;
  2282. }
  2283. set
  2284. {
  2285. if ((this._LoweredEmail != value))
  2286. {
  2287. this.OnLoweredEmailChanging(value);
  2288. this.SendPropertyChanging();
  2289. this._LoweredEmail = value;
  2290. this.SendPropertyChanged("LoweredEmail");
  2291. this.OnLoweredEmailChanged();
  2292. }
  2293. }
  2294. }
  2295. [Column(Storage="_PasswordQuestion", DbType="NVarChar(256)")]
  2296. public string PasswordQuestion
  2297. {
  2298. get
  2299. {
  2300. return this._PasswordQuestion;
  2301. }
  2302. set
  2303. {
  2304. if ((this._PasswordQuestion != value))
  2305. {
  2306. this.OnPasswordQuestionChanging(value);
  2307. this.SendPropertyChanging();
  2308. this._PasswordQuestion = value;
  2309. this.SendPropertyChanged("PasswordQuestion");
  2310. this.OnPasswordQuestionChanged();
  2311. }
  2312. }
  2313. }
  2314. [Column(Storage="_PasswordAnswer", DbType="NVarChar(128)")]
  2315. public string PasswordAnswer
  2316. {
  2317. get
  2318. {
  2319. return this._PasswordAnswer;
  2320. }
  2321. set
  2322. {
  2323. if ((this._PasswordAnswer != value))
  2324. {
  2325. this.OnPasswordAnswerChanging(value);
  2326. this.SendPropertyChanging();
  2327. this._PasswordAnswer = value;
  2328. this.SendPropertyChanged("PasswordAnswer");
  2329. this.OnPasswordAnswerChanged();
  2330. }
  2331. }
  2332. }
  2333. [Column(Storage="_IsApproved", DbType="Bit NOT NULL")]
  2334. public bool IsApproved
  2335. {
  2336. get
  2337. {
  2338. return this._IsApproved;
  2339. }
  2340. set
  2341. {
  2342. if ((this._IsApproved != value))
  2343. {
  2344. this.OnIsApprovedChanging(value);
  2345. this.SendPropertyChanging();
  2346. this._IsApproved = value;
  2347. this.SendPropertyChanged("IsApproved");
  2348. this.OnIsApprovedChanged();
  2349. }
  2350. }
  2351. }
  2352. [Column(Storage="_IsLockedOut", DbType="Bit NOT NULL")]
  2353. public bool IsLockedOut
  2354. {
  2355. get
  2356. {
  2357. return this._IsLockedOut;
  2358. }
  2359. set
  2360. {
  2361. if ((this._IsLockedOut != value))
  2362. {
  2363. this.OnIsLockedOutChanging(value);
  2364. this.SendPropertyChanging();
  2365. this._IsLockedOut = value;
  2366. this.SendPropertyChanged("IsLockedOut");
  2367. this.OnIsLockedOutChanged();
  2368. }
  2369. }
  2370. }
  2371. [Column(Storage="_CreateDate", DbType="DateTime NOT NULL")]
  2372. public System.DateTime CreateDate
  2373. {
  2374. get
  2375. {
  2376. return this._CreateDate;
  2377. }
  2378. set
  2379. {
  2380. if ((this._CreateDate != value))
  2381. {
  2382. this.OnCreateDateChanging(value);
  2383. this.SendPropertyChanging();
  2384. this._CreateDate = value;
  2385. this.SendPropertyChanged("CreateDate");
  2386. this.OnCreateDateChanged();
  2387. }
  2388. }
  2389. }
  2390. [Column(Storage="_LastLoginDate", DbType="DateTime NOT NULL")]
  2391. public System.DateTime LastLoginDate
  2392. {
  2393. get
  2394. {
  2395. return this._LastLoginDate;
  2396. }
  2397. set
  2398. {
  2399. if ((this._LastLoginDate != value))
  2400. {
  2401. this.OnLastLoginDateChanging(value);
  2402. this.SendPropertyChanging();
  2403. this._LastLoginDate = value;
  2404. this.SendPropertyChanged("LastLoginDate");
  2405. this.OnLastLoginDateChanged();
  2406. }
  2407. }
  2408. }
  2409. [Column(Storage="_LastPasswordChangedDate", DbType="DateTime NOT NULL")]
  2410. public System.DateTime LastPasswordChangedDate
  2411. {
  2412. get
  2413. {
  2414. return this._LastPasswordChangedDate;
  2415. }
  2416. set
  2417. {
  2418. if ((this._LastPasswordChangedDate != value))
  2419. {
  2420. this.OnLastPasswordChangedDateChanging(value);
  2421. this.SendPropertyChanging();
  2422. this._LastPasswordChangedDate = value;
  2423. this.SendPropertyChanged("LastPasswordChangedDate");
  2424. this.OnLastPasswordChangedDateChanged();
  2425. }
  2426. }
  2427. }
  2428. [Column(Storage="_LastLockoutDate", DbType="DateTime NOT NULL")]
  2429. public System.DateTime LastLockoutDate
  2430. {
  2431. get
  2432. {
  2433. return this._LastLockoutDate;
  2434. }
  2435. set
  2436. {
  2437. if ((this._LastLockoutDate != value))
  2438. {
  2439. this.OnLastLockoutDateChanging(value);
  2440. this.SendPropertyChanging();
  2441. this._LastLockoutDate = value;
  2442. this.SendPropertyChanged("LastLockoutDate");
  2443. this.OnLastLockoutDateChanged();
  2444. }
  2445. }
  2446. }
  2447. [Column(Storage="_FailedPasswordAttemptCount", DbType="Int NOT NULL")]
  2448. public int FailedPasswordAttemptCount
  2449. {
  2450. get
  2451. {
  2452. return this._FailedPasswordAttemptCount;
  2453. }
  2454. set
  2455. {
  2456. if ((this._FailedPasswordAttemptCount != value))
  2457. {
  2458. this.OnFailedPasswordAttemptCountChanging(value);
  2459. this.SendPropertyChanging();
  2460. this._FailedPasswordAttemptCount = value;
  2461. this.SendPropertyChanged("FailedPasswordAttemptCount");
  2462. this.OnFailedPasswordAttemptCountChanged();
  2463. }
  2464. }
  2465. }
  2466. [Column(Storage="_FailedPasswordAttemptWindowStart", DbType="DateTime NOT NULL")]
  2467. public System.DateTime FailedPasswordAttemptWindowStart
  2468. {
  2469. get
  2470. {
  2471. return this._FailedPasswordAttemptWindowStart;
  2472. }
  2473. set
  2474. {
  2475. if ((this._FailedPasswordAttemptWindowStart != value))
  2476. {
  2477. this.OnFailedPasswordAttemptWindowStartChanging(value);
  2478. this.SendPropertyChanging();
  2479. this._FailedPasswordAttemptWindowStart = value;
  2480. this.SendPropertyChanged("FailedPasswordAttemptWindowStart");
  2481. this.OnFailedPasswordAttemptWindowStartChanged();
  2482. }
  2483. }
  2484. }
  2485. [Column(Storage="_FailedPasswordAnswerAttemptCount", DbType="Int NOT NULL")]
  2486. public int FailedPasswordAnswerAttemptCount
  2487. {
  2488. get
  2489. {
  2490. return this._FailedPasswordAnswerAttemptCount;
  2491. }
  2492. set
  2493. {
  2494. if ((this._FailedPasswordAnswerAttemptCount != value))
  2495. {
  2496. this.OnFailedPasswordAnswerAttemptCountChanging(value);
  2497. this.SendPropertyChanging();
  2498. this._FailedPasswordAnswerAttemptCount = value;
  2499. this.SendPropertyChanged("FailedPasswordAnswerAttemptCount");
  2500. this.OnFailedPasswordAnswerAttemptCountChanged();
  2501. }
  2502. }
  2503. }
  2504. [Column(Storage="_FailedPasswordAnswerAttemptWindowStart", DbType="DateTime NOT NULL")]
  2505. public System.DateTime FailedPasswordAnswerAttemptWindowStart
  2506. {
  2507. get
  2508. {
  2509. return this._FailedPasswordAnswerAttemptWindowStart;
  2510. }
  2511. set
  2512. {
  2513. if ((this._FailedPasswordAnswerAttemptWindowStart != value))
  2514. {
  2515. this.OnFailedPasswordAnswerAttemptWindowStartChanging(value);
  2516. this.SendPropertyChanging();
  2517. this._FailedPasswordAnswerAttemptWindowStart = value;
  2518. this.SendPropertyChanged("FailedPasswordAnswerAttemptWindowStart");
  2519. this.OnFailedPasswordAnswerAttemptWindowStartChanged();
  2520. }
  2521. }
  2522. }
  2523. [Column(Storage="_Comment", DbType="NText", UpdateCheck=UpdateCheck.Never)]
  2524. public string Comment
  2525. {
  2526. get
  2527. {
  2528. return this._Comment;
  2529. }
  2530. set
  2531. {
  2532. if ((this._Comment != value))
  2533. {
  2534. this.OnCommentChanging(value);
  2535. this.SendPropertyChanging();
  2536. this._Comment = value;
  2537. this.SendPropertyChanged("Comment");
  2538. this.OnCommentChanged();
  2539. }
  2540. }
  2541. }
  2542. [Association(Name="aspnet_User_aspnet_Membership", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true)]
  2543. public User User
  2544. {
  2545. get
  2546. {
  2547. return this._User.Entity;
  2548. }
  2549. set
  2550. {
  2551. User previousValue = this._User.Entity;
  2552. if (((previousValue != value)
  2553. || (this._User.HasLoadedOrAssignedValue == false)))
  2554. {
  2555. this.SendPropertyChanging();
  2556. if ((previousValue != null))
  2557. {
  2558. this._User.Entity = null;
  2559. previousValue.Membership = null;
  2560. }
  2561. this._User.Entity = value;
  2562. if ((value != null))
  2563. {
  2564. value.Membership = this;
  2565. this._UserId = value.UserId;
  2566. }
  2567. else
  2568. {
  2569. this._UserId = default(System.Guid);
  2570. }
  2571. this.SendPropertyChanged("User");
  2572. }
  2573. }
  2574. }
  2575. public event PropertyChangingEventHandler PropertyChanging;
  2576. public event PropertyChangedEventHandler PropertyChanged;
  2577. protected virtual void SendPropertyChanging()
  2578. {
  2579. if ((this.PropertyChanging != null))
  2580. {
  2581. this.PropertyChanging(this, emptyChangingEventArgs);
  2582. }
  2583. }
  2584. protected virtual void SendPropertyChanged(String propertyName)
  2585. {
  2586. if ((this.PropertyChanged != null))
  2587. {
  2588. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  2589. }
  2590. }
  2591. }
  2592. [Table(Name="dbo.aspnet_Users")]
  2593. public partial class User : INotifyPropertyChanging, INotifyPropertyChanged
  2594. {
  2595. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  2596. private System.Guid _ApplicationId;
  2597. private System.Guid _UserId;
  2598. private string _UserName;
  2599. private string _LoweredUserName;
  2600. private string _MobileAlias;
  2601. private bool _IsAnonymous;
  2602. private System.DateTime _LastActivityDate;
  2603. private EntityRef<Membership> _Membership;
  2604. private EntitySet<Customer> _Customers;
  2605. #region Extensibility Method Definitions
  2606. partial void OnLoaded();
  2607. partial void OnValidate(System.Data.Linq.ChangeAction action);
  2608. partial void OnCreated();
  2609. partial void OnApplicationIdChanging(System.Guid value);
  2610. partial void OnApplicationIdChanged();
  2611. partial void OnUserIdChanging(System.Guid value);
  2612. partial void OnUserIdChanged();
  2613. partial void OnUserNameChanging(string value);
  2614. partial void OnUserNameChanged();
  2615. partial void OnLoweredUserNameChanging(string value);
  2616. partial void OnLoweredUserNameChanged();
  2617. partial void OnMobileAliasChanging(string value);
  2618. partial void OnMobileAliasChanged();
  2619. partial void OnIsAnonymousChanging(bool value);
  2620. partial void OnIsAnonymousChanged();
  2621. partial void OnLastActivityDateChanging(System.DateTime value);
  2622. partial void OnLastActivityDateChanged();
  2623. #endregion
  2624. public User()
  2625. {
  2626. this._Membership = default(EntityRef<Membership>);
  2627. this._Customers = new EntitySet<Customer>(new Action<Customer>(this.attach_Customers), new Action<Customer>(this.detach_Customers));
  2628. OnCreated();
  2629. }
  2630. [Column(Storage="_ApplicationId", DbType="UniqueIdentifier NOT NULL")]
  2631. public System.Guid ApplicationId
  2632. {
  2633. get
  2634. {
  2635. return this._ApplicationId;
  2636. }
  2637. set
  2638. {
  2639. if ((this._ApplicationId != value))
  2640. {
  2641. this.OnApplicationIdChanging(value);
  2642. this.SendPropertyChanging();
  2643. this._ApplicationId = value;
  2644. this.SendPropertyChanged("ApplicationId");
  2645. this.OnApplicationIdChanged();
  2646. }
  2647. }
  2648. }
  2649. [Column(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
  2650. public System.Guid UserId
  2651. {
  2652. get
  2653. {
  2654. return this._UserId;
  2655. }
  2656. set
  2657. {
  2658. if ((this._UserId != value))
  2659. {
  2660. this.OnUserIdChanging(value);
  2661. this.SendPropertyChanging();
  2662. this._UserId = value;
  2663. this.SendPropertyChanged("UserId");
  2664. this.OnUserIdChanged();
  2665. }
  2666. }
  2667. }
  2668. [Column(Storage="_UserName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
  2669. public string UserName
  2670. {
  2671. get
  2672. {
  2673. return this._UserName;
  2674. }
  2675. set
  2676. {
  2677. if ((this._UserName != value))
  2678. {
  2679. this.OnUserNameChanging(value);
  2680. this.SendPropertyChanging();
  2681. this._UserName = value;
  2682. this.SendPropertyChanged("UserName");
  2683. this.OnUserNameChanged();
  2684. }
  2685. }
  2686. }
  2687. [Column(Storage="_LoweredUserName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
  2688. public string LoweredUserName
  2689. {
  2690. get
  2691. {
  2692. return this._LoweredUserName;
  2693. }
  2694. set
  2695. {
  2696. if ((this._LoweredUserName != value))
  2697. {
  2698. this.OnLoweredUserNameChanging(value);
  2699. this.SendPropertyChanging();
  2700. this._LoweredUserName = value;
  2701. this.SendPropertyChanged("LoweredUserName");
  2702. this.OnLoweredUserNameChanged();
  2703. }
  2704. }
  2705. }
  2706. [Column(Storage="_MobileAlias", DbType="NVarChar(16)")]
  2707. public string MobileAlias
  2708. {
  2709. get
  2710. {
  2711. return this._MobileAlias;
  2712. }
  2713. set
  2714. {
  2715. if ((this._MobileAlias != value))
  2716. {
  2717. this.OnMobileAliasChanging(value);
  2718. this.SendPropertyChanging();
  2719. this._MobileAlias = value;
  2720. this.SendPropertyChanged("MobileAlias");
  2721. this.OnMobileAliasChanged();
  2722. }
  2723. }
  2724. }
  2725. [Column(Storage="_IsAnonymous", DbType="Bit NOT NULL")]
  2726. public bool IsAnonymous
  2727. {
  2728. get
  2729. {
  2730. return this._IsAnonymous;
  2731. }
  2732. set
  2733. {
  2734. if ((this._IsAnonymous != value))
  2735. {
  2736. this.OnIsAnonymousChanging(value);
  2737. this.SendPropertyChanging();
  2738. this._IsAnonymous = value;
  2739. this.SendPropertyChanged("IsAnonymous");
  2740. this.OnIsAnonymousChanged();
  2741. }
  2742. }
  2743. }
  2744. [Column(Storage="_LastActivityDate", DbType="DateTime NOT NULL")]
  2745. public System.DateTime LastActivityDate
  2746. {
  2747. get
  2748. {
  2749. return this._LastActivityDate;
  2750. }
  2751. set
  2752. {
  2753. if ((this._LastActivityDate != value))
  2754. {
  2755. this.OnLastActivityDateChanging(value);
  2756. this.SendPropertyChanging();
  2757. this._LastActivityDate = value;
  2758. this.SendPropertyChanged("LastActivityDate");
  2759. this.OnLastActivityDateChanged();
  2760. }
  2761. }
  2762. }
  2763. [Association(Name="aspnet_User_aspnet_Membership", Storage="_Membership", ThisKey="UserId", OtherKey="UserId", IsUnique=true, IsForeignKey=false)]
  2764. public Membership Membership
  2765. {
  2766. get
  2767. {
  2768. return this._Membership.Entity;
  2769. }
  2770. set
  2771. {
  2772. Membership previousValue = this._Membership.Entity;
  2773. if (((previousValue != value)
  2774. || (this._Membership.HasLoadedOrAssignedValue == false)))
  2775. {
  2776. this.SendPropertyChanging();
  2777. if ((previousValue != null))
  2778. {
  2779. this._Membership.Entity = null;
  2780. previousValue.User = null;
  2781. }
  2782. this._Membership.Entity = value;
  2783. if ((value != null))
  2784. {
  2785. value.User = this;
  2786. }
  2787. this.SendPropertyChanged("Membership");
  2788. }
  2789. }
  2790. }
  2791. [Association(Name="aspnet_User_dvent_Customer", Storage="_Customers", ThisKey="UserId", OtherKey="UserId")]
  2792. public EntitySet<Customer> Customers
  2793. {
  2794. get
  2795. {
  2796. return this._Customers;
  2797. }
  2798. set
  2799. {
  2800. this._Customers.Assign(value);
  2801. }
  2802. }
  2803. public event PropertyChangingEventHandler PropertyChanging;
  2804. public event PropertyChangedEventHandler PropertyChanged;
  2805. protected virtual void SendPropertyChanging()
  2806. {
  2807. if ((this.PropertyChanging != null))
  2808. {
  2809. this.PropertyChanging(this, emptyChangingEventArgs);
  2810. }
  2811. }
  2812. protected virtual void SendPropertyChanged(String propertyName)
  2813. {
  2814. if ((this.PropertyChanged != null))
  2815. {
  2816. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  2817. }
  2818. }
  2819. private void attach_Customers(Customer entity)
  2820. {
  2821. this.SendPropertyChanging();
  2822. entity.User = this;
  2823. }
  2824. private void detach_Customers(Customer entity)
  2825. {
  2826. this.SendPropertyChanging();
  2827. entity.User = null;
  2828. }
  2829. }
  2830. [Table(Name="dbo.dvent_Customer")]
  2831. public partial class Customer : INotifyPropertyChanging, INotifyPropertyChanged
  2832. {
  2833. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  2834. private int _CustomerId;
  2835. private string _FirstName;
  2836. private string _LastName;
  2837. private string _Address1;
  2838. private string _Address2;
  2839. private string _Phone;
  2840. private string _Email;
  2841. private string _Username;
  2842. private string _Password;
  2843. private string _AddedBy;
  2844. private string _ModifiedBy;
  2845. private System.DateTime _DateAdded;
  2846. private System.Nullable<System.DateTime> _DateModified;
  2847. private System.Nullable<System.Guid> _UserId;
  2848. private EntityRef<User> _User;
  2849. #region Extensibility Method Definitions
  2850. partial void OnLoaded();
  2851. partial void OnValidate(System.Data.Linq.ChangeAction action);
  2852. partial void OnCreated();
  2853. partial void OnCustomerIdChanging(int value);
  2854. partial void OnCustomerIdChanged();
  2855. partial void OnFirstNameChanging(string value);
  2856. partial void OnFirstNameChanged();
  2857. partial void OnLastNameChanging(string value);
  2858. partial void OnLastNameChanged();
  2859. partial void OnAddress1Changing(string value);
  2860. partial void OnAddress1Changed();
  2861. partial void OnAddress2Changing(string value);
  2862. partial void OnAddress2Changed();
  2863. partial void OnPhoneChanging(string value);
  2864. partial void OnPhoneChanged();
  2865. partial void OnEmailChanging(string value);
  2866. partial void OnEmailChanged();
  2867. partial void OnUsernameChanging(string value);
  2868. partial void OnUsernameChanged();
  2869. partial void OnPasswordChanging(string value);
  2870. partial void OnPasswordChanged();
  2871. partial void OnAddedByChanging(string value);
  2872. partial void OnAddedByChanged();
  2873. partial void OnModifiedByChanging(string value);
  2874. partial void OnModifiedByChanged();
  2875. partial void OnDateAddedChanging(System.DateTime value);
  2876. partial void OnDateAddedChanged();
  2877. partial void OnDateModifiedChanging(System.Nullable<System.DateTime> value);
  2878. partial void OnDateModifiedChanged();
  2879. partial void OnUserIdChanging(System.Nullable<System.Guid> value);
  2880. partial void OnUserIdChanged();
  2881. #endregion
  2882. public Customer()
  2883. {
  2884. this._User = default(EntityRef<User>);
  2885. OnCreated();
  2886. }
  2887. [Column(Storage="_CustomerId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  2888. public int CustomerId
  2889. {
  2890. get
  2891. {
  2892. return this._CustomerId;
  2893. }
  2894. set
  2895. {
  2896. if ((this._CustomerId != value))
  2897. {
  2898. this.OnCustomerIdChanging(value);
  2899. this.SendPropertyChanging();
  2900. this._CustomerId = value;
  2901. this.SendPropertyChanged("CustomerId");
  2902. this.OnCustomerIdChanged();
  2903. }
  2904. }
  2905. }
  2906. [Column(Storage="_FirstName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  2907. public string FirstName
  2908. {
  2909. get
  2910. {
  2911. return this._FirstName;
  2912. }
  2913. set
  2914. {
  2915. if ((this._FirstName != value))
  2916. {
  2917. this.OnFirstNameChanging(value);
  2918. this.SendPropertyChanging();
  2919. this._FirstName = value;
  2920. this.SendPropertyChanged("FirstName");
  2921. this.OnFirstNameChanged();
  2922. }
  2923. }
  2924. }
  2925. [Column(Storage="_LastName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  2926. public string LastName
  2927. {
  2928. get
  2929. {
  2930. return this._LastName;
  2931. }
  2932. set
  2933. {
  2934. if ((this._LastName != value))
  2935. {
  2936. this.OnLastNameChanging(value);
  2937. this.SendPropertyChanging();
  2938. this._LastName = value;
  2939. this.SendPropertyChanged("LastName");
  2940. this.OnLastNameChanged();
  2941. }
  2942. }
  2943. }
  2944. [Column(Storage="_Address1", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
  2945. public string Address1
  2946. {
  2947. get
  2948. {
  2949. return this._Address1;
  2950. }
  2951. set
  2952. {
  2953. if ((this._Address1 != value))
  2954. {
  2955. this.OnAddress1Changing(value);
  2956. this.SendPropertyChanging();
  2957. this._Address1 = value;
  2958. this.SendPropertyChanged("Address1");
  2959. this.OnAddress1Changed();
  2960. }
  2961. }
  2962. }
  2963. [Column(Storage="_Address2", DbType="NVarChar(50)")]
  2964. public string Address2
  2965. {
  2966. get
  2967. {
  2968. return this._Address2;
  2969. }
  2970. set
  2971. {
  2972. if ((this._Address2 != value))
  2973. {
  2974. this.OnAddress2Changing(value);
  2975. this.SendPropertyChanging();
  2976. this._Address2 = value;
  2977. this.SendPropertyChanged("Address2");
  2978. this.OnAddress2Changed();
  2979. }
  2980. }
  2981. }
  2982. [Column(Storage="_Phone", DbType="NVarChar(10) NOT NULL", CanBeNull=false)]
  2983. public string Phone
  2984. {
  2985. get
  2986. {
  2987. return this._Phone;
  2988. }
  2989. set
  2990. {
  2991. if ((this._Phone != value))
  2992. {
  2993. this.OnPhoneChanging(value);
  2994. this.SendPropertyChanging();
  2995. this._Phone = value;
  2996. this.SendPropertyChanged("Phone");
  2997. this.OnPhoneChanged();
  2998. }
  2999. }
  3000. }
  3001. [Column(Storage="_Email", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  3002. public string Email
  3003. {
  3004. get
  3005. {
  3006. return this._Email;
  3007. }
  3008. set
  3009. {
  3010. if ((this._Email != value))
  3011. {
  3012. this.OnEmailChanging(value);
  3013. this.SendPropertyChanging();
  3014. this._Email = value;
  3015. this.SendPropertyChanged("Email");
  3016. this.OnEmailChanged();
  3017. }
  3018. }
  3019. }
  3020. [Column(Storage="_Username", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  3021. public string Username
  3022. {
  3023. get
  3024. {
  3025. return this._Username;
  3026. }
  3027. set
  3028. {
  3029. if ((this._Username != value))
  3030. {
  3031. this.OnUsernameChanging(value);
  3032. this.SendPropertyChanging();
  3033. this._Username = value;
  3034. this.SendPropertyChanged("Username");
  3035. this.OnUsernameChanged();
  3036. }
  3037. }
  3038. }
  3039. [Column(Storage="_Password", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  3040. public string Password
  3041. {
  3042. get
  3043. {
  3044. return this._Password;
  3045. }
  3046. set
  3047. {
  3048. if ((this._Password != value))
  3049. {
  3050. this.OnPasswordChanging(value);
  3051. this.SendPropertyChanging();
  3052. this._Password = value;
  3053. this.SendPropertyChanged("Password");
  3054. this.OnPasswordChanged();
  3055. }
  3056. }
  3057. }
  3058. [Column(Storage="_AddedBy", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  3059. public string AddedBy
  3060. {
  3061. get
  3062. {
  3063. return this._AddedBy;
  3064. }
  3065. set
  3066. {
  3067. if ((this._AddedBy != value))
  3068. {
  3069. this.OnAddedByChanging(value);
  3070. this.SendPropertyChanging();
  3071. this._AddedBy = value;
  3072. this.SendPropertyChanged("AddedBy");
  3073. this.OnAddedByChanged();
  3074. }
  3075. }
  3076. }
  3077. [Column(Storage="_ModifiedBy", DbType="NVarChar(50)")]
  3078. public string ModifiedBy
  3079. {
  3080. get
  3081. {
  3082. return this._ModifiedBy;
  3083. }
  3084. set
  3085. {
  3086. if ((this._ModifiedBy != value))
  3087. {
  3088. this.OnModifiedByChanging(value);
  3089. this.SendPropertyChanging();
  3090. this._ModifiedBy = value;
  3091. this.SendPropertyChanged("ModifiedBy");
  3092. this.OnModifiedByChanged();
  3093. }
  3094. }
  3095. }
  3096. [Column(Storage="_DateAdded", DbType="DateTime NOT NULL")]
  3097. public System.DateTime DateAdded
  3098. {
  3099. get
  3100. {
  3101. return this._DateAdded;
  3102. }
  3103. set
  3104. {
  3105. if ((this._DateAdded != value))
  3106. {
  3107. this.OnDateAddedChanging(value);
  3108. this.SendPropertyChanging();
  3109. this._DateAdded = value;
  3110. this.SendPropertyChanged("DateAdded");
  3111. this.OnDateAddedChanged();
  3112. }
  3113. }
  3114. }
  3115. [Column(Storage="_DateModified", DbType="DateTime")]
  3116. public System.Nullable<System.DateTime> DateModified
  3117. {
  3118. get
  3119. {
  3120. return this._DateModified;
  3121. }
  3122. set
  3123. {
  3124. if ((this._DateModified != value))
  3125. {
  3126. this.OnDateModifiedChanging(value);
  3127. this.SendPropertyChanging();
  3128. this._DateModified = value;
  3129. this.SendPropertyChanged("DateModified");
  3130. this.OnDateModifiedChanged();
  3131. }
  3132. }
  3133. }
  3134. [Column(Storage="_UserId", DbType="UniqueIdentifier")]
  3135. public System.Nullable<System.Guid> UserId
  3136. {
  3137. get
  3138. {
  3139. return this._UserId;
  3140. }
  3141. set
  3142. {
  3143. if ((this._UserId != value))
  3144. {
  3145. if (this._User.HasLoadedOrAssignedValue)
  3146. {
  3147. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  3148. }
  3149. this.OnUserIdChanging(value);
  3150. this.SendPropertyChanging();
  3151. this._UserId = value;
  3152. this.SendPropertyChanged("UserId");
  3153. this.OnUserIdChanged();
  3154. }
  3155. }
  3156. }
  3157. [Association(Name="aspnet_User_dvent_Customer", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true)]
  3158. public User User
  3159. {
  3160. get
  3161. {
  3162. return this._User.Entity;
  3163. }
  3164. set
  3165. {
  3166. User previousValue = this._User.Entity;
  3167. if (((previousValue != value)
  3168. || (this._User.HasLoadedOrAssignedValue == false)))
  3169. {
  3170. this.SendPropertyChanging();
  3171. if ((previousValue != null))
  3172. {
  3173. this._User.Entity = null;
  3174. previousValue.Customers.Remove(this);
  3175. }
  3176. this._User.Entity = value;
  3177. if ((value != null))
  3178. {
  3179. value.Customers.Add(this);
  3180. this._UserId = value.UserId;
  3181. }
  3182. else
  3183. {
  3184. this._UserId = default(Nullable<System.Guid>);
  3185. }
  3186. this.SendPropertyChanged("User");
  3187. }
  3188. }
  3189. }
  3190. public event PropertyChangingEventHandler PropertyChanging;
  3191. public event PropertyChangedEventHandler PropertyChanged;
  3192. protected virtual void SendPropertyChanging()
  3193. {
  3194. if ((this.PropertyChanging != null))
  3195. {
  3196. this.PropertyChanging(this, emptyChangingEventArgs);
  3197. }
  3198. }
  3199. protected virtual void SendPropertyChanged(String propertyName)
  3200. {
  3201. if ((this.PropertyChanged != null))
  3202. {
  3203. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  3204. }
  3205. }
  3206. }
  3207. }
  3208. #pragma warning restore 1591