📄 dataset1.cs
字号:
}
public int Dep_ID {
get {
return ((int)(this[this.tableDepartment.Dep_IDColumn]));
}
set {
this[this.tableDepartment.Dep_IDColumn] = value;
}
}
public int Dep_Number {
get {
return ((int)(this[this.tableDepartment.Dep_NumberColumn]));
}
set {
this[this.tableDepartment.Dep_NumberColumn] = value;
}
}
public string Dep_Name {
get {
return ((string)(this[this.tableDepartment.Dep_NameColumn]));
}
set {
this[this.tableDepartment.Dep_NameColumn] = value;
}
}
public string Dep_Head {
get {
return ((string)(this[this.tableDepartment.Dep_HeadColumn]));
}
set {
this[this.tableDepartment.Dep_HeadColumn] = value;
}
}
public string Dep_Des {
get {
try {
return ((string)(this[this.tableDepartment.Dep_DesColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
}
}
set {
this[this.tableDepartment.Dep_DesColumn] = value;
}
}
public bool IsDep_DesNull() {
return this.IsNull(this.tableDepartment.Dep_DesColumn);
}
public void SetDep_DesNull() {
this[this.tableDepartment.Dep_DesColumn] = System.Convert.DBNull;
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class DepartmentRowChangeEvent : EventArgs {
private DepartmentRow eventRow;
private DataRowAction eventAction;
public DepartmentRowChangeEvent(DepartmentRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public DepartmentRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class StudentsDataTable : DataTable, System.Collections.IEnumerable {
private DataColumn columnStu_ID;
private DataColumn columnStu_Number;
private DataColumn columnStu_Name;
private DataColumn columnStu_Age;
private DataColumn columnDep_Number;
internal StudentsDataTable() :
base("Students") {
this.InitClass();
}
internal StudentsDataTable(DataTable table) :
base(table.TableName) {
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
this.DisplayExpression = table.DisplayExpression;
}
[System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
internal DataColumn Stu_IDColumn {
get {
return this.columnStu_ID;
}
}
internal DataColumn Stu_NumberColumn {
get {
return this.columnStu_Number;
}
}
internal DataColumn Stu_NameColumn {
get {
return this.columnStu_Name;
}
}
internal DataColumn Stu_AgeColumn {
get {
return this.columnStu_Age;
}
}
internal DataColumn Dep_NumberColumn {
get {
return this.columnDep_Number;
}
}
public StudentsRow this[int index] {
get {
return ((StudentsRow)(this.Rows[index]));
}
}
public event StudentsRowChangeEventHandler StudentsRowChanged;
public event StudentsRowChangeEventHandler StudentsRowChanging;
public event StudentsRowChangeEventHandler StudentsRowDeleted;
public event StudentsRowChangeEventHandler StudentsRowDeleting;
public void AddStudentsRow(StudentsRow row) {
this.Rows.Add(row);
}
public StudentsRow AddStudentsRow(string Stu_Number, string Stu_Name, int Stu_Age, int Dep_Number) {
StudentsRow rowStudentsRow = ((StudentsRow)(this.NewRow()));
rowStudentsRow.ItemArray = new object[] {
null,
Stu_Number,
Stu_Name,
Stu_Age,
Dep_Number};
this.Rows.Add(rowStudentsRow);
return rowStudentsRow;
}
public StudentsRow FindByStu_Number(string Stu_Number) {
return ((StudentsRow)(this.Rows.Find(new object[] {
Stu_Number})));
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
StudentsDataTable cln = ((StudentsDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new StudentsDataTable();
}
internal void InitVars() {
this.columnStu_ID = this.Columns["Stu_ID"];
this.columnStu_Number = this.Columns["Stu_Number"];
this.columnStu_Name = this.Columns["Stu_Name"];
this.columnStu_Age = this.Columns["Stu_Age"];
this.columnDep_Number = this.Columns["Dep_Number"];
}
private void InitClass() {
this.columnStu_ID = new DataColumn("Stu_ID", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnStu_ID);
this.columnStu_Number = new DataColumn("Stu_Number", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnStu_Number);
this.columnStu_Name = new DataColumn("Stu_Name", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnStu_Name);
this.columnStu_Age = new DataColumn("Stu_Age", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnStu_Age);
this.columnDep_Number = new DataColumn("Dep_Number", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnDep_Number);
this.Constraints.Add(new UniqueConstraint("Dataset1Key2", new DataColumn[] {
this.columnStu_Number}, true));
this.columnStu_ID.AutoIncrement = true;
this.columnStu_ID.AllowDBNull = false;
this.columnStu_ID.ReadOnly = true;
this.columnStu_Number.AllowDBNull = false;
this.columnStu_Number.Unique = true;
this.columnStu_Name.AllowDBNull = false;
this.columnStu_Age.AllowDBNull = false;
this.columnDep_Number.AllowDBNull = false;
}
public StudentsRow NewStudentsRow() {
return ((StudentsRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new StudentsRow(builder);
}
protected override System.Type GetRowType() {
return typeof(StudentsRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.StudentsRowChanged != null)) {
this.StudentsRowChanged(this, new StudentsRowChangeEvent(((StudentsRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.StudentsRowChanging != null)) {
this.StudentsRowChanging(this, new StudentsRowChangeEvent(((StudentsRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.StudentsRowDeleted != null)) {
this.StudentsRowDeleted(this, new StudentsRowChangeEvent(((StudentsRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.StudentsRowDeleting != null)) {
this.StudentsRowDeleting(this, new StudentsRowChangeEvent(((StudentsRow)(e.Row)), e.Action));
}
}
public void RemoveStudentsRow(StudentsRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class StudentsRow : DataRow {
private StudentsDataTable tableStudents;
internal StudentsRow(DataRowBuilder rb) :
base(rb) {
this.tableStudents = ((StudentsDataTable)(this.Table));
}
public int Stu_ID {
get {
return ((int)(this[this.tableStudents.Stu_IDColumn]));
}
set {
this[this.tableStudents.Stu_IDColumn] = value;
}
}
public string Stu_Number {
get {
return ((string)(this[this.tableStudents.Stu_NumberColumn]));
}
set {
this[this.tableStudents.Stu_NumberColumn] = value;
}
}
public string Stu_Name {
get {
return ((string)(this[this.tableStudents.Stu_NameColumn]));
}
set {
this[this.tableStudents.Stu_NameColumn] = value;
}
}
public int Stu_Age {
get {
return ((int)(this[this.tableStudents.Stu_AgeColumn]));
}
set {
this[this.tableStudents.Stu_AgeColumn] = value;
}
}
public int Dep_Number {
get {
return ((int)(this[this.tableStudents.Dep_NumberColumn]));
}
set {
this[this.tableStudents.Dep_NumberColumn] = value;
}
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class StudentsRowChangeEvent : EventArgs {
private StudentsRow eventRow;
private DataRowAction eventAction;
public StudentsRowChangeEvent(StudentsRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public StudentsRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -