📄 dataclasses.designer.cs
字号:
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
[System.Data.Linq.Mapping.DatabaseAttribute(Name="StudentDB")]
public partial class DataClassesDataContext : System.Data.Linq.DataContext
{
private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
#region Extensibility Method Definitions
partial void OnCreated();
partial void InsertClass(Class instance);
partial void UpdateClass(Class instance);
partial void DeleteClass(Class instance);
partial void InsertCourse(Course instance);
partial void UpdateCourse(Course instance);
partial void DeleteCourse(Course instance);
partial void InsertDepartment(Department instance);
partial void UpdateDepartment(Department instance);
partial void DeleteDepartment(Department instance);
partial void InsertGrade(Grade instance);
partial void UpdateGrade(Grade instance);
partial void DeleteGrade(Grade instance);
partial void InsertRole(Role instance);
partial void UpdateRole(Role instance);
partial void DeleteRole(Role instance);
partial void InsertScore(Score instance);
partial void UpdateScore(Score instance);
partial void DeleteScore(Score instance);
partial void InsertStudent(Student instance);
partial void UpdateStudent(Student instance);
partial void DeleteStudent(Student instance);
partial void InsertTeacher(Teacher instance);
partial void UpdateTeacher(Teacher instance);
partial void DeleteTeacher(Teacher instance);
partial void InsertTree(Tree instance);
partial void UpdateTree(Tree instance);
partial void DeleteTree(Tree instance);
partial void InsertUser(User instance);
partial void UpdateUser(User instance);
partial void DeleteUser(User instance);
#endregion
public DataClassesDataContext() :
base(global::System.Configuration.ConfigurationManager.ConnectionStrings["StudentDBConnectionString"].ConnectionString, mappingSource)
{
OnCreated();
}
public DataClassesDataContext(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
public DataClassesDataContext(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
public DataClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public DataClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public System.Data.Linq.Table<Class> Classes
{
get
{
return this.GetTable<Class>();
}
}
public System.Data.Linq.Table<Course> Courses
{
get
{
return this.GetTable<Course>();
}
}
public System.Data.Linq.Table<Department> Departments
{
get
{
return this.GetTable<Department>();
}
}
public System.Data.Linq.Table<Grade> Grades
{
get
{
return this.GetTable<Grade>();
}
}
public System.Data.Linq.Table<Role> Roles
{
get
{
return this.GetTable<Role>();
}
}
public System.Data.Linq.Table<Score> Scores
{
get
{
return this.GetTable<Score>();
}
}
public System.Data.Linq.Table<Student> Students
{
get
{
return this.GetTable<Student>();
}
}
public System.Data.Linq.Table<Teacher> Teachers
{
get
{
return this.GetTable<Teacher>();
}
}
public System.Data.Linq.Table<Tree> Trees
{
get
{
return this.GetTable<Tree>();
}
}
public System.Data.Linq.Table<User> Users
{
get
{
return this.GetTable<User>();
}
}
}
[Table(Name="dbo.Class")]
public partial class Class : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _ClassID;
private string _Desn;
private System.Nullable<int> _TeacherID;
private System.Nullable<int> _GradeID;
private System.Nullable<System.DateTime> _StartDate;
private System.Nullable<System.DateTime> _EndDate;
private System.Nullable<int> _StuNum;
private EntitySet<Student> _Students;
private EntityRef<Grade> _Grade;
private EntityRef<Teacher> _Teacher;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnClassIDChanging(int value);
partial void OnClassIDChanged();
partial void OnDesnChanging(string value);
partial void OnDesnChanged();
partial void OnTeacherIDChanging(System.Nullable<int> value);
partial void OnTeacherIDChanged();
partial void OnGradeIDChanging(System.Nullable<int> value);
partial void OnGradeIDChanged();
partial void OnStartDateChanging(System.Nullable<System.DateTime> value);
partial void OnStartDateChanged();
partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
partial void OnEndDateChanged();
partial void OnStuNumChanging(System.Nullable<int> value);
partial void OnStuNumChanged();
#endregion
public Class()
{
this._Students = new EntitySet<Student>(new Action<Student>(this.attach_Students), new Action<Student>(this.detach_Students));
this._Grade = default(EntityRef<Grade>);
this._Teacher = default(EntityRef<Teacher>);
OnCreated();
}
[Column(Storage="_ClassID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
public int ClassID
{
get
{
return this._ClassID;
}
set
{
if ((this._ClassID != value))
{
this.OnClassIDChanging(value);
this.SendPropertyChanging();
this._ClassID = value;
this.SendPropertyChanged("ClassID");
this.OnClassIDChanged();
}
}
}
[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="_TeacherID", DbType="Int")]
public System.Nullable<int> TeacherID
{
get
{
return this._TeacherID;
}
set
{
if ((this._TeacherID != value))
{
if (this._Teacher.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnTeacherIDChanging(value);
this.SendPropertyChanging();
this._TeacherID = value;
this.SendPropertyChanged("TeacherID");
this.OnTeacherIDChanged();
}
}
}
[Column(Storage="_GradeID", DbType="Int")]
public System.Nullable<int> GradeID
{
get
{
return this._GradeID;
}
set
{
if ((this._GradeID != value))
{
if (this._Grade.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnGradeIDChanging(value);
this.SendPropertyChanging();
this._GradeID = value;
this.SendPropertyChanged("GradeID");
this.OnGradeIDChanged();
}
}
}
[Column(Storage="_StartDate", DbType="DateTime")]
public System.Nullable<System.DateTime> StartDate
{
get
{
return this._StartDate;
}
set
{
if ((this._StartDate != value))
{
this.OnStartDateChanging(value);
this.SendPropertyChanging();
this._StartDate = value;
this.SendPropertyChanged("StartDate");
this.OnStartDateChanged();
}
}
}
[Column(Storage="_EndDate", DbType="DateTime")]
public System.Nullable<System.DateTime> EndDate
{
get
{
return this._EndDate;
}
set
{
if ((this._EndDate != value))
{
this.OnEndDateChanging(value);
this.SendPropertyChanging();
this._EndDate = value;
this.SendPropertyChanged("EndDate");
this.OnEndDateChanged();
}
}
}
[Column(Storage="_StuNum", DbType="Int")]
public System.Nullable<int> StuNum
{
get
{
return this._StuNum;
}
set
{
if ((this._StuNum != value))
{
this.OnStuNumChanging(value);
this.SendPropertyChanging();
this._StuNum = value;
this.SendPropertyChanged("StuNum");
this.OnStuNumChanged();
}
}
}
[Association(Name="Class_Student", Storage="_Students", OtherKey="ClassID")]
public EntitySet<Student> Students
{
get
{
return this._Students;
}
set
{
this._Students.Assign(value);
}
}
[Association(Name="Grade_Class", Storage="_Grade", ThisKey="GradeID", IsForeignKey=true)]
public Grade Grade
{
get
{
return this._Grade.Entity;
}
set
{
Grade previousValue = this._Grade.Entity;
if (((previousValue != value)
|| (this._Grade.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Grade.Entity = null;
previousValue.Classes.Remove(this);
}
this._Grade.Entity = value;
if ((value != null))
{
value.Classes.Add(this);
this._GradeID = value.GradeID;
}
else
{
this._GradeID = default(Nullable<int>);
}
this.SendPropertyChanged("Grade");
}
}
}
[Association(Name="Teacher_Class", Storage="_Teacher", ThisKey="TeacherID", IsForeignKey=true)]
public Teacher Teacher
{
get
{
return this._Teacher.Entity;
}
set
{
Teacher previousValue = this._Teacher.Entity;
if (((previousValue != value)
|| (this._Teacher.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Teacher.Entity = null;
previousValue.Classes.Remove(this);
}
this._Teacher.Entity = value;
if ((value != null))
{
value.Classes.Add(this);
this._TeacherID = value.TeacherID;
}
else
{
this._TeacherID = default(Nullable<int>);
}
this.SendPropertyChanged("Teacher");
}
}
}
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_Students(Student entity)
{
this.SendPropertyChanging();
entity.Class = this;
}
private void detach_Students(Student entity)
{
this.SendPropertyChanging();
entity.Class = null;
}
}
[Table(Name="dbo.Course")]
public partial class Course : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _CourseID;
private string _Desn;
private string _Body;
private System.Nullable<System.DateTime> _StartDate;
private System.Nullable<System.DateTime> _EndDate;
private System.Nullable<int> _CourseHour;
private System.Nullable<int> _TeacherID;
private System.Nullable<System.DateTime> _ExamineDate;
private System.Nullable<decimal> _TotalMark;
private EntitySet<Score> _Scores;
private EntityRef<Teacher> _Teacher;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnCourseIDChanging(int value);
partial void OnCourseIDChanged();
partial void OnDesnChanging(string value);
partial void OnDesnChanged();
partial void OnBodyChanging(string value);
partial void OnBodyChanged();
partial void OnStartDateChanging(System.Nullable<System.DateTime> value);
partial void OnStartDateChanged();
partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
partial void OnEndDateChanged();
partial void OnCourseHourChanging(System.Nullable<int> value);
partial void OnCourseHourChanged();
partial void OnTeacherIDChanging(System.Nullable<int> value);
partial void OnTeacherIDChanged();
partial void OnExamineDateChanging(System.Nullable<System.DateTime> value);
partial void OnExamineDateChanged();
partial void OnTotalMarkChanging(System.Nullable<decimal> value);
partial void OnTotalMarkChanged();
#endregion
public Course()
{
this._Scores = new EntitySet<Score>(new Action<Score>(this.attach_Scores), new Action<Score>(this.detach_Scores));
this._Teacher = default(EntityRef<Teacher>);
OnCreated();
}
[Column(Storage="_CourseID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
public int CourseID
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -