📄 dataset1.cs
字号:
return this.columnReportsTo;
}
}
internal DataColumn PhotoPathColumn {
get {
return this.columnPhotoPath;
}
}
public EmployeesRow this[int index] {
get {
return ((EmployeesRow)(this.Rows[index]));
}
}
public event EmployeesRowChangeEventHandler EmployeesRowChanged;
public event EmployeesRowChangeEventHandler EmployeesRowChanging;
public event EmployeesRowChangeEventHandler EmployeesRowDeleted;
public event EmployeesRowChangeEventHandler EmployeesRowDeleting;
public void AddEmployeesRow(EmployeesRow row) {
this.Rows.Add(row);
}
public EmployeesRow AddEmployeesRow(
string LastName,
string FirstName,
string Title,
string TitleOfCourtesy,
System.DateTime BirthDate,
System.DateTime HireDate,
string Address,
string City,
string Region,
string PostalCode,
string Country,
string HomePhone,
string Extension,
System.Byte[] Photo,
string Notes,
int ReportsTo,
string PhotoPath) {
EmployeesRow rowEmployeesRow = ((EmployeesRow)(this.NewRow()));
rowEmployeesRow.ItemArray = new object[] {
null,
LastName,
FirstName,
Title,
TitleOfCourtesy,
BirthDate,
HireDate,
Address,
City,
Region,
PostalCode,
Country,
HomePhone,
Extension,
Photo,
Notes,
ReportsTo,
PhotoPath};
this.Rows.Add(rowEmployeesRow);
return rowEmployeesRow;
}
public EmployeesRow FindByEmployeeID(int EmployeeID) {
return ((EmployeesRow)(this.Rows.Find(new object[] {
EmployeeID})));
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
EmployeesDataTable cln = ((EmployeesDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new EmployeesDataTable();
}
internal void InitVars() {
this.columnEmployeeID = this.Columns["EmployeeID"];
this.columnLastName = this.Columns["LastName"];
this.columnFirstName = this.Columns["FirstName"];
this.columnTitle = this.Columns["Title"];
this.columnTitleOfCourtesy = this.Columns["TitleOfCourtesy"];
this.columnBirthDate = this.Columns["BirthDate"];
this.columnHireDate = this.Columns["HireDate"];
this.columnAddress = this.Columns["Address"];
this.columnCity = this.Columns["City"];
this.columnRegion = this.Columns["Region"];
this.columnPostalCode = this.Columns["PostalCode"];
this.columnCountry = this.Columns["Country"];
this.columnHomePhone = this.Columns["HomePhone"];
this.columnExtension = this.Columns["Extension"];
this.columnPhoto = this.Columns["Photo"];
this.columnNotes = this.Columns["Notes"];
this.columnReportsTo = this.Columns["ReportsTo"];
this.columnPhotoPath = this.Columns["PhotoPath"];
}
private void InitClass() {
this.columnEmployeeID = new DataColumn("EmployeeID", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnEmployeeID);
this.columnLastName = new DataColumn("LastName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnLastName);
this.columnFirstName = new DataColumn("FirstName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnFirstName);
this.columnTitle = new DataColumn("Title", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnTitle);
this.columnTitleOfCourtesy = new DataColumn("TitleOfCourtesy", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnTitleOfCourtesy);
this.columnBirthDate = new DataColumn("BirthDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBirthDate);
this.columnHireDate = new DataColumn("HireDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnHireDate);
this.columnAddress = new DataColumn("Address", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnAddress);
this.columnCity = new DataColumn("City", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCity);
this.columnRegion = new DataColumn("Region", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnRegion);
this.columnPostalCode = new DataColumn("PostalCode", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnPostalCode);
this.columnCountry = new DataColumn("Country", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCountry);
this.columnHomePhone = new DataColumn("HomePhone", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnHomePhone);
this.columnExtension = new DataColumn("Extension", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnExtension);
this.columnPhoto = new DataColumn("Photo", typeof(System.Byte[]), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnPhoto);
this.columnNotes = new DataColumn("Notes", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnNotes);
this.columnReportsTo = new DataColumn("ReportsTo", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnReportsTo);
this.columnPhotoPath = new DataColumn("PhotoPath", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnPhotoPath);
this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
this.columnEmployeeID}, true));
this.columnEmployeeID.AutoIncrement = true;
this.columnEmployeeID.AllowDBNull = false;
this.columnEmployeeID.ReadOnly = true;
this.columnEmployeeID.Unique = true;
this.columnLastName.AllowDBNull = false;
this.columnFirstName.AllowDBNull = false;
}
public EmployeesRow NewEmployeesRow() {
return ((EmployeesRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new EmployeesRow(builder);
}
protected override System.Type GetRowType() {
return typeof(EmployeesRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.EmployeesRowChanged != null)) {
this.EmployeesRowChanged(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.EmployeesRowChanging != null)) {
this.EmployeesRowChanging(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.EmployeesRowDeleted != null)) {
this.EmployeesRowDeleted(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.EmployeesRowDeleting != null)) {
this.EmployeesRowDeleting(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action));
}
}
public void RemoveEmployeesRow(EmployeesRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class EmployeesRow : DataRow {
private EmployeesDataTable tableEmployees;
internal EmployeesRow(DataRowBuilder rb) :
base(rb) {
this.tableEmployees = ((EmployeesDataTable)(this.Table));
}
public int EmployeeID {
get {
return ((int)(this[this.tableEmployees.EmployeeIDColumn]));
}
set {
this[this.tableEmployees.EmployeeIDColumn] = value;
}
}
public string LastName {
get {
return ((string)(this[this.tableEmployees.LastNameColumn]));
}
set {
this[this.tableEmployees.LastNameColumn] = value;
}
}
public string FirstName {
get {
return ((string)(this[this.tableEmployees.FirstNameColumn]));
}
set {
this[this.tableEmployees.FirstNameColumn] = value;
}
}
public string Title {
get {
try {
return ((string)(this[this.tableEmployees.TitleColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
}
}
set {
this[this.tableEmployees.TitleColumn] = value;
}
}
public string TitleOfCourtesy {
get {
try {
return ((string)(this[this.tableEmployees.TitleOfCourtesyColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
}
}
set {
this[this.tableEmployees.TitleOfCourtesyColumn] = value;
}
}
public System.DateTime BirthDate {
get {
try {
return ((System.DateTime)(this[this.tableEmployees.BirthDateColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
}
}
set {
this[this.tableEmployees.BirthDateColumn] = value;
}
}
public System.DateTime HireDate {
get {
try {
return ((System.DateTime)(this[this.tableEmployees.HireDateColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
}
}
set {
this[this.tableEmployees.HireDateColumn] = value;
}
}
public string Address {
get {
try {
return ((string)(this[this.tableEmployees.AddressColumn]));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -