context: using System; 
  using System.Data.Linq;
  using System.Data.Linq.Mapping;
  using System.Data;
  using System.Collections.Generic;
  using System.Reflection;
  using System.Linq;
  using System.Linq.Expressions;
  using System.ComponentModel;
  using CmsData.Infrastructure;
  
  namespace CmsData
  {
  	[Table(Name="dbo.Attend")]
  	public partial class Attend : INotifyPropertyChanging, INotifyPropertyChanged
  	{
  		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  		
  	#region Private Fields
  		
  		private int _PeopleId;
  		
  		private int _MeetingId;
  		
  		private int _OrganizationId;
  		
  		private DateTime _MeetingDate;
  		
  		private bool _AttendanceFlag;
  		
  		private int? _OtherOrgId;
  		
  		private int? _AttendanceTypeId;
  		
  		private int? _CreatedBy;
  		
  		private DateTime? _CreatedDate;
  		
  		private int _MemberTypeId;
  		
  		private int _AttendId;
  		
  		private int _OtherAttends;
  		
  		private bool? _BFCAttendance;
  		
  		private bool? _Registered;
  		
  		private int? _SeqNo;
  		
  		private int? _Commitment;
  		
  		private bool? _NoShow;
  		
  		private bool? _EffAttendFlag;
  		
     		
     		private EntitySet< SubRequest> _SubRequests;
  		
      	
  		private EntityRef< MemberType> _MemberType;
  		
  		private EntityRef< AttendType> _AttendType;
  		
  		private EntityRef< Meeting> _Meeting;
  		
  		private EntityRef< Organization> _Organization;
  		
  		private EntityRef< Person> _Person;
  		
  	#endregion
  	
      #region Extensibility Method Definitions
      partial void OnLoaded();
      partial void OnValidate(System.Data.Linq.ChangeAction action);
      partial void OnCreated();
  		
  		partial void OnPeopleIdChanging(int value);
  		partial void OnPeopleIdChanged();
  		
  		partial void OnMeetingIdChanging(int value);
  		partial void OnMeetingIdChanged();
  		
  		partial void OnOrganizationIdChanging(int value);
  		partial void OnOrganizationIdChanged();
  		
  		partial void OnMeetingDateChanging(DateTime value);
  		partial void OnMeetingDateChanged();
  		
  		partial void OnAttendanceFlagChanging(bool value);
  		partial void OnAttendanceFlagChanged();
  		
  		partial void OnOtherOrgIdChanging(int? value);
  		partial void OnOtherOrgIdChanged();
  		
  		partial void OnAttendanceTypeIdChanging(int? value);
  		partial void OnAttendanceTypeIdChanged();
  		
  		partial void OnCreatedByChanging(int? value);
  		partial void OnCreatedByChanged();
  		
  		partial void OnCreatedDateChanging(DateTime? value);
  		partial void OnCreatedDateChanged();
  		
  		partial void OnMemberTypeIdChanging(int value);
  		partial void OnMemberTypeIdChanged();
  		
  		partial void OnAttendIdChanging(int value);
  		partial void OnAttendIdChanged();
  		
  		partial void OnOtherAttendsChanging(int value);
  		partial void OnOtherAttendsChanged();
  		
  		partial void OnBFCAttendanceChanging(bool? value);
  		partial void OnBFCAttendanceChanged();
  		
  		partial void OnRegisteredChanging(bool? value);
  		partial void OnRegisteredChanged();
  		
  		partial void OnSeqNoChanging(int? value);
  		partial void OnSeqNoChanged();
  		
  		partial void OnCommitmentChanging(int? value);
  		partial void OnCommitmentChanged();
  		
  		partial void OnNoShowChanging(bool? value);
  		partial void OnNoShowChanged();
  		
  		partial void OnEffAttendFlagChanging(bool? value);
  		partial void OnEffAttendFlagChanged();
  		
      #endregion
  		public Attend()
  		{
  			
  			this._SubRequests = new EntitySet< SubRequest>(new Action< SubRequest>(this.attach_SubRequests), new Action< SubRequest>(this.detach_SubRequests)); 
  			
  			
  			this._MemberType = default(EntityRef< MemberType>); 
  			
  			this._AttendType = default(EntityRef< AttendType>); 
  			
  			this._Meeting = default(EntityRef< Meeting>); 
  			
  			this._Organization = default(EntityRef< Organization>); 
  			
  			this._Person = default(EntityRef< Person>); 
  			
  			OnCreated();
  		}
  
  		
      #region Columns
  		
  		[Column(Name="PeopleId", UpdateCheck=UpdateCheck.Never, Storage="_PeopleId", DbType="int NOT NULL")]
  		[IsForeignKey]
  		public int PeopleId
  		{
  			get { return this._PeopleId; }
  
  			set
  			{
  				if (this._PeopleId != value)
  				{
  				
  					if (this._Person.HasLoadedOrAssignedValue)
  						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  				
                      this.OnPeopleIdChanging(value);
  					this.SendPropertyChanging();
  					this._PeopleId = value;
  					this.SendPropertyChanged("PeopleId");
  					this.OnPeopleIdChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="MeetingId", UpdateCheck=UpdateCheck.Never, Storage="_MeetingId", DbType="int NOT NULL")]
  		[IsForeignKey]
  		public int MeetingId
  		{
  			get { return this._MeetingId; }
  
  			set
  			{
  				if (this._MeetingId != value)
  				{
  				
  					if (this._Meeting.HasLoadedOrAssignedValue)
  						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  				
                      this.OnMeetingIdChanging(value);
  					this.SendPropertyChanging();
  					this._MeetingId = value;
  					this.SendPropertyChanged("MeetingId");
  					this.OnMeetingIdChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="OrganizationId", UpdateCheck=UpdateCheck.Never, Storage="_OrganizationId", DbType="int NOT NULL")]
  		[IsForeignKey]
  		public int OrganizationId
  		{
  			get { return this._OrganizationId; }
  
  			set
  			{
  				if (this._OrganizationId != value)
  				{
  				
  					if (this._Organization.HasLoadedOrAssignedValue)
  						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  				
                      this.OnOrganizationIdChanging(value);
  					this.SendPropertyChanging();
  					this._OrganizationId = value;
  					this.SendPropertyChanged("OrganizationId");
  					this.OnOrganizationIdChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="MeetingDate", UpdateCheck=UpdateCheck.Never, Storage="_MeetingDate", DbType="datetime NOT NULL")]
  		public DateTime MeetingDate
  		{
  			get { return this._MeetingDate; }
  
  			set
  			{
  				if (this._MeetingDate != value)
  				{
  				
                      this.OnMeetingDateChanging(value);
  					this.SendPropertyChanging();
  					this._MeetingDate = value;
  					this.SendPropertyChanged("MeetingDate");
  					this.OnMeetingDateChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="AttendanceFlag", UpdateCheck=UpdateCheck.Never, Storage="_AttendanceFlag", DbType="bit NOT NULL")]
  		public bool AttendanceFlag
  		{
  			get { return this._AttendanceFlag; }
  
  			set
  			{
  				if (this._AttendanceFlag != value)
  				{
  				
                      this.OnAttendanceFlagChanging(value);
  					this.SendPropertyChanging();
  					this._AttendanceFlag = value;
  					this.SendPropertyChanged("AttendanceFlag");
  					this.OnAttendanceFlagChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="OtherOrgId", UpdateCheck=UpdateCheck.Never, Storage="_OtherOrgId", DbType="int")]
  		public int? OtherOrgId
  		{
  			get { return this._OtherOrgId; }
  
  			set
  			{
  				if (this._OtherOrgId != value)
  				{
  				
                      this.OnOtherOrgIdChanging(value);
  					this.SendPropertyChanging();
  					this._OtherOrgId = value;
  					this.SendPropertyChanged("OtherOrgId");
  					this.OnOtherOrgIdChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="AttendanceTypeId", UpdateCheck=UpdateCheck.Never, Storage="_AttendanceTypeId", DbType="int")]
  		[IsForeignKey]
  		public int? AttendanceTypeId
  		{
  			get { return this._AttendanceTypeId; }
  
  			set
  			{
  				if (this._AttendanceTypeId != value)
  				{
  				
  					if (this._AttendType.HasLoadedOrAssignedValue)
  						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  				
                      this.OnAttendanceTypeIdChanging(value);
  					this.SendPropertyChanging();
  					this._AttendanceTypeId = value;
  					this.SendPropertyChanged("AttendanceTypeId");
  					this.OnAttendanceTypeIdChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="CreatedBy", UpdateCheck=UpdateCheck.Never, Storage="_CreatedBy", DbType="int")]
  		public int? CreatedBy
  		{
  			get { return this._CreatedBy; }
  
  			set
  			{
  				if (this._CreatedBy != value)
  				{
  				
                      this.OnCreatedByChanging(value);
  					this.SendPropertyChanging();
  					this._CreatedBy = value;
  					this.SendPropertyChanged("CreatedBy");
  					this.OnCreatedByChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="CreatedDate", UpdateCheck=UpdateCheck.Never, Storage="_CreatedDate", DbType="datetime")]
  		public DateTime? CreatedDate
  		{
  			get { return this._CreatedDate; }
  
  			set
  			{
  				if (this._CreatedDate != value)
  				{
  				
                      this.OnCreatedDateChanging(value);
  					this.SendPropertyChanging();
  					this._CreatedDate = value;
  					this.SendPropertyChanged("CreatedDate");
  					this.OnCreatedDateChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="MemberTypeId", UpdateCheck=UpdateCheck.Never, Storage="_MemberTypeId", DbType="int NOT NULL")]
  		[IsForeignKey]
  		public int MemberTypeId
  		{
  			get { return this._MemberTypeId; }
  
  			set
  			{
  				if (this._MemberTypeId != value)
  				{
  				
  					if (this._MemberType.HasLoadedOrAssignedValue)
  						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  				
                      this.OnMemberTypeIdChanging(value);
  					this.SendPropertyChanging();
  					this._MemberTypeId = value;
  					this.SendPropertyChanged("MemberTypeId");
  					this.OnMemberTypeIdChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="AttendId", UpdateCheck=UpdateCheck.Never, Storage="_AttendId", AutoSync=AutoSync.OnInsert, DbType="int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  		public int AttendId
  		{
  			get { return this._AttendId; }
  
  			set
  			{
  				if (this._AttendId != value)
  				{
  				
                      this.OnAttendIdChanging(value);
  					this.SendPropertyChanging();
  					this._AttendId = value;
  					this.SendPropertyChanged("AttendId");
  					this.OnAttendIdChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="OtherAttends", UpdateCheck=UpdateCheck.Never, Storage="_OtherAttends", DbType="int NOT NULL")]
  		public int OtherAttends
  		{
  			get { return this._OtherAttends; }
  
  			set
  			{
  				if (this._OtherAttends != value)
  				{
  				
                      this.OnOtherAttendsChanging(value);
  					this.SendPropertyChanging();
  					this._OtherAttends = value;
  					this.SendPropertyChanged("OtherAttends");
  					this.OnOtherAttendsChanged();
  				}
  
  			}
  
  		}
  
  		
  		[Column(Name="BFCAttendance", UpdateCheck=UpdateCheck.Never, Storage="_BFCAttendance", DbType="bit")]
  		public bool? BFCAttendance
  		{
  			get { return this._BFCAttendance; }
  
  			set
  			{
  
gt: 				if (this._BFCAttendance != value)