📄 dataclasses.designer.cs
字号:
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnClassIDChanging(value);
this.SendPropertyChanging();
this._ClassID = value;
this.SendPropertyChanged("ClassID");
this.OnClassIDChanged();
}
}
}
[Column(Storage="_Name", DbType="VarChar(200)")]
public string Name
{
get
{
return this._Name;
}
set
{
if ((this._Name != value))
{
this.OnNameChanging(value);
this.SendPropertyChanging();
this._Name = value;
this.SendPropertyChanged("Name");
this.OnNameChanged();
}
}
}
[Column(Storage="_Age", DbType="Int")]
public System.Nullable<int> Age
{
get
{
return this._Age;
}
set
{
if ((this._Age != value))
{
this.OnAgeChanging(value);
this.SendPropertyChanging();
this._Age = value;
this.SendPropertyChanged("Age");
this.OnAgeChanged();
}
}
}
[Column(Storage="_Sex", DbType="Int")]
public System.Nullable<int> Sex
{
get
{
return this._Sex;
}
set
{
if ((this._Sex != value))
{
this.OnSexChanging(value);
this.SendPropertyChanging();
this._Sex = value;
this.SendPropertyChanged("Sex");
this.OnSexChanged();
}
}
}
[Column(Storage="_Address", DbType="VarChar(200)")]
public string Address
{
get
{
return this._Address;
}
set
{
if ((this._Address != value))
{
this.OnAddressChanging(value);
this.SendPropertyChanging();
this._Address = value;
this.SendPropertyChanged("Address");
this.OnAddressChanged();
}
}
}
[Column(Storage="_Phone", DbType="VarChar(200)")]
public string Phone
{
get
{
return this._Phone;
}
set
{
if ((this._Phone != value))
{
this.OnPhoneChanging(value);
this.SendPropertyChanging();
this._Phone = value;
this.SendPropertyChanged("Phone");
this.OnPhoneChanged();
}
}
}
[Column(Storage="_Birthday", DbType="DateTime")]
public System.Nullable<System.DateTime> Birthday
{
get
{
return this._Birthday;
}
set
{
if ((this._Birthday != value))
{
this.OnBirthdayChanging(value);
this.SendPropertyChanging();
this._Birthday = value;
this.SendPropertyChanged("Birthday");
this.OnBirthdayChanged();
}
}
}
[Column(Storage="_EntranceDate", DbType="DateTime")]
public System.Nullable<System.DateTime> EntranceDate
{
get
{
return this._EntranceDate;
}
set
{
if ((this._EntranceDate != value))
{
this.OnEntranceDateChanging(value);
this.SendPropertyChanging();
this._EntranceDate = value;
this.SendPropertyChanged("EntranceDate");
this.OnEntranceDateChanged();
}
}
}
[Column(Storage="_Nationality", DbType="VarChar(200)")]
public string Nationality
{
get
{
return this._Nationality;
}
set
{
if ((this._Nationality != value))
{
this.OnNationalityChanging(value);
this.SendPropertyChanging();
this._Nationality = value;
this.SendPropertyChanged("Nationality");
this.OnNationalityChanged();
}
}
}
[Column(Storage="_Political", DbType="VarChar(200)")]
public string Political
{
get
{
return this._Political;
}
set
{
if ((this._Political != value))
{
this.OnPoliticalChanging(value);
this.SendPropertyChanging();
this._Political = value;
this.SendPropertyChanged("Political");
this.OnPoliticalChanged();
}
}
}
[Column(Storage="_NativePlace", DbType="VarChar(200)")]
public string NativePlace
{
get
{
return this._NativePlace;
}
set
{
if ((this._NativePlace != value))
{
this.OnNativePlaceChanging(value);
this.SendPropertyChanging();
this._NativePlace = value;
this.SendPropertyChanged("NativePlace");
this.OnNativePlaceChanged();
}
}
}
[Column(Storage="_IdentityCard", DbType="VarChar(200)")]
public string IdentityCard
{
get
{
return this._IdentityCard;
}
set
{
if ((this._IdentityCard != value))
{
this.OnIdentityCardChanging(value);
this.SendPropertyChanging();
this._IdentityCard = value;
this.SendPropertyChanged("IdentityCard");
this.OnIdentityCardChanged();
}
}
}
[Column(Storage="_Marital", DbType="Int")]
public System.Nullable<int> Marital
{
get
{
return this._Marital;
}
set
{
if ((this._Marital != value))
{
this.OnMaritalChanging(value);
this.SendPropertyChanging();
this._Marital = value;
this.SendPropertyChanged("Marital");
this.OnMaritalChanged();
}
}
}
[Column(Storage="_Hukou", DbType="VarChar(200)")]
public string Hukou
{
get
{
return this._Hukou;
}
set
{
if ((this._Hukou != value))
{
this.OnHukouChanging(value);
this.SendPropertyChanging();
this._Hukou = value;
this.SendPropertyChanged("Hukou");
this.OnHukouChanged();
}
}
}
[Column(Storage="_State", DbType="Int")]
public System.Nullable<int> State
{
get
{
return this._State;
}
set
{
if ((this._State != value))
{
this.OnStateChanging(value);
this.SendPropertyChanging();
this._State = value;
this.SendPropertyChanged("State");
this.OnStateChanged();
}
}
}
[Column(Storage="_Desn", DbType="Text", UpdateCheck=UpdateCheck.Never)]
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();
}
}
}
[Association(Name="Student_Score", Storage="_Scores", OtherKey="StudentID")]
public EntitySet<Score> Scores
{
get
{
return this._Scores;
}
set
{
this._Scores.Assign(value);
}
}
[Association(Name="Class_Student", Storage="_Class", ThisKey="ClassID", IsForeignKey=true)]
public Class Class
{
get
{
return this._Class.Entity;
}
set
{
Class previousValue = this._Class.Entity;
if (((previousValue != value)
|| (this._Class.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Class.Entity = null;
previousValue.Students.Remove(this);
}
this._Class.Entity = value;
if ((value != null))
{
value.Students.Add(this);
this._ClassID = value.ClassID;
}
else
{
this._ClassID = default(Nullable<int>);
}
this.SendPropertyChanged("Class");
}
}
}
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_Scores(Score entity)
{
this.SendPropertyChanging();
entity.Student = this;
}
private void detach_Scores(Score entity)
{
this.SendPropertyChanging();
entity.Student = null;
}
}
[Table(Name="dbo.Teacher")]
public partial class Teacher : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _TeacherID;
private string _Name;
private System.Nullable<int> _Age;
private string _Address;
private string _Phone;
private System.Nullable<System.DateTime> _Birthday;
private System.Nullable<System.DateTime> _HireDate;
private System.Nullable<int> _DepartmentID;
private EntitySet<Class> _Classes;
private EntitySet<Course> _Courses;
private EntityRef<Department> _Department;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnTeacherIDChanging(int value);
partial void OnTeacherIDChanged();
partial void OnNameChanging(string value);
partial void OnNameChanged();
partial void OnAgeChanging(System.Nullable<int> value);
partial void OnAgeChanged();
partial void OnAddressChanging(string value);
partial void OnAddressChanged();
partial void OnPhoneChanging(string value);
partial void OnPhoneChanged();
partial void OnBirthdayChanging(System.Nullable<System.DateTime> value);
partial void OnBirthdayChanged();
partial void OnHireDateChanging(System.Nullable<System.DateTime> value);
partial void OnHireDateChanged();
partial void OnDepartmentIDChanging(System.Nullable<int> value);
partial void OnDepartmentIDChanged();
#endregion
public Teacher()
{
this._Classes = new EntitySet<Class>(new Action<Class>(this.attach_Classes), new Action<Class>(this.detach_Classes));
this._Courses = new EntitySet<Course>(new Action<Course>(this.attach_Courses), new Action<Course>(this.detach_Courses));
this._Department = default(EntityRef<Department>);
OnCreated();
}
[Column(Storage="_TeacherID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
public int TeacherID
{
get
{
return this._TeacherID;
}
set
{
if ((this._TeacherID != value))
{
this.OnTeacherIDChanging(value);
this.SendPropertyChanging();
this._TeacherID = value;
this.SendPropertyChanged("TeacherID");
this.OnTeacherIDChanged();
}
}
}
[Column(Storage="_Name", DbType="VarChar(200)")]
public string Name
{
get
{
return this._Name;
}
set
{
if ((this._Name != value))
{
this.OnNameChanging(value);
this.SendPropertyChanging();
this._Name = value;
this.SendPropertyChanged("Name");
this.OnNameChanged();
}
}
}
[Column(Storage="_Age", DbType="Int")]
public System.Nullable<int> Age
{
get
{
return this._Age;
}
set
{
if ((this._Age != value))
{
this.OnAgeChanging(value);
this.SendPropertyChanging();
this._Age = value;
this.SendPropertyChanged("Age");
this.OnAgeChanged();
}
}
}
[Column(Storage="_Address", DbType="VarChar(200)")]
public string Address
{
get
{
return this._Address;
}
set
{
if ((this._Address != value))
{
this.OnAddressChanging(value);
this.SendPropertyChanging();
this._Address = value;
this.SendPropertyChanged("Address");
this.OnAddressChanged();
}
}
}
[Column(Storage="_Phone", DbType="VarChar(200)")]
public string Phone
{
get
{
return this._Phone;
}
set
{
if ((this._Phone != value))
{
this.OnPhoneChanging(value);
this.SendPropertyChanging();
this._Phone = value;
this.SendPropertyChanged("Phone");
this.OnPhoneChanged();
}
}
}
[Column(Storage="_Birthday", DbType="DateTime")]
public System.Nullable<System.DateTime> Birthday
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -