PageRenderTime 6ms CodeModel.GetById 4ms app.highlight 81ms RepoModel.GetById 1ms 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
  12namespace DV_Enterprises.Web.DAL
  13{
  14	using System.Data.Linq;
  15	using System.Data.Linq.Mapping;
  16	using System.Data;
  17	using System.Collections.Generic;
  18	using System.Reflection;
  19	using System.Linq;
  20	using System.Linq.Expressions;
  21	
  22	
  23	[System.Data.Linq.Mapping.DatabaseAttribute(Name="ASPNETDB")]
  24	public partial class DataContext : System.Data.Linq.DataContext
  25	{
  26		
  27		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
  28		
  29    #region Extensibility Method Definitions
  30    partial void OnCreated();
  31    partial void InsertCrop(DV_Enterprises.Web.BLL.Crop instance);
  32    partial void UpdateCrop(DV_Enterprises.Web.BLL.Crop instance);
  33    partial void DeleteCrop(DV_Enterprises.Web.BLL.Crop instance);
  34    partial void InsertSectionLog(DV_Enterprises.Web.BLL.SectionLog instance);
  35    partial void UpdateSectionLog(DV_Enterprises.Web.BLL.SectionLog instance);
  36    partial void DeleteSectionLog(DV_Enterprises.Web.BLL.SectionLog instance);
  37    partial void InsertEnvironment(DV_Enterprises.Web.BLL.Environment instance);
  38    partial void UpdateEnvironment(DV_Enterprises.Web.BLL.Environment instance);
  39    partial void DeleteEnvironment(DV_Enterprises.Web.BLL.Environment instance);
  40    partial void InsertGreenhouse(DV_Enterprises.Web.BLL.Greenhouse instance);
  41    partial void UpdateGreenhouse(DV_Enterprises.Web.BLL.Greenhouse instance);
  42    partial void DeleteGreenhouse(DV_Enterprises.Web.BLL.Greenhouse instance);
  43    partial void InsertSchedule(DV_Enterprises.Web.BLL.Schedule instance);
  44    partial void UpdateSchedule(DV_Enterprises.Web.BLL.Schedule instance);
  45    partial void DeleteSchedule(DV_Enterprises.Web.BLL.Schedule instance);
  46    partial void InsertScheduleType(DV_Enterprises.Web.BLL.ScheduleType instance);
  47    partial void UpdateScheduleType(DV_Enterprises.Web.BLL.ScheduleType instance);
  48    partial void DeleteScheduleType(DV_Enterprises.Web.BLL.ScheduleType instance);
  49    partial void InsertSection(DV_Enterprises.Web.BLL.Section instance);
  50    partial void UpdateSection(DV_Enterprises.Web.BLL.Section instance);
  51    partial void DeleteSection(DV_Enterprises.Web.BLL.Section instance);
  52    partial void InsertLocation(DV_Enterprises.Web.BLL.Location instance);
  53    partial void UpdateLocation(DV_Enterprises.Web.BLL.Location instance);
  54    partial void DeleteLocation(DV_Enterprises.Web.BLL.Location instance);
  55    partial void InsertMembership(DV_Enterprises.Web.BLL.Membership instance);
  56    partial void UpdateMembership(DV_Enterprises.Web.BLL.Membership instance);
  57    partial void DeleteMembership(DV_Enterprises.Web.BLL.Membership instance);
  58    partial void InsertUser(DV_Enterprises.Web.BLL.User instance);
  59    partial void UpdateUser(DV_Enterprises.Web.BLL.User instance);
  60    partial void DeleteUser(DV_Enterprises.Web.BLL.User instance);
  61    partial void InsertCustomer(DV_Enterprises.Web.BLL.Customer instance);
  62    partial void UpdateCustomer(DV_Enterprises.Web.BLL.Customer instance);
  63    partial void DeleteCustomer(DV_Enterprises.Web.BLL.Customer instance);
  64    #endregion
  65		
  66		public DataContext() : 
  67				base(global::DV_Enterprises.Web.Properties.Settings.Default.ASPNETDBConnectionString, mappingSource)
  68		{
  69			OnCreated();
  70		}
  71		
  72		public DataContext(string connection) : 
  73				base(connection, mappingSource)
  74		{
  75			OnCreated();
  76		}
  77		
  78		public DataContext(System.Data.IDbConnection connection) : 
  79				base(connection, mappingSource)
  80		{
  81			OnCreated();
  82		}
  83		
  84		public DataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
  85				base(connection, mappingSource)
  86		{
  87			OnCreated();
  88		}
  89		
  90		public DataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
  91				base(connection, mappingSource)
  92		{
  93			OnCreated();
  94		}
  95		
  96		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Crop> Crops
  97		{
  98			get
  99			{
 100				return this.GetTable<DV_Enterprises.Web.BLL.Crop>();
 101			}
 102		}
 103		
 104		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.SectionLog> SectionLogs
 105		{
 106			get
 107			{
 108				return this.GetTable<DV_Enterprises.Web.BLL.SectionLog>();
 109			}
 110		}
 111		
 112		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Environment> Environments
 113		{
 114			get
 115			{
 116				return this.GetTable<DV_Enterprises.Web.BLL.Environment>();
 117			}
 118		}
 119		
 120		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Greenhouse> Greenhouses
 121		{
 122			get
 123			{
 124				return this.GetTable<DV_Enterprises.Web.BLL.Greenhouse>();
 125			}
 126		}
 127		
 128		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Schedule> Schedules
 129		{
 130			get
 131			{
 132				return this.GetTable<DV_Enterprises.Web.BLL.Schedule>();
 133			}
 134		}
 135		
 136		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.ScheduleType> ScheduleTypes
 137		{
 138			get
 139			{
 140				return this.GetTable<DV_Enterprises.Web.BLL.ScheduleType>();
 141			}
 142		}
 143		
 144		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Section> Sections
 145		{
 146			get
 147			{
 148				return this.GetTable<DV_Enterprises.Web.BLL.Section>();
 149			}
 150		}
 151		
 152		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Location> Locations
 153		{
 154			get
 155			{
 156				return this.GetTable<DV_Enterprises.Web.BLL.Location>();
 157			}
 158		}
 159		
 160		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Membership> Memberships
 161		{
 162			get
 163			{
 164				return this.GetTable<DV_Enterprises.Web.BLL.Membership>();
 165			}
 166		}
 167		
 168		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.User> Users
 169		{
 170			get
 171			{
 172				return this.GetTable<DV_Enterprises.Web.BLL.User>();
 173			}
 174		}
 175		
 176		public System.Data.Linq.Table<DV_Enterprises.Web.BLL.Customer> Customers
 177		{
 178			get
 179			{
 180				return this.GetTable<DV_Enterprises.Web.BLL.Customer>();
 181			}
 182		}
 183	}
 184}
 185namespace DV_Enterprises.Web.BLL
 186{
 187	using System.Data.Linq;
 188	using System.Data.Linq.Mapping;
 189	using System.ComponentModel;
 190	using System;
 191	
 192	
 193	[Table(Name="dbo.dvent_Crop")]
 194	public partial class Crop : INotifyPropertyChanging, INotifyPropertyChanged
 195	{
 196		
 197		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
 198		
 199		private int _CropId;
 200		
 201		private string _Name;
 202		
 203		private int _Length;
 204		
 205		private int _Width;
 206		
 207		private int _Height;
 208		
 209		private int _MinTemperature;
 210		
 211		private int _MaxTemperature;
 212		
 213		private int _MinHumidity;
 214		
 215		private int _MaxHumidity;
 216		
 217		private System.DateTime _DateCreated;
 218		
 219		private System.Nullable<System.DateTime> _DateDeleted;
 220		
 221		private EntitySet<Environment> _Environments;
 222		
 223    #region Extensibility Method Definitions
 224    partial void OnLoaded();
 225    partial void OnValidate(System.Data.Linq.ChangeAction action);
 226    partial void OnCreated();
 227    partial void OnCropIdChanging(int value);
 228    partial void OnCropIdChanged();
 229    partial void OnNameChanging(string value);
 230    partial void OnNameChanged();
 231    partial void OnLengthChanging(int value);
 232    partial void OnLengthChanged();
 233    partial void OnWidthChanging(int value);
 234    partial void OnWidthChanged();
 235    partial void OnHeightChanging(int value);
 236    partial void OnHeightChanged();
 237    partial void OnMinTemperatureChanging(int value);
 238    partial void OnMinTemperatureChanged();
 239    partial void OnMaxTemperatureChanging(int value);
 240    partial void OnMaxTemperatureChanged();
 241    partial void OnMinHumidityChanging(int value);
 242    partial void OnMinHumidityChanged();
 243    partial void OnMaxHumidityChanging(int value);
 244    partial void OnMaxHumidityChanged();
 245    partial void OnDateCreatedChanging(System.DateTime value);
 246    partial void OnDateCreatedChanged();
 247    partial void OnDateDeletedChanging(System.Nullable<System.DateTime> value);
 248    partial void OnDateDeletedChanged();
 249    #endregion
 250		
 251		public Crop()
 252		{
 253			this._Environments = new EntitySet<Environment>(new Action<Environment>(this.attach_Environments), new Action<Environment>(this.detach_Environments));
 254			OnCreated();
 255		}
 256		
 257		[Column(Storage="_CropId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
 258		public int CropId
 259		{
 260			get
 261			{
 262				return this._CropId;
 263			}
 264			set
 265			{
 266				if ((this._CropId != value))
 267				{
 268					this.OnCropIdChanging(value);
 269					this.SendPropertyChanging();
 270					this._CropId = value;
 271					this.SendPropertyChanged("CropId");
 272					this.OnCropIdChanged();
 273				}
 274			}
 275		}
 276		
 277		[Column(Storage="_Name", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
 278		public string Name
 279		{
 280			get
 281			{
 282				return this._Name;
 283			}
 284			set
 285			{
 286				if ((this._Name != value))
 287				{
 288					this.OnNameChanging(value);
 289					this.SendPropertyChanging();
 290					this._Name = value;
 291					this.SendPropertyChanged("Name");
 292					this.OnNameChanged();
 293				}
 294			}
 295		}
 296		
 297		[Column(Storage="_Length", DbType="Int NOT NULL")]
 298		public int Length
 299		{
 300			get
 301			{
 302				return this._Length;
 303			}
 304			set
 305			{
 306				if ((this._Length != value))
 307				{
 308					this.OnLengthChanging(value);
 309					this.SendPropertyChanging();
 310					this._Length = value;
 311					this.SendPropertyChanged("Length");
 312					this.OnLengthChanged();
 313				}
 314			}
 315		}
 316		
 317		[Column(Storage="_Width", DbType="Int NOT NULL")]
 318		public int Width
 319		{
 320			get
 321			{
 322				return this._Width;
 323			}
 324			set
 325			{
 326				if ((this._Width != value))
 327				{
 328					this.OnWidthChanging(value);
 329					this.SendPropertyChanging();
 330					this._Width = value;
 331					this.SendPropertyChanged("Width");
 332					this.OnWidthChanged();
 333				}
 334			}
 335		}
 336		
 337		[Column(Storage="_Height", DbType="Int NOT NULL")]
 338		public int Height
 339		{
 340			get
 341			{
 342				return this._Height;
 343			}
 344			set
 345			{
 346				if ((this._Height != value))
 347				{
 348					this.OnHeightChanging(value);
 349					this.SendPropertyChanging();
 350					this._Height = value;
 351					this.SendPropertyChanged("Height");
 352					this.OnHeightChanged();
 353				}
 354			}
 355		}
 356		
 357		[Column(Storage="_MinTemperature", DbType="Int NOT NULL")]
 358		public int MinTemperature
 359		{
 360			get
 361			{
 362				return this._MinTemperature;
 363			}
 364			set
 365			{
 366				if ((this._MinTemperature != value))
 367				{
 368					this.OnMinTemperatureChanging(value);
 369					this.SendPropertyChanging();
 370					this._MinTemperature = value;
 371					this.SendPropertyChanged("MinTemperature");
 372					this.OnMinTemperatureChanged();
 373				}
 374			}
 375		}
 376		
 377		[Column(Storage="_MaxTemperature", DbType="Int NOT NULL")]
 378		public int MaxTemperature
 379		{
 380			get
 381			{
 382				return this._MaxTemperature;
 383			}
 384			set
 385			{
 386				if ((this._MaxTemperature != value))
 387				{
 388					this.OnMaxTemperatureChanging(value);
 389					this.SendPropertyChanging();
 390					this._MaxTemperature = value;
 391					this.SendPropertyChanged("MaxTemperature");
 392					this.OnMaxTemperatureChanged();
 393				}
 394			}
 395		}
 396		
 397		[Column(Storage="_MinHumidity", DbType="Int NOT NULL")]
 398		public int MinHumidity
 399		{
 400			get
 401			{
 402				return this._MinHumidity;
 403			}
 404			set
 405			{
 406				if ((this._MinHumidity != value))
 407				{
 408					this.OnMinHumidityChanging(value);
 409					this.SendPropertyChanging();
 410					this._MinHumidity = value;
 411					this.SendPropertyChanged("MinHumidity");
 412					this.OnMinHumidityChanged();
 413				}
 414			}
 415		}
 416		
 417		[Column(Storage="_MaxHumidity", DbType="Int NOT NULL")]
 418		public int MaxHumidity
 419		{
 420			get
 421			{
 422				return this._MaxHumidity;
 423			}
 424			set
 425			{
 426				if ((this._MaxHumidity != value))
 427				{
 428					this.OnMaxHumidityChanging(value);
 429					this.SendPropertyChanging();
 430					this._MaxHumidity = value;
 431					this.SendPropertyChanged("MaxHumidity");
 432					this.OnMaxHumidityChanged();
 433				}
 434			}
 435		}
 436		
 437		[Column(Storage="_DateCreated", DbType="DateTime NOT NULL")]
 438		public System.DateTime DateCreated
 439		{
 440			get
 441			{
 442				return this._DateCreated;
 443			}
 444			set
 445			{
 446				if ((this._DateCreated != value))
 447				{
 448					this.OnDateCreatedChanging(value);
 449					this.SendPropertyChanging();
 450					this._DateCreated = value;
 451					this.SendPropertyChanged("DateCreated");
 452					this.OnDateCreatedChanged();
 453				}
 454			}
 455		}
 456		
 457		[Column(Storage="_DateDeleted", DbType="DateTime")]
 458		public System.Nullable<System.DateTime> DateDeleted
 459		{
 460			get
 461			{
 462				return this._DateDeleted;
 463			}
 464			set
 465			{
 466				if ((this._DateDeleted != value))
 467				{
 468					this.OnDateDeletedChanging(value);
 469					this.SendPropertyChanging();
 470					this._DateDeleted = value;
 471					this.SendPropertyChanged("DateDeleted");
 472					this.OnDateDeletedChanged();
 473				}
 474			}
 475		}
 476		
 477		[Association(Name="Crop_Environment", Storage="_Environments", ThisKey="CropId", OtherKey="CropId")]
 478		public EntitySet<Environment> Environments
 479		{
 480			get
 481			{
 482				return this._Environments;
 483			}
 484			set
 485			{
 486				this._Environments.Assign(value);
 487			}
 488		}
 489		
 490		public event PropertyChangingEventHandler PropertyChanging;
 491		
 492		public event PropertyChangedEventHandler PropertyChanged;
 493		
 494		protected virtual void SendPropertyChanging()
 495		{
 496			if ((this.PropertyChanging != null))
 497			{
 498				this.PropertyChanging(this, emptyChangingEventArgs);
 499			}
 500		}
 501		
 502		protected virtual void SendPropertyChanged(String propertyName)
 503		{
 504			if ((this.PropertyChanged != null))
 505			{
 506				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
 507			}
 508		}
 509		
 510		private void attach_Environments(Environment entity)
 511		{
 512			this.SendPropertyChanging();
 513			entity.Crop = this;
 514		}
 515		
 516		private void detach_Environments(Environment entity)
 517		{
 518			this.SendPropertyChanging();
 519			entity.Crop = null;
 520		}
 521	}
 522	
 523	[Table(Name="dbo.dvent_SectionLog")]
 524	public partial class SectionLog : INotifyPropertyChanging, INotifyPropertyChanged
 525	{
 526		
 527		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
 528		
 529		private int _SectionLogId;
 530		
 531		private System.Data.Linq.Binary _Time;
 532		
 533		private int _Temperature;
 534		
 535		private int _Humidity;
 536		
 537		private bool _isLightOn;
 538		
 539		private int _SectionId;
 540		
 541		private EntityRef<Section> _Section;
 542		
 543    #region Extensibility Method Definitions
 544    partial void OnLoaded();
 545    partial void OnValidate(System.Data.Linq.ChangeAction action);
 546    partial void OnCreated();
 547    partial void OnSectionLogIdChanging(int value);
 548    partial void OnSectionLogIdChanged();
 549    partial void OnTimeChanging(System.Data.Linq.Binary value);
 550    partial void OnTimeChanged();
 551    partial void OnTemperatureChanging(int value);
 552    partial void OnTemperatureChanged();
 553    partial void OnHumidityChanging(int value);
 554    partial void OnHumidityChanged();
 555    partial void OnisLightOnChanging(bool value);
 556    partial void OnisLightOnChanged();
 557    partial void OnSectionIdChanging(int value);
 558    partial void OnSectionIdChanged();
 559    #endregion
 560		
 561		public SectionLog()
 562		{
 563			this._Section = default(EntityRef<Section>);
 564			OnCreated();
 565		}
 566		
 567		[Column(Storage="_SectionLogId", DbType="Int NOT NULL", IsPrimaryKey=true, UpdateCheck=UpdateCheck.Never)]
 568		public int SectionLogId
 569		{
 570			get
 571			{
 572				return this._SectionLogId;
 573			}
 574			set
 575			{
 576				if ((this._SectionLogId != value))
 577				{
 578					this.OnSectionLogIdChanging(value);
 579					this.SendPropertyChanging();
 580					this._SectionLogId = value;
 581					this.SendPropertyChanged("SectionLogId");
 582					this.OnSectionLogIdChanged();
 583				}
 584			}
 585		}
 586		
 587		[Column(Storage="_Time", AutoSync=AutoSync.Always, DbType="rowversion NOT NULL", CanBeNull=false, IsDbGenerated=true, IsVersion=true, UpdateCheck=UpdateCheck.Never)]
 588		public System.Data.Linq.Binary Time
 589		{
 590			get
 591			{
 592				return this._Time;
 593			}
 594			set
 595			{
 596				if ((this._Time != value))
 597				{
 598					this.OnTimeChanging(value);
 599					this.SendPropertyChanging();
 600					this._Time = value;
 601					this.SendPropertyChanged("Time");
 602					this.OnTimeChanged();
 603				}
 604			}
 605		}
 606		
 607		[Column(Storage="_Temperature", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
 608		public int Temperature
 609		{
 610			get
 611			{
 612				return this._Temperature;
 613			}
 614			set
 615			{
 616				if ((this._Temperature != value))
 617				{
 618					this.OnTemperatureChanging(value);
 619					this.SendPropertyChanging();
 620					this._Temperature = value;
 621					this.SendPropertyChanged("Temperature");
 622					this.OnTemperatureChanged();
 623				}
 624			}
 625		}
 626		
 627		[Column(Storage="_Humidity", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
 628		public int Humidity
 629		{
 630			get
 631			{
 632				return this._Humidity;
 633			}
 634			set
 635			{
 636				if ((this._Humidity != value))
 637				{
 638					this.OnHumidityChanging(value);
 639					this.SendPropertyChanging();
 640					this._Humidity = value;
 641					this.SendPropertyChanged("Humidity");
 642					this.OnHumidityChanged();
 643				}
 644			}
 645		}
 646		
 647		[Column(Storage="_isLightOn", DbType="Bit NOT NULL", UpdateCheck=UpdateCheck.Never)]
 648		public bool isLightOn
 649		{
 650			get
 651			{
 652				return this._isLightOn;
 653			}
 654			set
 655			{
 656				if ((this._isLightOn != value))
 657				{
 658					this.OnisLightOnChanging(value);
 659					this.SendPropertyChanging();
 660					this._isLightOn = value;
 661					this.SendPropertyChanged("isLightOn");
 662					this.OnisLightOnChanged();
 663				}
 664			}
 665		}
 666		
 667		[Column(Storage="_SectionId", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
 668		public int SectionId
 669		{
 670			get
 671			{
 672				return this._SectionId;
 673			}
 674			set
 675			{
 676				if ((this._SectionId != value))
 677				{
 678					if (this._Section.HasLoadedOrAssignedValue)
 679					{
 680						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
 681					}
 682					this.OnSectionIdChanging(value);
 683					this.SendPropertyChanging();
 684					this._SectionId = value;
 685					this.SendPropertyChanged("SectionId");
 686					this.OnSectionIdChanged();
 687				}
 688			}
 689		}
 690		
 691		[Association(Name="Section_SectionLog", Storage="_Section", ThisKey="SectionId", OtherKey="SectionId", IsForeignKey=true)]
 692		public Section Section
 693		{
 694			get
 695			{
 696				return this._Section.Entity;
 697			}
 698			set
 699			{
 700				Section previousValue = this._Section.Entity;
 701				if (((previousValue != value) 
 702							|| (this._Section.HasLoadedOrAssignedValue == false)))
 703				{
 704					this.SendPropertyChanging();
 705					if ((previousValue != null))
 706					{
 707						this._Section.Entity = null;
 708						previousValue.SectionLogs.Remove(this);
 709					}
 710					this._Section.Entity = value;
 711					if ((value != null))
 712					{
 713						value.SectionLogs.Add(this);
 714						this._SectionId = value.SectionId;
 715					}
 716					else
 717					{
 718						this._SectionId = default(int);
 719					}
 720					this.SendPropertyChanged("Section");
 721				}
 722			}
 723		}
 724		
 725		public event PropertyChangingEventHandler PropertyChanging;
 726		
 727		public event PropertyChangedEventHandler PropertyChanged;
 728		
 729		protected virtual void SendPropertyChanging()
 730		{
 731			if ((this.PropertyChanging != null))
 732			{
 733				this.PropertyChanging(this, emptyChangingEventArgs);
 734			}
 735		}
 736		
 737		protected virtual void SendPropertyChanged(String propertyName)
 738		{
 739			if ((this.PropertyChanged != null))
 740			{
 741				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
 742			}
 743		}
 744	}
 745	
 746	[Table(Name="dbo.dvent_Environment")]
 747	public partial class Environment : INotifyPropertyChanging, INotifyPropertyChanged
 748	{
 749		
 750		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
 751		
 752		private int _EnvironmentId;
 753		
 754		private int _CropId;
 755		
 756		private System.Nullable<int> _MaxTemp;
 757		
 758		private System.Nullable<int> _MinTemp;
 759		
 760		private System.Nullable<int> _MaxHumidity;
 761		
 762		private System.Nullable<int> _MinHumidity;
 763		
 764		private System.DateTime _DateCreated;
 765		
 766		private System.Nullable<System.DateTime> _DateDeleted;
 767		
 768		private EntitySet<Schedule> _Schedules;
 769		
 770		private EntitySet<Section> _Sections;
 771		
 772		private EntityRef<Crop> _Crop;
 773		
 774    #region Extensibility Method Definitions
 775    partial void OnLoaded();
 776    partial void OnValidate(System.Data.Linq.ChangeAction action);
 777    partial void OnCreated();
 778    partial void OnEnvironmentIdChanging(int value);
 779    partial void OnEnvironmentIdChanged();
 780    partial void OnCropIdChanging(int value);
 781    partial void OnCropIdChanged();
 782    partial void OnMaxTempChanging(System.Nullable<int> value);
 783    partial void OnMaxTempChanged();
 784    partial void OnMinTempChanging(System.Nullable<int> value);
 785    partial void OnMinTempChanged();
 786    partial void OnMaxHumidityChanging(System.Nullable<int> value);
 787    partial void OnMaxHumidityChanged();
 788    partial void OnMinHumidityChanging(System.Nullable<int> value);
 789    partial void OnMinHumidityChanged();
 790    partial void OnDateCreatedChanging(System.DateTime value);
 791    partial void OnDateCreatedChanged();
 792    partial void OnDateDeletedChanging(System.Nullable<System.DateTime> value);
 793    partial void OnDateDeletedChanged();
 794    #endregion
 795		
 796		public Environment()
 797		{
 798			this._Schedules = new EntitySet<Schedule>(new Action<Schedule>(this.attach_Schedules), new Action<Schedule>(this.detach_Schedules));
 799			this._Sections = new EntitySet<Section>(new Action<Section>(this.attach_Sections), new Action<Section>(this.detach_Sections));
 800			this._Crop = default(EntityRef<Crop>);
 801			OnCreated();
 802		}
 803		
 804		[Column(Storage="_EnvironmentId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
 805		public int EnvironmentId
 806		{
 807			get
 808			{
 809				return this._EnvironmentId;
 810			}
 811			set
 812			{
 813				if ((this._EnvironmentId != value))
 814				{
 815					this.OnEnvironmentIdChanging(value);
 816					this.SendPropertyChanging();
 817					this._EnvironmentId = value;
 818					this.SendPropertyChanged("EnvironmentId");
 819					this.OnEnvironmentIdChanged();
 820				}
 821			}
 822		}
 823		
 824		[Column(Storage="_CropId", DbType="Int NOT NULL")]
 825		public int CropId
 826		{
 827			get
 828			{
 829				return this._CropId;
 830			}
 831			set
 832			{
 833				if ((this._CropId != value))
 834				{
 835					if (this._Crop.HasLoadedOrAssignedValue)
 836					{
 837						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
 838					}
 839					this.OnCropIdChanging(value);
 840					this.SendPropertyChanging();
 841					this._CropId = value;
 842					this.SendPropertyChanged("CropId");
 843					this.OnCropIdChanged();
 844				}
 845			}
 846		}
 847		
 848		[Column(Storage="_MaxTemp", DbType="Int")]
 849		public System.Nullable<int> MaxTemp
 850		{
 851			get
 852			{
 853				return this._MaxTemp;
 854			}
 855			set
 856			{
 857				if ((this._MaxTemp != value))
 858				{
 859					this.OnMaxTempChanging(value);
 860					this.SendPropertyChanging();
 861					this._MaxTemp = value;
 862					this.SendPropertyChanged("MaxTemp");
 863					this.OnMaxTempChanged();
 864				}
 865			}
 866		}
 867		
 868		[Column(Storage="_MinTemp", DbType="Int")]
 869		public System.Nullable<int> MinTemp
 870		{
 871			get
 872			{
 873				return this._MinTemp;
 874			}
 875			set
 876			{
 877				if ((this._MinTemp != value))
 878				{
 879					this.OnMinTempChanging(value);
 880					this.SendPropertyChanging();
 881					this._MinTemp = value;
 882					this.SendPropertyChanged("MinTemp");
 883					this.OnMinTempChanged();
 884				}
 885			}
 886		}
 887		
 888		[Column(Storage="_MaxHumidity", DbType="Int")]
 889		public System.Nullable<int> MaxHumidity
 890		{
 891			get
 892			{
 893				return this._MaxHumidity;
 894			}
 895			set
 896			{
 897				if ((this._MaxHumidity != value))
 898				{
 899					this.OnMaxHumidityChanging(value);
 900					this.SendPropertyChanging();
 901					this._MaxHumidity = value;
 902					this.SendPropertyChanged("MaxHumidity");
 903					this.OnMaxHumidityChanged();
 904				}
 905			}
 906		}
 907		
 908		[Column(Storage="_MinHumidity", DbType="Int")]
 909		public System.Nullable<int> MinHumidity
 910		{
 911			get
 912			{
 913				return this._MinHumidity;
 914			}
 915			set
 916			{
 917				if ((this._MinHumidity != value))
 918				{
 919					this.OnMinHumidityChanging(value);
 920					this.SendPropertyChanging();
 921					this._MinHumidity = value;
 922					this.SendPropertyChanged("MinHumidity");
 923					this.OnMinHumidityChanged();
 924				}
 925			}
 926		}
 927		
 928		[Column(Storage="_DateCreated", DbType="DateTime NOT NULL")]
 929		public System.DateTime DateCreated
 930		{
 931			get
 932			{
 933				return this._DateCreated;
 934			}
 935			set
 936			{
 937				if ((this._DateCreated != value))
 938				{
 939					this.OnDateCreatedChanging(value);
 940					this.SendPropertyChanging();
 941					this._DateCreated = value;
 942					this.SendPropertyChanged("DateCreated");
 943					this.OnDateCreatedChanged();
 944				}
 945			}
 946		}
 947		
 948		[Column(Storage="_DateDeleted", DbType="DateTime")]
 949		public System.Nullable<System.DateTime> DateDeleted
 950		{
 951			get
 952			{
 953				return this._DateDeleted;
 954			}
 955			set
 956			{
 957				if ((this._DateDeleted != value))
 958				{
 959					this.OnDateDeletedChanging(value);
 960					this.SendPropertyChanging();
 961					this._DateDeleted = value;
 962					this.SendPropertyChanged("DateDeleted");
 963					this.OnDateDeletedChanged();
 964				}
 965			}
 966		}
 967		
 968		[Association(Name="Environment_Schedule", Storage="_Schedules", ThisKey="EnvironmentId", OtherKey="EnviromentId")]
 969		public EntitySet<Schedule> Schedules
 970		{
 971			get
 972			{
 973				return this._Schedules;
 974			}
 975			set
 976			{
 977				this._Schedules.Assign(value);
 978			}
 979		}
 980		
 981		[Association(Name="Environment_Section", Storage="_Sections", ThisKey="EnvironmentId", OtherKey="EnviromentId")]
 982		public EntitySet<Section> Sections
 983		{
 984			get
 985			{
 986				return this._Sections;
 987			}
 988			set
 989			{
 990				this._Sections.Assign(value);
 991			}
 992		}
 993		
 994		[Association(Name="Crop_Environment", Storage="_Crop", ThisKey="CropId", OtherKey="CropId", IsForeignKey=true)]
 995		public Crop Crop
 996		{
 997			get
 998			{
 999				return this._Crop.Entity;
1000			}
1001			set
1002			{
1003				Crop previousValue = this._Crop.Entity;
1004				if (((previousValue != value) 
1005							|| (this._Crop.HasLoadedOrAssignedValue == false)))
1006				{
1007					this.SendPropertyChanging();
1008					if ((previousValue != null))
1009					{
1010						this._Crop.Entity = null;
1011						previousValue.Environments.Remove(this);
1012					}
1013					this._Crop.Entity = value;
1014					if ((value != null))
1015					{
1016						value.Environments.Add(this);
1017						this._CropId = value.CropId;
1018					}
1019					else
1020					{
1021						this._CropId = default(int);
1022					}
1023					this.SendPropertyChanged("Crop");
1024				}
1025			}
1026		}
1027		
1028		public event PropertyChangingEventHandler PropertyChanging;
1029		
1030		public event PropertyChangedEventHandler PropertyChanged;
1031		
1032		protected virtual void SendPropertyChanging()
1033		{
1034			if ((this.PropertyChanging != null))
1035			{
1036				this.PropertyChanging(this, emptyChangingEventArgs);
1037			}
1038		}
1039		
1040		protected virtual void SendPropertyChanged(String propertyName)
1041		{
1042			if ((this.PropertyChanged != null))
1043			{
1044				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1045			}
1046		}
1047		
1048		private void attach_Schedules(Schedule entity)
1049		{
1050			this.SendPropertyChanging();
1051			entity.Environment = this;
1052		}
1053		
1054		private void detach_Schedules(Schedule entity)
1055		{
1056			this.SendPropertyChanging();
1057			entity.Environment = null;
1058		}
1059		
1060		private void attach_Sections(Section entity)
1061		{
1062			this.SendPropertyChanging();
1063			entity.Environment = this;
1064		}
1065		
1066		private void detach_Sections(Section entity)
1067		{
1068			this.SendPropertyChanging();
1069			entity.Environment = null;
1070		}
1071	}
1072	
1073	[Table(Name="dbo.dvent_Greenhouse")]
1074	public partial class Greenhouse : INotifyPropertyChanging, INotifyPropertyChanged
1075	{
1076		
1077		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1078		
1079		private int _GreenhouseId;
1080		
1081		private int _Width;
1082		
1083		private int _Height;
1084		
1085		private int _Length;
1086		
1087		private int _LocationId;
1088		
1089		private EntitySet<Section> _Sections;
1090		
1091		private EntityRef<Location> _Location;
1092		
1093    #region Extensibility Method Definitions
1094    partial void OnLoaded();
1095    partial void OnValidate(System.Data.Linq.ChangeAction action);
1096    partial void OnCreated();
1097    partial void OnGreenhouseIdChanging(int value);
1098    partial void OnGreenhouseIdChanged();
1099    partial void OnWidthChanging(int value);
1100    partial void OnWidthChanged();
1101    partial void OnHeightChanging(int value);
1102    partial void OnHeightChanged();
1103    partial void OnLengthChanging(int value);
1104    partial void OnLengthChanged();
1105    partial void OnLocationIdChanging(int value);
1106    partial void OnLocationIdChanged();
1107    #endregion
1108		
1109		public Greenhouse()
1110		{
1111			this._Sections = new EntitySet<Section>(new Action<Section>(this.attach_Sections), new Action<Section>(this.detach_Sections));
1112			this._Location = default(EntityRef<Location>);
1113			OnCreated();
1114		}
1115		
1116		[Column(Storage="_GreenhouseId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
1117		public int GreenhouseId
1118		{
1119			get
1120			{
1121				return this._GreenhouseId;
1122			}
1123			set
1124			{
1125				if ((this._GreenhouseId != value))
1126				{
1127					this.OnGreenhouseIdChanging(value);
1128					this.SendPropertyChanging();
1129					this._GreenhouseId = value;
1130					this.SendPropertyChanged("GreenhouseId");
1131					this.OnGreenhouseIdChanged();
1132				}
1133			}
1134		}
1135		
1136		[Column(Storage="_Width", DbType="Int NOT NULL")]
1137		public int Width
1138		{
1139			get
1140			{
1141				return this._Width;
1142			}
1143			set
1144			{
1145				if ((this._Width != value))
1146				{
1147					this.OnWidthChanging(value);
1148					this.SendPropertyChanging();
1149					this._Width = value;
1150					this.SendPropertyChanged("Width");
1151					this.OnWidthChanged();
1152				}
1153			}
1154		}
1155		
1156		[Column(Storage="_Height", DbType="Int NOT NULL")]
1157		public int Height
1158		{
1159			get
1160			{
1161				return this._Height;
1162			}
1163			set
1164			{
1165				if ((this._Height != value))
1166				{
1167					this.OnHeightChanging(value);
1168					this.SendPropertyChanging();
1169					this._Height = value;
1170					this.SendPropertyChanged("Height");
1171					this.OnHeightChanged();
1172				}
1173			}
1174		}
1175		
1176		[Column(Storage="_Length", DbType="Int NOT NULL")]
1177		public int Length
1178		{
1179			get
1180			{
1181				return this._Length;
1182			}
1183			set
1184			{
1185				if ((this._Length != value))
1186				{
1187					this.OnLengthChanging(value);
1188					this.SendPropertyChanging();
1189					this._Length = value;
1190					this.SendPropertyChanged("Length");
1191					this.OnLengthChanged();
1192				}
1193			}
1194		}
1195		
1196		[Column(Storage="_LocationId", DbType="Int NOT NULL")]
1197		public int LocationId
1198		{
1199			get
1200			{
1201				return this._LocationId;
1202			}
1203			set
1204			{
1205				if ((this._LocationId != value))
1206				{
1207					if (this._Location.HasLoadedOrAssignedValue)
1208					{
1209						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1210					}
1211					this.OnLocationIdChanging(value);
1212					this.SendPropertyChanging();
1213					this._LocationId = value;
1214					this.SendPropertyChanged("LocationId");
1215					this.OnLocationIdChanged();
1216				}
1217			}
1218		}
1219		
1220		[Association(Name="Greenhouse_Section", Storage="_Sections", ThisKey="GreenhouseId", OtherKey="GreenhouseId")]
1221		public EntitySet<Section> Sections
1222		{
1223			get
1224			{
1225				return this._Sections;
1226			}
1227			set
1228			{
1229				this._Sections.Assign(value);
1230			}
1231		}
1232		
1233		[Association(Name="Location_Greenhouse", Storage="_Location", ThisKey="LocationId", OtherKey="LocationId", IsForeignKey=true)]
1234		public Location Location
1235		{
1236			get
1237			{
1238				return this._Location.Entity;
1239			}
1240			set
1241			{
1242				Location previousValue = this._Location.Entity;
1243				if (((previousValue != value) 
1244							|| (this._Location.HasLoadedOrAssignedValue == false)))
1245				{
1246					this.SendPropertyChanging();
1247					if ((previousValue != null))
1248					{
1249						this._Location.Entity = null;
1250						previousValue.Greenhouses.Remove(this);
1251					}
1252					this._Location.Entity = value;
1253					if ((value != null))
1254					{
1255						value.Greenhouses.Add(this);
1256						this._LocationId = value.LocationId;
1257					}
1258					else
1259					{
1260						this._LocationId = default(int);
1261					}
1262					this.SendPropertyChanged("Location");
1263				}
1264			}
1265		}
1266		
1267		public event PropertyChangingEventHandler PropertyChanging;
1268		
1269		public event PropertyChangedEventHandler PropertyChanged;
1270		
1271		protected virtual void SendPropertyChanging()
1272		{
1273			if ((this.PropertyChanging != null))
1274			{
1275				this.PropertyChanging(this, emptyChangingEventArgs);
1276			}
1277		}
1278		
1279		protected virtual void SendPropertyChanged(String propertyName)
1280		{
1281			if ((this.PropertyChanged != null))
1282			{
1283				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1284			}
1285		}
1286		
1287		private void attach_Sections(Section entity)
1288		{
1289			this.SendPropertyChanging();
1290			entity.Greenhouse = this;
1291		}
1292		
1293		private void detach_Sections(Section entity)
1294		{
1295			this.SendPropertyChanging();
1296			entity.Greenhouse = null;
1297		}
1298	}
1299	
1300	[Table(Name="dbo.dvent_Schedule")]
1301	public partial class Schedule : INotifyPropertyChanging, INotifyPropertyChanged
1302	{
1303		
1304		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1305		
1306		private int _ScheduleId;
1307		
1308		private System.DateTime _Time;
1309		
1310		private int _interval;
1311		
1312		private int _EnviromentId;
1313		
1314		private int _ScheduleTypeId;
1315		
1316		private System.DateTime _DateCreated;
1317		
1318		private System.Nullable<System.DateTime> _DateDeleted;
1319		
1320		private EntityRef<Environment> _Environment;
1321		
1322		private EntityRef<ScheduleType> _ScheduleType;
1323		
1324    #region Extensibility Method Definitions
1325    partial void OnLoaded();
1326    partial void OnValidate(System.Data.Linq.ChangeAction action);
1327    partial void OnCreated();
1328    partial void OnScheduleIdChanging(int value);
1329    partial void OnScheduleIdChanged();
1330    partial void OnTimeChanging(System.DateTime value);
1331    partial void OnTimeChanged();
1332    partial void OnintervalChanging(int value);
1333    partial void OnintervalChanged();
1334    partial void OnEnviromentIdChanging(int value);
1335    partial void OnEnviromentIdChanged();
1336    partial void OnScheduleTypeIdChanging(int value);
1337    partial void OnScheduleTypeIdChanged();
1338    partial void OnDateCreatedChanging(System.DateTime value);
1339    partial void OnDateCreatedChanged();
1340    partial void OnDateDeletedChanging(System.Nullable<System.DateTime> value);
1341    partial void OnDateDeletedChanged();
1342    #endregion
1343		
1344		public Schedule()
1345		{
1346			this._Environment = default(EntityRef<Environment>);
1347			this._ScheduleType = default(EntityRef<ScheduleType>);
1348			OnCreated();
1349		}
1350		
1351		[Column(Storage="_ScheduleId", DbType="Int NOT NULL", IsPrimaryKey=true)]
1352		public int ScheduleId
1353		{
1354			get
1355			{
1356				return this._ScheduleId;
1357			}
1358			set
1359			{
1360				if ((this._ScheduleId != value))
1361				{
1362					this.OnScheduleIdChanging(value);
1363					this.SendPropertyChanging();
1364					this._ScheduleId = value;
1365					this.SendPropertyChanged("ScheduleId");
1366					this.OnScheduleIdChanged();
1367				}
1368			}
1369		}
1370		
1371		[Column(Storage="_Time", DbType="DateTime NOT NULL")]
1372		public System.DateTime Time
1373		{
1374			get
1375			{
1376				return this._Time;
1377			}
1378			set
1379			{
1380				if ((this._Time != value))
1381				{
1382					this.OnTimeChanging(value);
1383					this.SendPropertyChanging();
1384					this._Time = value;
1385					this.SendPropertyChanged("Time");
1386					this.OnTimeChanged();
1387				}
1388			}
1389		}
1390		
1391		[Column(Storage="_interval", DbType="Int NOT NULL")]
1392		public int interval
1393		{
1394			get
1395			{
1396				return this._interval;
1397			}
1398			set
1399			{
1400				if ((this._interval != value))
1401				{
1402					this.OnintervalChanging(value);
1403					this.SendPropertyChanging();
1404					this._interval = value;
1405					this.SendPropertyChanged("interval");
1406					this.OnintervalChanged();
1407				}
1408			}
1409		}
1410		
1411		[Column(Storage="_EnviromentId", DbType="Int NOT NULL")]
1412		public int EnviromentId
1413		{
1414			get
1415			{
1416				return this._EnviromentId;
1417			}
1418			set
1419			{
1420				if ((this._EnviromentId != value))
1421				{
1422					if (this._Environment.HasLoadedOrAssignedValue)
1423					{
1424						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1425					}
1426					this.OnEnviromentIdChanging(value);
1427					this.SendPropertyChanging();
1428					this._EnviromentId = value;
1429					this.SendPropertyChanged("EnviromentId");
1430					this.OnEnviromentIdChanged();
1431				}
1432			}
1433		}
1434		
1435		[Column(Storage="_ScheduleTypeId", DbType="Int NOT NULL")]
1436		public int ScheduleTypeId
1437		{
1438			get
1439			{
1440				return this._ScheduleTypeId;
1441			}
1442			set
1443			{
1444				if ((this._ScheduleTypeId != value))
1445				{
1446					if (this._ScheduleType.HasLoadedOrAssignedValue)
1447					{
1448						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1449					}
1450					this.OnScheduleTypeIdChanging(value);
1451					this.SendPropertyChanging();
1452					this._ScheduleTypeId = value;
1453					this.SendPropertyChanged("ScheduleTypeId");
1454					this.OnScheduleTypeIdChanged();
1455				}
1456			}
1457		}
1458		
1459		[Column(Storage="_DateCreated", DbType="DateTime NOT NULL")]
1460		public System.DateTime DateCreated
1461		{
1462			get
1463			{
1464				return this._DateCreated;
1465			}
1466			set
1467			{
1468				if ((this._DateCreated != value))
1469				{
1470					this.OnDateCreatedChanging(value);
1471					this.SendPropertyChanging();
1472					this._DateCreated = value;
1473					this.SendPropertyChanged("DateCreated");
1474					this.OnDateCreatedChanged();
1475				}
1476			}
1477		}
1478		
1479		[Column(Storage="_DateDeleted", DbType="DateTime")]
1480		public System.Nullable<System.DateTime> DateDeleted
1481		{
1482			get
1483			{
1484				return this._DateDeleted;
1485			}
1486			set
1487			{
1488				if ((this._DateDeleted != value))
1489				{
1490					this.OnDateDeletedChanging(value);
1491					this.SendPropertyChanging();
1492					this._DateDeleted = value;
1493					this.SendPropertyChanged("DateDeleted");
1494					this.OnDateDeletedChanged();
1495				}
1496			}
1497		}
1498		
1499		[Association(Name="Environment_Schedule", Storage="_Environment", ThisKey="EnviromentId", OtherKey="EnvironmentId", IsForeignKey=true)]
1500		public Environment Environment
1501		{
1502			get
1503			{
1504				return this._Environment.Entity;
1505			}
1506			set
1507			{
1508				Environment previousValue = this._Environment.Entity;
1509				if (((previousValue != value) 
1510							|| (this._Environment.HasLoadedOrAssignedValue == false)))
1511				{
1512					this.SendPropertyChanging();
1513					if ((previousValue != null))
1514					{
1515						this._Environment.Entity = null;
1516						previousValue.Schedules.Remove(this);
1517					}
1518					this._Environment.Entity = value;
1519					if ((value != null))
1520					{
1521						value.Schedules.Add(this);
1522						this._EnviromentId = value.EnvironmentId;
1523					}
1524					else
1525					{
1526						this._EnviromentId = default(int);
1527					}
1528					this.SendPropertyChanged("Environment");
1529				}
1530			}
1531		}
1532		
1533		[Association(Name="ScheduleType_Schedule", Storage="_ScheduleType", ThisKey="ScheduleTypeId", OtherKey="ScheduleTypeId", IsForeignKey=true)]
1534		public ScheduleType ScheduleType
1535		{
1536			get
1537			{
1538				return this._ScheduleType.Entity;
1539			}
1540			set
1541			{
1542				ScheduleType previousValue = this._ScheduleType.Entity;
1543				if (((previousValue != value) 
1544							|| (this._ScheduleType.HasLoadedOrAssignedValue == false)))
1545				{
1546					this.SendPropertyChanging();
1547					if ((previousValue != null))
1548					{
1549						this._ScheduleType.Entity = null;
1550						previousValue.Schedules.Remove(this);
1551					}
1552					this._ScheduleType.Entity = value;
1553					if ((value != null))
1554					{
1555						value.Schedules.Add(this);
1556						this._ScheduleTypeId = value.ScheduleTypeId;
1557					}
1558					else
1559					{
1560						this._ScheduleTypeId = default(int);
1561					}
1562					this.SendPropertyChanged("ScheduleType");
1563				}
1564			}
1565		}
1566		
1567		public event PropertyChangingEventHandler PropertyChanging;
1568		
1569		public event PropertyChangedEventHandler PropertyChanged;
1570		
1571		protected virtual void SendPropertyChanging()
1572		{
1573			if ((this.PropertyChanging != null))
1574			{
1575				this.PropertyChanging(this, emptyChangingEventArgs);
1576			}
1577		}
1578		
1579		protected virtual void SendPropertyChanged(String propertyName)
1580		{
1581			if ((this.PropertyChanged != null))
1582			{
1583				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1584			}
1585		}
1586	}
1587	
1588	[Table(Name="dbo.dvent_ScheduleType")]
1589	public partial class ScheduleType : INotifyPropertyChanging, INotifyPropertyChanged
1590	{
1591		
1592		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1593		
1594		private int _ScheduleTypeId;
1595		
1596		private string _name;
1597		
1598		private EntitySet<Schedule> _Schedules;
1599		
1600    #region Extensibility Method Definitions
1601    partial void OnLoaded();
1602    partial void OnValidate(System.Data.Linq.ChangeAction action);
1603    partial void OnCreated();
1604    partial void OnScheduleTypeIdChanging(int value);
1605    partial void OnScheduleTypeIdChanged();
1606    partial void OnnameChanging(string value);
1607    partial void OnnameChanged();
1608    #endregion
1609		
1610		public ScheduleType()
1611		{
1612			this._Schedules = new EntitySet<Schedule>(new Action<Schedule>(this.attach_Schedules), new Action<Schedule>(this.detach_Schedules));
1613			OnCreated();
1614		}
1615		
1616		[Column(Storage="_ScheduleTypeId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
1617		public int ScheduleTypeId
1618		{
1619			get
1620			{
1621				return this._ScheduleTypeId;
1622			}
1623			set
1624			{
1625				if ((this._ScheduleTypeId != value))
1626				{
1627					this.OnScheduleTypeIdChanging(value);
1628					this.SendPropertyChanging();
1629					this._ScheduleTypeId = value;
1630					this.SendPropertyChanged("ScheduleTypeId");
1631					this.OnScheduleTypeIdChanged();
1632				}
1633			}
1634		}
1635		
1636		[Column(Storage="_name", DbType="NVarChar(253) NOT NULL", CanBeNull=false)]
1637		public string name
1638		{
1639			get
1640			{
1641				return this._name;
1642			}
1643			set
1644			{
1645				if ((this._name != value))
1646				{
1647					this.OnnameChanging(value);
1648					this.SendPropertyChanging();
1649					this._name = value;
1650					this.SendPropertyChanged("name");
1651					this.OnnameChanged();
1652				}
1653			}
1654		}
1655		
1656		[Association(Name="ScheduleType_Schedule", Storage="_Schedules", ThisKey="ScheduleTypeId", OtherKey="ScheduleTypeId")]
1657		public EntitySet<Schedule> Schedules
1658		{
1659			get
1660			{
1661				return this._Schedules;
1662			}
1663			set
1664			{
1665				this._Schedules.Assign(value);
1666			}
1667		}
1668		
1669		public event PropertyChangingEventHandler PropertyChanging;
1670		
1671		public event PropertyChangedEventHandler PropertyChanged;
1672		
1673		protected virtual void SendPropertyChanging()
1674		{
1675			if ((this.PropertyChanging != null))
1676			{
1677				this.PropertyChanging(this, emptyChangingEventArgs);
1678			}
1679		}
1680		
1681		protected virtual void SendPropertyChanged(String propertyName)
1682		{
1683			if ((this.PropertyChanged != null))
1684			{
1685				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1686			}
1687		}
1688		
1689		private void attach_Schedules(Schedule entity)
1690		{
1691			this.SendPropertyChanging();
1692			entity.ScheduleType = this;
1693		}
1694		
1695		private void detach_Schedules(Schedule entity)
1696		{
1697			this.SendPropertyChanging();
1698			entity.ScheduleType = null;
1699		}
1700	}
1701	
1702	[Table(Name="dbo.dvent_Section")]
1703	public partial class Section : INotifyPropertyChanging, INotifyPropertyChanged
1704	{
1705		
1706		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1707		
1708		private int _SectionId;
1709		
1710		private int _GreenhouseId;
1711		
1712		private int _EnviromentId;
1713		
1714		private int _CropId;
1715		
1716		private string _Name;
1717		
1718		private System.Nullable<int> _OwnerId;
1719		
1720		private int _Length;
1721		
1722		private int _Width;
1723		
1724		private int _Height;
1725		
1726		private EntitySet<SectionLog> _SectionLogs;
1727		
1728		private EntityRef<Environment> _Environment;
1729		
1730		private EntityRef<Greenhouse> _Greenhouse;
1731		
1732    #region Extensibility Method Definitions
1733    partial void OnLoaded();
1734    partial void OnValidate(System.Data.Linq.ChangeAction action);
1735    partial void OnCreated();
1736    partial void OnSectionIdChanging(int value);
1737    partial void OnSectionIdChanged();
1738    partial void OnGreenhouseIdChanging(int value);
1739    partial void OnGreenhouseIdChanged();
1740    partial void OnEnviromentIdChanging(int value);
1741    partial void OnEnviromentIdChanged();
1742    partial void OnCropIdChanging(int value);
1743    partial void OnCropIdChanged();
1744    partial void OnNameChanging(string value);
1745    partial void OnNameChanged();
1746    partial void OnCustomerIdChanging(System.Nullable<int> value);
1747    partial void OnCustomerIdChanged();
1748    partial void OnLengthChanging(int value);
1749    partial void OnLengthChanged();
1750    partial void OnWidthChanging(int value);
1751    partial void OnWidthChanged();
1752    partial void OnHeightChanging(int value);
1753    partial void OnHeightChanged();
1754    #endregion
1755		
1756		public Section()
1757		{
1758			this._SectionLogs = new EntitySet<SectionLog>(new Action<SectionLog>(this.attach_SectionLogs), new Action<SectionLog>(this.detach_SectionLogs));
1759			this._Environment = default(EntityRef<Environment>);
1760			this._Greenhouse = default(EntityRef<Greenhouse>);
1761			OnCreated();
1762		}
1763		
1764		[Column(Storage="_SectionId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
1765		public int SectionId
1766		{
1767			get
1768			{
1769				return this._SectionId;
1770			}
1771			set
1772			{
1773				if ((this._SectionId != value))
1774				{
1775					this.OnSectionIdChanging(value);
1776					this.SendPropertyChanging();
1777					this._SectionId = value;
1778					this.SendPropertyChanged("SectionId");
1779					this.OnSectionIdChanged();
1780				}
1781			}
1782		}
1783		
1784		[Column(Storage="_GreenhouseId", DbType="Int NOT NULL")]
1785		public int GreenhouseId
1786		{
1787			get
1788			{
1789				return this._GreenhouseId;
1790			}
1791			set
1792			{
1793				if ((this._GreenhouseId != value))
1794				{
1795					if (this._Greenhouse.HasLoadedOrAssignedValue)
1796					{
1797						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1798					}
1799					this.OnGreenhouseIdChanging(value);
1800					this.SendPropertyChanging();
1801					this._GreenhouseId = value;
1802					this.SendPropertyChanged("GreenhouseId");
1803					this.OnGreenhouseIdChanged();
1804				}
1805			}
1806		}
1807		
1808		[Column(Storage="_EnviromentId", DbType="Int NOT NULL")]
1809		public int EnviromentId
1810		{
1811			get
1812			{
1813				return this._EnviromentId;
1814			}
1815			set
1816			{
1817				if ((this._EnviromentId != value))
1818				{
1819					if (this._Environment.HasLoadedOrAssignedValue)
1820					{
1821						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1822					}
1823					this.OnEnviromentIdChanging(value);
1824					this.SendPropertyChanging();
1825					this._EnviromentId = value;
1826					this.SendPropertyChanged("EnviromentId");
1827					this.OnEnviromentIdChanged();
1828				}
1829			}
1830		}
1831		
1832		[Column(Storage="_CropId", DbType="Int NOT NULL")]
1833		public int CropId
1834		{
1835			get
1836			{
1837				return this._CropId;
1838			}
1839			set
1840			{
1841				if ((this._CropId != value))
1842				{
1843					this.OnCropIdChanging(value);
1844					this.SendPropertyChanging();
1845					this._CropId = value;
1846					this.SendPropertyChanged("CropId");
1847					this.OnCropIdChanged();
1848				}
1849			}
1850		}
1851		
1852		[Column(Storage="_Name", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
1853		public string Name
1854		{
1855			get
1856			{
1857				return this._Name;
1858			}
1859			set
1860			{
1861				if ((this._Name != value))
1862				{
1863					this.OnNameChanging(value);
1864					this.SendPropertyChanging();
1865					this._Name = value;
1866					this.SendPropertyChanged("Name");
1867					this.OnNameChanged();
1868				}
1869			}
1870		}
1871		
1872		[Column(Name="OwnerId", Storage="_OwnerId", DbType="Int")]
1873		public System.Nullable<int> CustomerId
1874		{
1875			get
1876			{
1877				return this._OwnerId;
1878			}
1879			set
1880			{
1881				if ((this._OwnerId != value))
1882				{
1883					this.OnCustomerIdChanging(value);
1884					this.SendPropertyChanging();
1885					this._OwnerId = value;
1886					this.SendPropertyChanged("CustomerId");
1887					this.OnCustomerIdChanged();
1888				}
1889			}
1890		}
1891		
1892		[Column(Storage="_Length", DbType="Int NOT NULL")]
1893		public int Length
1894		{
1895			get
1896			{
1897				return this._Length;
1898			}
1899			set
1900			{
1901				if ((this._Length != value))
1902				{
1903					this.OnLengthChanging(value);
1904					this.SendPropertyChanging();
1905					this._Length = value;
1906					this.SendPropertyChanged("Length");
1907					this.OnLengthChanged();
1908				}
1909			}
1910		}
1911		
1912		[Column(Storage="_Width", DbType="Int NOT NULL")]
1913		public int Width
1914		{
1915			get
1916			{
1917				return this._Width;
1918			}
1919			set
1920			{
1921				if ((this._Width != value))
1922				{
1923					this.OnWidthChanging(value);
1924					this.SendPropertyChanging();
1925					this._Width = value;
1926					this.SendPropertyChanged("Width");
1927					this.OnWidthChanged();
1928				}
1929			}
1930		}
1931		
1932		[Column(Storage="_Height", DbType="Int NOT NULL")]
1933		public int Height
1934		{
1935			get
1936			{
1937				return this._Height;
1938			}
1939			set
1940			{
1941				if ((this._Height != value))
1942				{
1943					this.OnHeightChanging(value);
1944					this.SendPropertyChanging();
1945					this._Height = value;
1946					this.SendPropertyChanged("Height");
1947					this.OnHeightChanged();
1948				}
1949			}
1950		}
1951		
1952		[Association(Name="Section_SectionLog", Storage="_SectionLogs", ThisKey="SectionId", OtherKey="SectionId")]
1953		public EntitySet<SectionLog> SectionLogs
1954		{
1955			get
1956			{
1957				return this._SectionLogs;
1958			}
1959			set
1960			{
1961				this._SectionLogs.Assign(value);
1962			}
1963		}
1964		
1965		[Association(Name="Environment_Section", Storage="_Environment", ThisKey="EnviromentId", OtherKey="EnvironmentId", IsForeignKey=true)]
1966		public Environment Environment
1967		{
1968			get
1969			{
1970				return this._Environment.Entity;
1971			}
1972			set
1973			{
1974				Environment previousValue = this._Environment.Entity;
1975				if (((previousValue != value) 
1976							|| (this._Environment.HasLoadedOrAssignedValue == false)))
1977				{
1978					this.SendPropertyChanging();
1979					if ((previousValue != null))
1980					{
1981						this._Environment.Entity = null;
1982						previousValue.Sections.Remove(this);
1983					}
1984					this._Environment.Entity = value;
1985					if ((value != null))
1986					{
1987						value.Sections.Add(this);
1988						this._EnviromentId = value.EnvironmentId;
1989					}
1990					else
1991					{
1992						this._EnviromentId = default(int);
1993					}
1994					this.SendPropertyChanged("Environment");
1995				}
1996			}
1997		}
1998		
1999		[Association(Name="Greenhouse_Section", Storage="_Greenhouse", ThisKey="GreenhouseId", OtherKey="GreenhouseId", IsForeignKey=true)]
2000		public Greenhouse Greenhouse
2001		{
2002			get
2003			{
2004				return this._Greenhouse.Entity;
2005			}
2006			set
2007			{
2008				Greenhouse previousValue = this._Greenhouse.Entity;
2009				if (((previousValue != value) 
2010							|| (this._Greenhouse.HasLoadedOrAssignedValue == false)))
2011				{
2012					this.SendPropertyChanging();
2013					if ((previousValue != null))
2014					{
2015						this._Greenhouse.Entity = null;
2016						previousValue.Sections.Remove(this);
2017					}
2018					this._Greenhouse.Entity = value;
2019					if ((value != null))
2020					{
2021						value.Sections.Add(this);
2022						this._GreenhouseId = value.GreenhouseId;
2023					}
2024					else
2025					{
2026						this._GreenhouseId = default(int);
2027					}
2028					this.SendPropertyChanged("Greenhouse");
2029				}
2030			}
2031		}
2032		
2033		public event PropertyChangingEventHandler PropertyChanging;
2034		
2035		public event PropertyChangedEventHandler PropertyChanged;
2036		
2037		protected virtual void SendPropertyChanging()
2038		{
2039			if ((this.PropertyChanging != null))
2040			{
2041				this.PropertyChanging(this, emptyChangingEventArgs);
2042			}
2043		}
2044		
2045		protected virtual void SendPropertyChanged(String propertyName)
2046		{
2047			if ((this.PropertyChanged != null))
2048			{
2049				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
2050			}
2051		}
2052		
2053		private void attach_SectionLogs(SectionLog entity)
2054		{
2055			this.SendPropertyChanging();
2056			entity.Section = this;
2057		}
2058		
2059		private void detach_SectionLogs(SectionLog entity)
2060		{
2061			this.SendPropertyChanging();
2062			entity.Section = null;
2063		}
2064	}
2065	
2066	[Table(Name="dbo.dvent_Location")]
2067	public partial class Location : INotifyPropertyChanging, INotifyPropertyChanged
2068	{
2069		
2070		private static PropertyCha

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