PageRenderTime 66ms CodeModel.GetById 27ms 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

Large files files are truncated, but you can click here to view the full 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 PropertyCha

Large files files are truncated, but you can click here to view the full file