PageRenderTime 135ms CodeModel.GetById 3ms app.highlight 115ms 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
   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 PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
2071		
2072		private int _LocationId;
2073		
2074		private string _City;
2075		
2076		private string _State;
2077		
2078		private string _AddressLine1;
2079		
2080		private string _AddressLine2;
2081		
2082		private System.Nullable<int> _Zip;
2083		
2084		private string _Country;
2085		
2086		private EntitySet<Greenhouse> _Greenhouses;
2087		
2088    #region Extensibility Method Definitions
2089    partial void OnLoaded();
2090    partial void OnValidate(System.Data.Linq.ChangeAction action);
2091    partial void OnCreated();
2092    partial void OnLocationIdChanging(int value);
2093    partial void OnLocationIdChanged();
2094    partial void OnCityChanging(string value);
2095    partial void OnCityChanged();
2096    partial void OnStateChanging(string value);
2097    partial void OnStateChanged();
2098    partial void OnAddressLine1Changing(string value);
2099    partial void OnAddressLine1Changed();
2100    partial void OnAddressLine2Changing(string value);
2101    partial void OnAddressLine2Changed();
2102    partial void OnZipChanging(System.Nullable<int> value);
2103    partial void OnZipChanged();
2104    partial void OnCountryChanging(string value);
2105    partial void OnCountryChanged();
2106    #endregion
2107		
2108		public Location()
2109		{
2110			this._Greenhouses = new EntitySet<Greenhouse>(new Action<Greenhouse>(this.attach_Greenhouses), new Action<Greenhouse>(this.detach_Greenhouses));
2111			OnCreated();
2112		}
2113		
2114		[Column(Storage="_LocationId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
2115		public int LocationId
2116		{
2117			get
2118			{
2119				return this._LocationId;
2120			}
2121			set
2122			{
2123				if ((this._LocationId != value))
2124				{
2125					this.OnLocationIdChanging(value);
2126					this.SendPropertyChanging();
2127					this._LocationId = value;
2128					this.SendPropertyChanged("LocationId");
2129					this.OnLocationIdChanged();
2130				}
2131			}
2132		}
2133		
2134		[Column(Storage="_City", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
2135		public string City
2136		{
2137			get
2138			{
2139				return this._City;
2140			}
2141			set
2142			{
2143				if ((this._City != value))
2144				{
2145					this.OnCityChanging(value);
2146					this.SendPropertyChanging();
2147					this._City = value;
2148					this.SendPropertyChanged("City");
2149					this.OnCityChanged();
2150				}
2151			}
2152		}
2153		
2154		[Column(Storage="_State", DbType="NVarChar(50)")]
2155		public string State
2156		{
2157			get
2158			{
2159				return this._State;
2160			}
2161			set
2162			{
2163				if ((this._State != value))
2164				{
2165					this.OnStateChanging(value);
2166					this.SendPropertyChanging();
2167					this._State = value;
2168					this.SendPropertyChanged("State");
2169					this.OnStateChanged();
2170				}
2171			}
2172		}
2173		
2174		[Column(Storage="_AddressLine1", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
2175		public string AddressLine1
2176		{
2177			get
2178			{
2179				return this._AddressLine1;
2180			}
2181			set
2182			{
2183				if ((this._AddressLine1 != value))
2184				{
2185					this.OnAddressLine1Changing(value);
2186					this.SendPropertyChanging();
2187					this._AddressLine1 = value;
2188					this.SendPropertyChanged("AddressLine1");
2189					this.OnAddressLine1Changed();
2190				}
2191			}
2192		}
2193		
2194		[Column(Storage="_AddressLine2", DbType="NVarChar(255)")]
2195		public string AddressLine2
2196		{
2197			get
2198			{
2199				return this._AddressLine2;
2200			}
2201			set
2202			{
2203				if ((this._AddressLine2 != value))
2204				{
2205					this.OnAddressLine2Changing(value);
2206					this.SendPropertyChanging();
2207					this._AddressLine2 = value;
2208					this.SendPropertyChanged("AddressLine2");
2209					this.OnAddressLine2Changed();
2210				}
2211			}
2212		}
2213		
2214		[Column(Storage="_Zip", DbType="Int")]
2215		public System.Nullable<int> Zip
2216		{
2217			get
2218			{
2219				return this._Zip;
2220			}
2221			set
2222			{
2223				if ((this._Zip != value))
2224				{
2225					this.OnZipChanging(value);
2226					this.SendPropertyChanging();
2227					this._Zip = value;
2228					this.SendPropertyChanged("Zip");
2229					this.OnZipChanged();
2230				}
2231			}
2232		}
2233		
2234		[Column(Storage="_Country", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
2235		public string Country
2236		{
2237			get
2238			{
2239				return this._Country;
2240			}
2241			set
2242			{
2243				if ((this._Country != value))
2244				{
2245					this.OnCountryChanging(value);
2246					this.SendPropertyChanging();
2247					this._Country = value;
2248					this.SendPropertyChanged("Country");
2249					this.OnCountryChanged();
2250				}
2251			}
2252		}
2253		
2254		[Association(Name="Location_Greenhouse", Storage="_Greenhouses", ThisKey="LocationId", OtherKey="LocationId")]
2255		public EntitySet<Greenhouse> Greenhouses
2256		{
2257			get
2258			{
2259				return this._Greenhouses;
2260			}
2261			set
2262			{
2263				this._Greenhouses.Assign(value);
2264			}
2265		}
2266		
2267		public event PropertyChangingEventHandler PropertyChanging;
2268		
2269		public event PropertyChangedEventHandler PropertyChanged;
2270		
2271		protected virtual void SendPropertyChanging()
2272		{
2273			if ((this.PropertyChanging != null))
2274			{
2275				this.PropertyChanging(this, emptyChangingEventArgs);
2276			}
2277		}
2278		
2279		protected virtual void SendPropertyChanged(String propertyName)
2280		{
2281			if ((this.PropertyChanged != null))
2282			{
2283				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
2284			}
2285		}
2286		
2287		private void attach_Greenhouses(Greenhouse entity)
2288		{
2289			this.SendPropertyChanging();
2290			entity.Location = this;
2291		}
2292		
2293		private void detach_Greenhouses(Greenhouse entity)
2294		{
2295			this.SendPropertyChanging();
2296			entity.Location = null;
2297		}
2298	}
2299	
2300	[Table(Name="dbo.aspnet_Membership")]
2301	public partial class Membership : INotifyPropertyChanging, INotifyPropertyChanged
2302	{
2303		
2304		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
2305		
2306		private System.Guid _ApplicationId;
2307		
2308		private System.Guid _UserId;
2309		
2310		private string _Password;
2311		
2312		private int _PasswordFormat;
2313		
2314		private string _PasswordSalt;
2315		
2316		private string _MobilePIN;
2317		
2318		private string _Email;
2319		
2320		private string _LoweredEmail;
2321		
2322		private string _PasswordQuestion;
2323		
2324		private string _PasswordAnswer;
2325		
2326		private bool _IsApproved;
2327		
2328		private bool _IsLockedOut;
2329		
2330		private System.DateTime _CreateDate;
2331		
2332		private System.DateTime _LastLoginDate;
2333		
2334		private System.DateTime _LastPasswordChangedDate;
2335		
2336		private System.DateTime _LastLockoutDate;
2337		
2338		private int _FailedPasswordAttemptCount;
2339		
2340		private System.DateTime _FailedPasswordAttemptWindowStart;
2341		
2342		private int _FailedPasswordAnswerAttemptCount;
2343		
2344		private System.DateTime _FailedPasswordAnswerAttemptWindowStart;
2345		
2346		private string _Comment;
2347		
2348		private EntityRef<User> _User;
2349		
2350    #region Extensibility Method Definitions
2351    partial void OnLoaded();
2352    partial void OnValidate(System.Data.Linq.ChangeAction action);
2353    partial void OnCreated();
2354    partial void OnApplicationIdChanging(System.Guid value);
2355    partial void OnApplicationIdChanged();
2356    partial void OnUserIdChanging(System.Guid value);
2357    partial void OnUserIdChanged();
2358    partial void OnPasswordChanging(string value);
2359    partial void OnPasswordChanged();
2360    partial void OnPasswordFormatChanging(int value);
2361    partial void OnPasswordFormatChanged();
2362    partial void OnPasswordSaltChanging(string value);
2363    partial void OnPasswordSaltChanged();
2364    partial void OnMobilePINChanging(string value);
2365    partial void OnMobilePINChanged();
2366    partial void OnEmailChanging(string value);
2367    partial void OnEmailChanged();
2368    partial void OnLoweredEmailChanging(string value);
2369    partial void OnLoweredEmailChanged();
2370    partial void OnPasswordQuestionChanging(string value);
2371    partial void OnPasswordQuestionChanged();
2372    partial void OnPasswordAnswerChanging(string value);
2373    partial void OnPasswordAnswerChanged();
2374    partial void OnIsApprovedChanging(bool value);
2375    partial void OnIsApprovedChanged();
2376    partial void OnIsLockedOutChanging(bool value);
2377    partial void OnIsLockedOutChanged();
2378    partial void OnCreateDateChanging(System.DateTime value);
2379    partial void OnCreateDateChanged();
2380    partial void OnLastLoginDateChanging(System.DateTime value);
2381    partial void OnLastLoginDateChanged();
2382    partial void OnLastPasswordChangedDateChanging(System.DateTime value);
2383    partial void OnLastPasswordChangedDateChanged();
2384    partial void OnLastLockoutDateChanging(System.DateTime value);
2385    partial void OnLastLockoutDateChanged();
2386    partial void OnFailedPasswordAttemptCountChanging(int value);
2387    partial void OnFailedPasswordAttemptCountChanged();
2388    partial void OnFailedPasswordAttemptWindowStartChanging(System.DateTime value);
2389    partial void OnFailedPasswordAttemptWindowStartChanged();
2390    partial void OnFailedPasswordAnswerAttemptCountChanging(int value);
2391    partial void OnFailedPasswordAnswerAttemptCountChanged();
2392    partial void OnFailedPasswordAnswerAttemptWindowStartChanging(System.DateTime value);
2393    partial void OnFailedPasswordAnswerAttemptWindowStartChanged();
2394    partial void OnCommentChanging(string value);
2395    partial void OnCommentChanged();
2396    #endregion
2397		
2398		public Membership()
2399		{
2400			this._User = default(EntityRef<User>);
2401			OnCreated();
2402		}
2403		
2404		[Column(Storage="_ApplicationId", DbType="UniqueIdentifier NOT NULL")]
2405		public System.Guid ApplicationId
2406		{
2407			get
2408			{
2409				return this._ApplicationId;
2410			}
2411			set
2412			{
2413				if ((this._ApplicationId != value))
2414				{
2415					this.OnApplicationIdChanging(value);
2416					this.SendPropertyChanging();
2417					this._ApplicationId = value;
2418					this.SendPropertyChanged("ApplicationId");
2419					this.OnApplicationIdChanged();
2420				}
2421			}
2422		}
2423		
2424		[Column(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
2425		public System.Guid UserId
2426		{
2427			get
2428			{
2429				return this._UserId;
2430			}
2431			set
2432			{
2433				if ((this._UserId != value))
2434				{
2435					if (this._User.HasLoadedOrAssignedValue)
2436					{
2437						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
2438					}
2439					this.OnUserIdChanging(value);
2440					this.SendPropertyChanging();
2441					this._UserId = value;
2442					this.SendPropertyChanged("UserId");
2443					this.OnUserIdChanged();
2444				}
2445			}
2446		}
2447		
2448		[Column(Storage="_Password", DbType="NVarChar(128) NOT NULL", CanBeNull=false)]
2449		public string Password
2450		{
2451			get
2452			{
2453				return this._Password;
2454			}
2455			set
2456			{
2457				if ((this._Password != value))
2458				{
2459					this.OnPasswordChanging(value);
2460					this.SendPropertyChanging();
2461					this._Password = value;
2462					this.SendPropertyChanged("Password");
2463					this.OnPasswordChanged();
2464				}
2465			}
2466		}
2467		
2468		[Column(Storage="_PasswordFormat", DbType="Int NOT NULL")]
2469		public int PasswordFormat
2470		{
2471			get
2472			{
2473				return this._PasswordFormat;
2474			}
2475			set
2476			{
2477				if ((this._PasswordFormat != value))
2478				{
2479					this.OnPasswordFormatChanging(value);
2480					this.SendPropertyChanging();
2481					this._PasswordFormat = value;
2482					this.SendPropertyChanged("PasswordFormat");
2483					this.OnPasswordFormatChanged();
2484				}
2485			}
2486		}
2487		
2488		[Column(Storage="_PasswordSalt", DbType="NVarChar(128) NOT NULL", CanBeNull=false)]
2489		public string PasswordSalt
2490		{
2491			get
2492			{
2493				return this._PasswordSalt;
2494			}
2495			set
2496			{
2497				if ((this._PasswordSalt != value))
2498				{
2499					this.OnPasswordSaltChanging(value);
2500					this.SendPropertyChanging();
2501					this._PasswordSalt = value;
2502					this.SendPropertyChanged("PasswordSalt");
2503					this.OnPasswordSaltChanged();
2504				}
2505			}
2506		}
2507		
2508		[Column(Storage="_MobilePIN", DbType="NVarChar(16)")]
2509		public string MobilePIN
2510		{
2511			get
2512			{
2513				return this._MobilePIN;
2514			}
2515			set
2516			{
2517				if ((this._MobilePIN != value))
2518				{
2519					this.OnMobilePINChanging(value);
2520					this.SendPropertyChanging();
2521					this._MobilePIN = value;
2522					this.SendPropertyChanged("MobilePIN");
2523					this.OnMobilePINChanged();
2524				}
2525			}
2526		}
2527		
2528		[Column(Storage="_Email", DbType="NVarChar(256)")]
2529		public string Email
2530		{
2531			get
2532			{
2533				return this._Email;
2534			}
2535			set
2536			{
2537				if ((this._Email != value))
2538				{
2539					this.OnEmailChanging(value);
2540					this.SendPropertyChanging();
2541					this._Email = value;
2542					this.SendPropertyChanged("Email");
2543					this.OnEmailChanged();
2544				}
2545			}
2546		}
2547		
2548		[Column(Storage="_LoweredEmail", DbType="NVarChar(256)")]
2549		public string LoweredEmail
2550		{
2551			get
2552			{
2553				return this._LoweredEmail;
2554			}
2555			set
2556			{
2557				if ((this._LoweredEmail != value))
2558				{
2559					this.OnLoweredEmailChanging(value);
2560					this.SendPropertyChanging();
2561					this._LoweredEmail = value;
2562					this.SendPropertyChanged("LoweredEmail");
2563					this.OnLoweredEmailChanged();
2564				}
2565			}
2566		}
2567		
2568		[Column(Storage="_PasswordQuestion", DbType="NVarChar(256)")]
2569		public string PasswordQuestion
2570		{
2571			get
2572			{
2573				return this._PasswordQuestion;
2574			}
2575			set
2576			{
2577				if ((this._PasswordQuestion != value))
2578				{
2579					this.OnPasswordQuestionChanging(value);
2580					this.SendPropertyChanging();
2581					this._PasswordQuestion = value;
2582					this.SendPropertyChanged("PasswordQuestion");
2583					this.OnPasswordQuestionChanged();
2584				}
2585			}
2586		}
2587		
2588		[Column(Storage="_PasswordAnswer", DbType="NVarChar(128)")]
2589		public string PasswordAnswer
2590		{
2591			get
2592			{
2593				return this._PasswordAnswer;
2594			}
2595			set
2596			{
2597				if ((this._PasswordAnswer != value))
2598				{
2599					this.OnPasswordAnswerChanging(value);
2600					this.SendPropertyChanging();
2601					this._PasswordAnswer = value;
2602					this.SendPropertyChanged("PasswordAnswer");
2603					this.OnPasswordAnswerChanged();
2604				}
2605			}
2606		}
2607		
2608		[Column(Storage="_IsApproved", DbType="Bit NOT NULL")]
2609		public bool IsApproved
2610		{
2611			get
2612			{
2613				return this._IsApproved;
2614			}
2615			set
2616			{
2617				if ((this._IsApproved != value))
2618				{
2619					this.OnIsApprovedChanging(value);
2620					this.SendPropertyChanging();
2621					this._IsApproved = value;
2622					this.SendPropertyChanged("IsApproved");
2623					this.OnIsApprovedChanged();
2624				}
2625			}
2626		}
2627		
2628		[Column(Storage="_IsLockedOut", DbType="Bit NOT NULL")]
2629		public bool IsLockedOut
2630		{
2631			get
2632			{
2633				return this._IsLockedOut;
2634			}
2635			set
2636			{
2637				if ((this._IsLockedOut != value))
2638				{
2639					this.OnIsLockedOutChanging(value);
2640					this.SendPropertyChanging();
2641					this._IsLockedOut = value;
2642					this.SendPropertyChanged("IsLockedOut");
2643					this.OnIsLockedOutChanged();
2644				}
2645			}
2646		}
2647		
2648		[Column(Storage="_CreateDate", DbType="DateTime NOT NULL")]
2649		public System.DateTime CreateDate
2650		{
2651			get
2652			{
2653				return this._CreateDate;
2654			}
2655			set
2656			{
2657				if ((this._CreateDate != value))
2658				{
2659					this.OnCreateDateChanging(value);
2660					this.SendPropertyChanging();
2661					this._CreateDate = value;
2662					this.SendPropertyChanged("CreateDate");
2663					this.OnCreateDateChanged();
2664				}
2665			}
2666		}
2667		
2668		[Column(Storage="_LastLoginDate", DbType="DateTime NOT NULL")]
2669		public System.DateTime LastLoginDate
2670		{
2671			get
2672			{
2673				return this._LastLoginDate;
2674			}
2675			set
2676			{
2677				if ((this._LastLoginDate != value))
2678				{
2679					this.OnLastLoginDateChanging(value);
2680					this.SendPropertyChanging();
2681					this._LastLoginDate = value;
2682					this.SendPropertyChanged("LastLoginDate");
2683					this.OnLastLoginDateChanged();
2684				}
2685			}
2686		}
2687		
2688		[Column(Storage="_LastPasswordChangedDate", DbType="DateTime NOT NULL")]
2689		public System.DateTime LastPasswordChangedDate
2690		{
2691			get
2692			{
2693				return this._LastPasswordChangedDate;
2694			}
2695			set
2696			{
2697				if ((this._LastPasswordChangedDate != value))
2698				{
2699					this.OnLastPasswordChangedDateChanging(value);
2700					this.SendPropertyChanging();
2701					this._LastPasswordChangedDate = value;
2702					this.SendPropertyChanged("LastPasswordChangedDate");
2703					this.OnLastPasswordChangedDateChanged();
2704				}
2705			}
2706		}
2707		
2708		[Column(Storage="_LastLockoutDate", DbType="DateTime NOT NULL")]
2709		public System.DateTime LastLockoutDate
2710		{
2711			get
2712			{
2713				return this._LastLockoutDate;
2714			}
2715			set
2716			{
2717				if ((this._LastLockoutDate != value))
2718				{
2719					this.OnLastLockoutDateChanging(value);
2720					this.SendPropertyChanging();
2721					this._LastLockoutDate = value;
2722					this.SendPropertyChanged("LastLockoutDate");
2723					this.OnLastLockoutDateChanged();
2724				}
2725			}
2726		}
2727		
2728		[Column(Storage="_FailedPasswordAttemptCount", DbType="Int NOT NULL")]
2729		public int FailedPasswordAttemptCount
2730		{
2731			get
2732			{
2733				return this._FailedPasswordAttemptCount;
2734			}
2735			set
2736			{
2737				if ((this._FailedPasswordAttemptCount != value))
2738				{
2739					this.OnFailedPasswordAttemptCountChanging(value);
2740					this.SendPropertyChanging();
2741					this._FailedPasswordAttemptCount = value;
2742					this.SendPropertyChanged("FailedPasswordAttemptCount");
2743					this.OnFailedPasswordAttemptCountChanged();
2744				}
2745			}
2746		}
2747		
2748		[Column(Storage="_FailedPasswordAttemptWindowStart", DbType="DateTime NOT NULL")]
2749		public System.DateTime FailedPasswordAttemptWindowStart
2750		{
2751			get
2752			{
2753				return this._FailedPasswordAttemptWindowStart;
2754			}
2755			set
2756			{
2757				if ((this._FailedPasswordAttemptWindowStart != value))
2758				{
2759					this.OnFailedPasswordAttemptWindowStartChanging(value);
2760					this.SendPropertyChanging();
2761					this._FailedPasswordAttemptWindowStart = value;
2762					this.SendPropertyChanged("FailedPasswordAttemptWindowStart");
2763					this.OnFailedPasswordAttemptWindowStartChanged();
2764				}
2765			}
2766		}
2767		
2768		[Column(Storage="_FailedPasswordAnswerAttemptCount", DbType="Int NOT NULL")]
2769		public int FailedPasswordAnswerAttemptCount
2770		{
2771			get
2772			{
2773				return this._FailedPasswordAnswerAttemptCount;
2774			}
2775			set
2776			{
2777				if ((this._FailedPasswordAnswerAttemptCount != value))
2778				{
2779					this.OnFailedPasswordAnswerAttemptCountChanging(value);
2780					this.SendPropertyChanging();
2781					this._FailedPasswordAnswerAttemptCount = value;
2782					this.SendPropertyChanged("FailedPasswordAnswerAttemptCount");
2783					this.OnFailedPasswordAnswerAttemptCountChanged();
2784				}
2785			}
2786		}
2787		
2788		[Column(Storage="_FailedPasswordAnswerAttemptWindowStart", DbType="DateTime NOT NULL")]
2789		public System.DateTime FailedPasswordAnswerAttemptWindowStart
2790		{
2791			get
2792			{
2793				return this._FailedPasswordAnswerAttemptWindowStart;
2794			}
2795			set
2796			{
2797				if ((this._FailedPasswordAnswerAttemptWindowStart != value))
2798				{
2799					this.OnFailedPasswordAnswerAttemptWindowStartChanging(value);
2800					this.SendPropertyChanging();
2801					this._FailedPasswordAnswerAttemptWindowStart = value;
2802					this.SendPropertyChanged("FailedPasswordAnswerAttemptWindowStart");
2803					this.OnFailedPasswordAnswerAttemptWindowStartChanged();
2804				}
2805			}
2806		}
2807		
2808		[Column(Storage="_Comment", DbType="NText", UpdateCheck=UpdateCheck.Never)]
2809		public string Comment
2810		{
2811			get
2812			{
2813				return this._Comment;
2814			}
2815			set
2816			{
2817				if ((this._Comment != value))
2818				{
2819					this.OnCommentChanging(value);
2820					this.SendPropertyChanging();
2821					this._Comment = value;
2822					this.SendPropertyChanged("Comment");
2823					this.OnCommentChanged();
2824				}
2825			}
2826		}
2827		
2828		[Association(Name="aspnet_User_aspnet_Membership", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true)]
2829		public User User
2830		{
2831			get
2832			{
2833				return this._User.Entity;
2834			}
2835			set
2836			{
2837				User previousValue = this._User.Entity;
2838				if (((previousValue != value) 
2839							|| (this._User.HasLoadedOrAssignedValue == false)))
2840				{
2841					this.SendPropertyChanging();
2842					if ((previousValue != null))
2843					{
2844						this._User.Entity = null;
2845						previousValue.Membership = null;
2846					}
2847					this._User.Entity = value;
2848					if ((value != null))
2849					{
2850						value.Membership = this;
2851						this._UserId = value.UserId;
2852					}
2853					else
2854					{
2855						this._UserId = default(System.Guid);
2856					}
2857					this.SendPropertyChanged("User");
2858				}
2859			}
2860		}
2861		
2862		public event PropertyChangingEventHandler PropertyChanging;
2863		
2864		public event PropertyChangedEventHandler PropertyChanged;
2865		
2866		protected virtual void SendPropertyChanging()
2867		{
2868			if ((this.PropertyChanging != null))
2869			{
2870				this.PropertyChanging(this, emptyChangingEventArgs);
2871			}
2872		}
2873		
2874		protected virtual void SendPropertyChanged(String propertyName)
2875		{
2876			if ((this.PropertyChanged != null))
2877			{
2878				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
2879			}
2880		}
2881	}
2882	
2883	[Table(Name="dbo.aspnet_Users")]
2884	public partial class User : INotifyPropertyChanging, INotifyPropertyChanged
2885	{
2886		
2887		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
2888		
2889		private System.Guid _ApplicationId;
2890		
2891		private System.Guid _UserId;
2892		
2893		private string _UserName;
2894		
2895		private string _LoweredUserName;
2896		
2897		private string _MobileAlias;
2898		
2899		private bool _IsAnonymous;
2900		
2901		private System.DateTime _LastActivityDate;
2902		
2903		private EntityRef<Membership> _Membership;
2904		
2905		private EntitySet<Customer> _Customers;
2906		
2907    #region Extensibility Method Definitions
2908    partial void OnLoaded();
2909    partial void OnValidate(System.Data.Linq.ChangeAction action);
2910    partial void OnCreated();
2911    partial void OnApplicationIdChanging(System.Guid value);
2912    partial void OnApplicationIdChanged();
2913    partial void OnUserIdChanging(System.Guid value);
2914    partial void OnUserIdChanged();
2915    partial void OnUserNameChanging(string value);
2916    partial void OnUserNameChanged();
2917    partial void OnLoweredUserNameChanging(string value);
2918    partial void OnLoweredUserNameChanged();
2919    partial void OnMobileAliasChanging(string value);
2920    partial void OnMobileAliasChanged();
2921    partial void OnIsAnonymousChanging(bool value);
2922    partial void OnIsAnonymousChanged();
2923    partial void OnLastActivityDateChanging(System.DateTime value);
2924    partial void OnLastActivityDateChanged();
2925    #endregion
2926		
2927		public User()
2928		{
2929			this._Membership = default(EntityRef<Membership>);
2930			this._Customers = new EntitySet<Customer>(new Action<Customer>(this.attach_Customers), new Action<Customer>(this.detach_Customers));
2931			OnCreated();
2932		}
2933		
2934		[Column(Storage="_ApplicationId", DbType="UniqueIdentifier NOT NULL")]
2935		public System.Guid ApplicationId
2936		{
2937			get
2938			{
2939				return this._ApplicationId;
2940			}
2941			set
2942			{
2943				if ((this._ApplicationId != value))
2944				{
2945					this.OnApplicationIdChanging(value);
2946					this.SendPropertyChanging();
2947					this._ApplicationId = value;
2948					this.SendPropertyChanged("ApplicationId");
2949					this.OnApplicationIdChanged();
2950				}
2951			}
2952		}
2953		
2954		[Column(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
2955		public System.Guid UserId
2956		{
2957			get
2958			{
2959				return this._UserId;
2960			}
2961			set
2962			{
2963				if ((this._UserId != value))
2964				{
2965					this.OnUserIdChanging(value);
2966					this.SendPropertyChanging();
2967					this._UserId = value;
2968					this.SendPropertyChanged("UserId");
2969					this.OnUserIdChanged();
2970				}
2971			}
2972		}
2973		
2974		[Column(Storage="_UserName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
2975		public string UserName
2976		{
2977			get
2978			{
2979				return this._UserName;
2980			}
2981			set
2982			{
2983				if ((this._UserName != value))
2984				{
2985					this.OnUserNameChanging(value);
2986					this.SendPropertyChanging();
2987					this._UserName = value;
2988					this.SendPropertyChanged("UserName");
2989					this.OnUserNameChanged();
2990				}
2991			}
2992		}
2993		
2994		[Column(Storage="_LoweredUserName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
2995		public string LoweredUserName
2996		{
2997			get
2998			{
2999				return this._LoweredUserName;
3000			}
3001			set
3002			{
3003				if ((this._LoweredUserName != value))
3004				{
3005					this.OnLoweredUserNameChanging(value);
3006					this.SendPropertyChanging();
3007					this._LoweredUserName = value;
3008					this.SendPropertyChanged("LoweredUserName");
3009					this.OnLoweredUserNameChanged();
3010				}
3011			}
3012		}
3013		
3014		[Column(Storage="_MobileAlias", DbType="NVarChar(16)")]
3015		public string MobileAlias
3016		{
3017			get
3018			{
3019				return this._MobileAlias;
3020			}
3021			set
3022			{
3023				if ((this._MobileAlias != value))
3024				{
3025					this.OnMobileAliasChanging(value);
3026					this.SendPropertyChanging();
3027					this._MobileAlias = value;
3028					this.SendPropertyChanged("MobileAlias");
3029					this.OnMobileAliasChanged();
3030				}
3031			}
3032		}
3033		
3034		[Column(Storage="_IsAnonymous", DbType="Bit NOT NULL")]
3035		public bool IsAnonymous
3036		{
3037			get
3038			{
3039				return this._IsAnonymous;
3040			}
3041			set
3042			{
3043				if ((this._IsAnonymous != value))
3044				{
3045					this.OnIsAnonymousChanging(value);
3046					this.SendPropertyChanging();
3047					this._IsAnonymous = value;
3048					this.SendPropertyChanged("IsAnonymous");
3049					this.OnIsAnonymousChanged();
3050				}
3051			}
3052		}
3053		
3054		[Column(Storage="_LastActivityDate", DbType="DateTime NOT NULL")]
3055		public System.DateTime LastActivityDate
3056		{
3057			get
3058			{
3059				return this._LastActivityDate;
3060			}
3061			set
3062			{
3063				if ((this._LastActivityDate != value))
3064				{
3065					this.OnLastActivityDateChanging(value);
3066					this.SendPropertyChanging();
3067					this._LastActivityDate = value;
3068					this.SendPropertyChanged("LastActivityDate");
3069					this.OnLastActivityDateChanged();
3070				}
3071			}
3072		}
3073		
3074		[Association(Name="aspnet_User_aspnet_Membership", Storage="_Membership", ThisKey="UserId", OtherKey="UserId", IsUnique=true, IsForeignKey=false)]
3075		public Membership Membership
3076		{
3077			get
3078			{
3079				return this._Membership.Entity;
3080			}
3081			set
3082			{
3083				Membership previousValue = this._Membership.Entity;
3084				if (((previousValue != value) 
3085							|| (this._Membership.HasLoadedOrAssignedValue == false)))
3086				{
3087					this.SendPropertyChanging();
3088					if ((previousValue != null))
3089					{
3090						this._Membership.Entity = null;
3091						previousValue.User = null;
3092					}
3093					this._Membership.Entity = value;
3094					if ((value != null))
3095					{
3096						value.User = this;
3097					}
3098					this.SendPropertyChanged("Membership");
3099				}
3100			}
3101		}
3102		
3103		[Association(Name="aspnet_User_dvent_Customer", Storage="_Customers", ThisKey="UserId", OtherKey="UserId")]
3104		public EntitySet<Customer> Customers
3105		{
3106			get
3107			{
3108				return this._Customers;
3109			}
3110			set
3111			{
3112				this._Customers.Assign(value);
3113			}
3114		}
3115		
3116		public event PropertyChangingEventHandler PropertyChanging;
3117		
3118		public event PropertyChangedEventHandler PropertyChanged;
3119		
3120		protected virtual void SendPropertyChanging()
3121		{
3122			if ((this.PropertyChanging != null))
3123			{
3124				this.PropertyChanging(this, emptyChangingEventArgs);
3125			}
3126		}
3127		
3128		protected virtual void SendPropertyChanged(String propertyName)
3129		{
3130			if ((this.PropertyChanged != null))
3131			{
3132				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
3133			}
3134		}
3135		
3136		private void attach_Customers(Customer entity)
3137		{
3138			this.SendPropertyChanging();
3139			entity.User = this;
3140		}
3141		
3142		private void detach_Customers(Customer entity)
3143		{
3144			this.SendPropertyChanging();
3145			entity.User = null;
3146		}
3147	}
3148	
3149	[Table(Name="dbo.dvent_Customer")]
3150	public partial class Customer : INotifyPropertyChanging, INotifyPropertyChanged
3151	{
3152		
3153		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
3154		
3155		private int _CustomerId;
3156		
3157		private string _FirstName;
3158		
3159		private string _LastName;
3160		
3161		private string _Address1;
3162		
3163		private string _Address2;
3164		
3165		private string _Phone;
3166		
3167		private string _Email;
3168		
3169		private string _Username;
3170		
3171		private string _Password;
3172		
3173		private string _AddedBy;
3174		
3175		private string _ModifiedBy;
3176		
3177		private System.DateTime _DateAdded;
3178		
3179		private System.Nullable<System.DateTime> _DateModified;
3180		
3181		private System.Nullable<System.Guid> _UserId;
3182		
3183		private EntityRef<User> _User;
3184		
3185    #region Extensibility Method Definitions
3186    partial void OnLoaded();
3187    partial void OnValidate(System.Data.Linq.ChangeAction action);
3188    partial void OnCreated();
3189    partial void OnCustomerIdChanging(int value);
3190    partial void OnCustomerIdChanged();
3191    partial void OnFirstNameChanging(string value);
3192    partial void OnFirstNameChanged();
3193    partial void OnLastNameChanging(string value);
3194    partial void OnLastNameChanged();
3195    partial void OnAddress1Changing(string value);
3196    partial void OnAddress1Changed();
3197    partial void OnAddress2Changing(string value);
3198    partial void OnAddress2Changed();
3199    partial void OnPhoneChanging(string value);
3200    partial void OnPhoneChanged();
3201    partial void OnEmailChanging(string value);
3202    partial void OnEmailChanged();
3203    partial void OnUsernameChanging(string value);
3204    partial void OnUsernameChanged();
3205    partial void OnPasswordChanging(string value);
3206    partial void OnPasswordChanged();
3207    partial void OnAddedByChanging(string value);
3208    partial void OnAddedByChanged();
3209    partial void OnModifiedByChanging(string value);
3210    partial void OnModifiedByChanged();
3211    partial void OnDateAddedChanging(System.DateTime value);
3212    partial void OnDateAddedChanged();
3213    partial void OnDateModifiedChanging(System.Nullable<System.DateTime> value);
3214    partial void OnDateModifiedChanged();
3215    partial void OnUserIdChanging(System.Nullable<System.Guid> value);
3216    partial void OnUserIdChanged();
3217    #endregion
3218		
3219		public Customer()
3220		{
3221			this._User = default(EntityRef<User>);
3222			OnCreated();
3223		}
3224		
3225		[Column(Storage="_CustomerId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
3226		public int CustomerId
3227		{
3228			get
3229			{
3230				return this._CustomerId;
3231			}
3232			set
3233			{
3234				if ((this._CustomerId != value))
3235				{
3236					this.OnCustomerIdChanging(value);
3237					this.SendPropertyChanging();
3238					this._CustomerId = value;
3239					this.SendPropertyChanged("CustomerId");
3240					this.OnCustomerIdChanged();
3241				}
3242			}
3243		}
3244		
3245		[Column(Storage="_FirstName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
3246		public string FirstName
3247		{
3248			get
3249			{
3250				return this._FirstName;
3251			}
3252			set
3253			{
3254				if ((this._FirstName != value))
3255				{
3256					this.OnFirstNameChanging(value);
3257					this.SendPropertyChanging();
3258					this._FirstName = value;
3259					this.SendPropertyChanged("FirstName");
3260					this.OnFirstNameChanged();
3261				}
3262			}
3263		}
3264		
3265		[Column(Storage="_LastName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
3266		public string LastName
3267		{
3268			get
3269			{
3270				return this._LastName;
3271			}
3272			set
3273			{
3274				if ((this._LastName != value))
3275				{
3276					this.OnLastNameChanging(value);
3277					this.SendPropertyChanging();
3278					this._LastName = value;
3279					this.SendPropertyChanged("LastName");
3280					this.OnLastNameChanged();
3281				}
3282			}
3283		}
3284		
3285		[Column(Storage="_Address1", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
3286		public string Address1
3287		{
3288			get
3289			{
3290				return this._Address1;
3291			}
3292			set
3293			{
3294				if ((this._Address1 != value))
3295				{
3296					this.OnAddress1Changing(value);
3297					this.SendPropertyChanging();
3298					this._Address1 = value;
3299					this.SendPropertyChanged("Address1");
3300					this.OnAddress1Changed();
3301				}
3302			}
3303		}
3304		
3305		[Column(Storage="_Address2", DbType="NVarChar(50)")]
3306		public string Address2
3307		{
3308			get
3309			{
3310				return this._Address2;
3311			}
3312			set
3313			{
3314				if ((this._Address2 != value))
3315				{
3316					this.OnAddress2Changing(value);
3317					this.SendPropertyChanging();
3318					this._Address2 = value;
3319					this.SendPropertyChanged("Address2");
3320					this.OnAddress2Changed();
3321				}
3322			}
3323		}
3324		
3325		[Column(Storage="_Phone", DbType="NVarChar(10) NOT NULL", CanBeNull=false)]
3326		public string Phone
3327		{
3328			get
3329			{
3330				return this._Phone;
3331			}
3332			set
3333			{
3334				if ((this._Phone != value))
3335				{
3336					this.OnPhoneChanging(value);
3337					this.SendPropertyChanging();
3338					this._Phone = value;
3339					this.SendPropertyChanged("Phone");
3340					this.OnPhoneChanged();
3341				}
3342			}
3343		}
3344		
3345		[Column(Storage="_Email", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
3346		public string Email
3347		{
3348			get
3349			{
3350				return this._Email;
3351			}
3352			set
3353			{
3354				if ((this._Email != value))
3355				{
3356					this.OnEmailChanging(value);
3357					this.SendPropertyChanging();
3358					this._Email = value;
3359					this.SendPropertyChanged("Email");
3360					this.OnEmailChanged();
3361				}
3362			}
3363		}
3364		
3365		[Column(Storage="_Username", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
3366		public string Username
3367		{
3368			get
3369			{
3370				return this._Username;
3371			}
3372			set
3373			{
3374				if ((this._Username != value))
3375				{
3376					this.OnUsernameChanging(value);
3377					this.SendPropertyChanging();
3378					this._Username = value;
3379					this.SendPropertyChanged("Username");
3380					this.OnUsernameChanged();
3381				}
3382			}
3383		}
3384		
3385		[Column(Storage="_Password", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
3386		public string Password
3387		{
3388			get
3389			{
3390				return this._Password;
3391			}
3392			set
3393			{
3394				if ((this._Password != value))
3395				{
3396					this.OnPasswordChanging(value);
3397					this.SendPropertyChanging();
3398					this._Password = value;
3399					this.SendPropertyChanged("Password");
3400					this.OnPasswordChanged();
3401				}
3402			}
3403		}
3404		
3405		[Column(Storage="_AddedBy", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
3406		public string AddedBy
3407		{
3408			get
3409			{
3410				return this._AddedBy;
3411			}
3412			set
3413			{
3414				if ((this._AddedBy != value))
3415				{
3416					this.OnAddedByChanging(value);
3417					this.SendPropertyChanging();
3418					this._AddedBy = value;
3419					this.SendPropertyChanged("AddedBy");
3420					this.OnAddedByChanged();
3421				}
3422			}
3423		}
3424		
3425		[Column(Storage="_ModifiedBy", DbType="NVarChar(50)")]
3426		public string ModifiedBy
3427		{
3428			get
3429			{
3430				return this._ModifiedBy;
3431			}
3432			set
3433			{
3434				if ((this._ModifiedBy != value))
3435				{
3436					this.OnModifiedByChanging(value);
3437					this.SendPropertyChanging();
3438					this._ModifiedBy = value;
3439					this.SendPropertyChanged("ModifiedBy");
3440					this.OnModifiedByChanged();
3441				}
3442			}
3443		}
3444		
3445		[Column(Storage="_DateAdded", DbType="DateTime NOT NULL")]
3446		public System.DateTime DateAdded
3447		{
3448			get
3449			{
3450				return this._DateAdded;
3451			}
3452			set
3453			{
3454				if ((this._DateAdded != value))
3455				{
3456					this.OnDateAddedChanging(value);
3457					this.SendPropertyChanging();
3458					this._DateAdded = value;
3459					this.SendPropertyChanged("DateAdded");
3460					this.OnDateAddedChanged();
3461				}
3462			}
3463		}
3464		
3465		[Column(Storage="_DateModified", DbType="DateTime")]
3466		public System.Nullable<System.DateTime> DateModified
3467		{
3468			get
3469			{
3470				return this._DateModified;
3471			}
3472			set
3473			{
3474				if ((this._DateModified != value))
3475				{
3476					this.OnDateModifiedChanging(value);
3477					this.SendPropertyChanging();
3478					this._DateModified = value;
3479					this.SendPropertyChanged("DateModified");
3480					this.OnDateModifiedChanged();
3481				}
3482			}
3483		}
3484		
3485		[Column(Storage="_UserId", DbType="UniqueIdentifier")]
3486		public System.Nullable<System.Guid> UserId
3487		{
3488			get
3489			{
3490				return this._UserId;
3491			}
3492			set
3493			{
3494				if ((this._UserId != value))
3495				{
3496					if (this._User.HasLoadedOrAssignedValue)
3497					{
3498						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
3499					}
3500					this.OnUserIdChanging(value);
3501					this.SendPropertyChanging();
3502					this._UserId = value;
3503					this.SendPropertyChanged("UserId");
3504					this.OnUserIdChanged();
3505				}
3506			}
3507		}
3508		
3509		[Association(Name="aspnet_User_dvent_Customer", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true)]
3510		public User User
3511		{
3512			get
3513			{
3514				return this._User.Entity;
3515			}
3516			set
3517			{
3518				User previousValue = this._User.Entity;
3519				if (((previousValue != value) 
3520							|| (this._User.HasLoadedOrAssignedValue == false)))
3521				{
3522					this.SendPropertyChanging();
3523					if ((previousValue != null))
3524					{
3525						this._User.Entity = null;
3526						previousValue.Customers.Remove(this);
3527					}
3528					this._User.Entity = value;
3529					if ((value != null))
3530					{
3531						value.Customers.Add(this);
3532						this._UserId = value.UserId;
3533					}
3534					else
3535					{
3536						this._UserId = default(Nullable<System.Guid>);
3537					}
3538					this.SendPropertyChanged("User");
3539				}
3540			}
3541		}
3542		
3543		public event PropertyChangingEventHandler PropertyChanging;
3544		
3545		public event PropertyChangedEventHandler PropertyChanged;
3546		
3547		protected virtual void SendPropertyChanging()
3548		{
3549			if ((this.PropertyChanging != null))
3550			{
3551				this.PropertyChanging(this, emptyChangingEventArgs);
3552			}
3553		}
3554		
3555		protected virtual void SendPropertyChanged(String propertyName)
3556		{
3557			if ((this.PropertyChanged != null))
3558			{
3559				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
3560			}
3561		}
3562	}
3563}
3564#pragma warning restore 1591