⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dataclasses.designer.cs

📁 精通网络应用系统开发 光盘 该书是人民邮电出版社出版的
💻 CS
📖 第 1 页 / 共 5 页
字号:
		get
		{
			return this._Birthday;
		}
		set
		{
			if ((this._Birthday != value))
			{
				this.OnBirthdayChanging(value);
				this.SendPropertyChanging();
				this._Birthday = value;
				this.SendPropertyChanged("Birthday");
				this.OnBirthdayChanged();
			}
		}
	}
	
	[Column(Storage="_HireDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> HireDate
	{
		get
		{
			return this._HireDate;
		}
		set
		{
			if ((this._HireDate != value))
			{
				this.OnHireDateChanging(value);
				this.SendPropertyChanging();
				this._HireDate = value;
				this.SendPropertyChanged("HireDate");
				this.OnHireDateChanged();
			}
		}
	}
	
	[Column(Storage="_DepartmentID", DbType="Int")]
	public System.Nullable<int> DepartmentID
	{
		get
		{
			return this._DepartmentID;
		}
		set
		{
			if ((this._DepartmentID != value))
			{
				if (this._Department.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnDepartmentIDChanging(value);
				this.SendPropertyChanging();
				this._DepartmentID = value;
				this.SendPropertyChanged("DepartmentID");
				this.OnDepartmentIDChanged();
			}
		}
	}
	
	[Association(Name="Teacher_Class", Storage="_Classes", OtherKey="TeacherID")]
	public EntitySet<Class> Classes
	{
		get
		{
			return this._Classes;
		}
		set
		{
			this._Classes.Assign(value);
		}
	}
	
	[Association(Name="Teacher_Course", Storage="_Courses", OtherKey="TeacherID")]
	public EntitySet<Course> Courses
	{
		get
		{
			return this._Courses;
		}
		set
		{
			this._Courses.Assign(value);
		}
	}
	
	[Association(Name="Department_Teacher", Storage="_Department", ThisKey="DepartmentID", IsForeignKey=true)]
	public Department Department
	{
		get
		{
			return this._Department.Entity;
		}
		set
		{
			Department previousValue = this._Department.Entity;
			if (((previousValue != value) 
						|| (this._Department.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Department.Entity = null;
					previousValue.Teachers.Remove(this);
				}
				this._Department.Entity = value;
				if ((value != null))
				{
					value.Teachers.Add(this);
					this._DepartmentID = value.DepartmentID;
				}
				else
				{
					this._DepartmentID = default(Nullable<int>);
				}
				this.SendPropertyChanged("Department");
			}
		}
	}
	
	public event PropertyChangingEventHandler PropertyChanging;
	
	public event PropertyChangedEventHandler PropertyChanged;
	
	protected virtual void SendPropertyChanging()
	{
		if ((this.PropertyChanging != null))
		{
			this.PropertyChanging(this, emptyChangingEventArgs);
		}
	}
	
	protected virtual void SendPropertyChanged(String propertyName)
	{
		if ((this.PropertyChanged != null))
		{
			this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
	
	private void attach_Classes(Class entity)
	{
		this.SendPropertyChanging();
		entity.Teacher = this;
	}
	
	private void detach_Classes(Class entity)
	{
		this.SendPropertyChanging();
		entity.Teacher = null;
	}
	
	private void attach_Courses(Course entity)
	{
		this.SendPropertyChanging();
		entity.Teacher = this;
	}
	
	private void detach_Courses(Course entity)
	{
		this.SendPropertyChanging();
		entity.Teacher = null;
	}
}

[Table(Name="dbo.Tree")]
public partial class Tree : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _TreeID;
	
	private string _Desn;
	
	private System.Nullable<int> _ParentID;
	
	private string _Url;
	
	private string _ProName;
	
	private EntitySet<Role> _Roles;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnTreeIDChanging(int value);
    partial void OnTreeIDChanged();
    partial void OnDesnChanging(string value);
    partial void OnDesnChanged();
    partial void OnParentIDChanging(System.Nullable<int> value);
    partial void OnParentIDChanged();
    partial void OnUrlChanging(string value);
    partial void OnUrlChanged();
    partial void OnProNameChanging(string value);
    partial void OnProNameChanged();
    #endregion
	
	public Tree()
	{
		this._Roles = new EntitySet<Role>(new Action<Role>(this.attach_Roles), new Action<Role>(this.detach_Roles));
		OnCreated();
	}
	
	[Column(Storage="_TreeID", DbType="Int NOT NULL", IsPrimaryKey=true)]
	public int TreeID
	{
		get
		{
			return this._TreeID;
		}
		set
		{
			if ((this._TreeID != value))
			{
				this.OnTreeIDChanging(value);
				this.SendPropertyChanging();
				this._TreeID = value;
				this.SendPropertyChanged("TreeID");
				this.OnTreeIDChanged();
			}
		}
	}
	
	[Column(Storage="_Desn", DbType="VarChar(200)")]
	public string Desn
	{
		get
		{
			return this._Desn;
		}
		set
		{
			if ((this._Desn != value))
			{
				this.OnDesnChanging(value);
				this.SendPropertyChanging();
				this._Desn = value;
				this.SendPropertyChanged("Desn");
				this.OnDesnChanged();
			}
		}
	}
	
	[Column(Storage="_ParentID", DbType="Int")]
	public System.Nullable<int> ParentID
	{
		get
		{
			return this._ParentID;
		}
		set
		{
			if ((this._ParentID != value))
			{
				this.OnParentIDChanging(value);
				this.SendPropertyChanging();
				this._ParentID = value;
				this.SendPropertyChanged("ParentID");
				this.OnParentIDChanged();
			}
		}
	}
	
	[Column(Storage="_Url", DbType="VarChar(200)")]
	public string Url
	{
		get
		{
			return this._Url;
		}
		set
		{
			if ((this._Url != value))
			{
				this.OnUrlChanging(value);
				this.SendPropertyChanging();
				this._Url = value;
				this.SendPropertyChanged("Url");
				this.OnUrlChanged();
			}
		}
	}
	
	[Column(Storage="_ProName", DbType="VarChar(200)")]
	public string ProName
	{
		get
		{
			return this._ProName;
		}
		set
		{
			if ((this._ProName != value))
			{
				this.OnProNameChanging(value);
				this.SendPropertyChanging();
				this._ProName = value;
				this.SendPropertyChanged("ProName");
				this.OnProNameChanged();
			}
		}
	}
	
	[Association(Name="Tree_Role", Storage="_Roles", OtherKey="TreeID")]
	public EntitySet<Role> Roles
	{
		get
		{
			return this._Roles;
		}
		set
		{
			this._Roles.Assign(value);
		}
	}
	
	public event PropertyChangingEventHandler PropertyChanging;
	
	public event PropertyChangedEventHandler PropertyChanged;
	
	protected virtual void SendPropertyChanging()
	{
		if ((this.PropertyChanging != null))
		{
			this.PropertyChanging(this, emptyChangingEventArgs);
		}
	}
	
	protected virtual void SendPropertyChanged(String propertyName)
	{
		if ((this.PropertyChanged != null))
		{
			this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
	
	private void attach_Roles(Role entity)
	{
		this.SendPropertyChanging();
		entity.Tree = this;
	}
	
	private void detach_Roles(Role entity)
	{
		this.SendPropertyChanging();
		entity.Tree = null;
	}
}

[Table(Name="dbo.[User]")]
public partial class User : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _UserID;
	
	private string _UserName;
	
	private string _Password;
	
	private string _Email;
	
	private System.Nullable<int> _RoleID;
	
	private EntityRef<Role> _Role;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnUserNameChanging(string value);
    partial void OnUserNameChanged();
    partial void OnPasswordChanging(string value);
    partial void OnPasswordChanged();
    partial void OnEmailChanging(string value);
    partial void OnEmailChanged();
    partial void OnRoleIDChanging(System.Nullable<int> value);
    partial void OnRoleIDChanged();
    #endregion
	
	public User()
	{
		this._Role = default(EntityRef<Role>);
		OnCreated();
	}
	
	[Column(Storage="_UserID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int UserID
	{
		get
		{
			return this._UserID;
		}
		set
		{
			if ((this._UserID != value))
			{
				this.OnUserIDChanging(value);
				this.SendPropertyChanging();
				this._UserID = value;
				this.SendPropertyChanged("UserID");
				this.OnUserIDChanged();
			}
		}
	}
	
	[Column(Storage="_UserName", DbType="VarChar(200)")]
	public string UserName
	{
		get
		{
			return this._UserName;
		}
		set
		{
			if ((this._UserName != value))
			{
				this.OnUserNameChanging(value);
				this.SendPropertyChanging();
				this._UserName = value;
				this.SendPropertyChanged("UserName");
				this.OnUserNameChanged();
			}
		}
	}
	
	[Column(Storage="_Password", DbType="VarChar(255)")]
	public string Password
	{
		get
		{
			return this._Password;
		}
		set
		{
			if ((this._Password != value))
			{
				this.OnPasswordChanging(value);
				this.SendPropertyChanging();
				this._Password = value;
				this.SendPropertyChanged("Password");
				this.OnPasswordChanged();
			}
		}
	}
	
	[Column(Storage="_Email", DbType="VarChar(200)")]
	public string Email
	{
		get
		{
			return this._Email;
		}
		set
		{
			if ((this._Email != value))
			{
				this.OnEmailChanging(value);
				this.SendPropertyChanging();
				this._Email = value;
				this.SendPropertyChanged("Email");
				this.OnEmailChanged();
			}
		}
	}
	
	[Column(Storage="_RoleID", DbType="Int")]
	public System.Nullable<int> RoleID
	{
		get
		{
			return this._RoleID;
		}
		set
		{
			if ((this._RoleID != value))
			{
				if (this._Role.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnRoleIDChanging(value);
				this.SendPropertyChanging();
				this._RoleID = value;
				this.SendPropertyChanged("RoleID");
				this.OnRoleIDChanged();
			}
		}
	}
	
	[Association(Name="Role_User", Storage="_Role", ThisKey="RoleID", IsForeignKey=true)]
	public Role Role
	{
		get
		{
			return this._Role.Entity;
		}
		set
		{
			Role previousValue = this._Role.Entity;
			if (((previousValue != value) 
						|| (this._Role.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Role.Entity = null;
					previousValue.Users.Remove(this);
				}
				this._Role.Entity = value;
				if ((value != null))
				{
					value.Users.Add(this);
					this._RoleID = value.RoleID;
				}
				else
				{
					this._RoleID = default(Nullable<int>);
				}
				this.SendPropertyChanged("Role");
			}
		}
	}
	
	public event PropertyChangingEventHandler PropertyChanging;
	
	public event PropertyChangedEventHandler PropertyChanged;
	
	protected virtual void SendPropertyChanging()
	{
		if ((this.PropertyChanging != null))
		{
			this.PropertyChanging(this, emptyChangingEventArgs);
		}
	}
	
	protected virtual void SendPropertyChanged(String propertyName)
	{
		if ((this.PropertyChanged != null))
		{
			this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
}
#pragma warning restore 1591

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -