📄 customersdataset.cs
字号:
get {
return ((CustomersRow)(this.Rows[index]));
}
}
public event CustomersRowChangeEventHandler CustomersRowChanged;
public event CustomersRowChangeEventHandler CustomersRowChanging;
public event CustomersRowChangeEventHandler CustomersRowDeleted;
public event CustomersRowChangeEventHandler CustomersRowDeleting;
public void AddCustomersRow(CustomersRow row) {
this.Rows.Add(row);
}
public CustomersRow AddCustomersRow(string CustomerID, string CustomerName, string Address, System.Decimal LastYearSales, string Country) {
CustomersRow rowCustomersRow = ((CustomersRow)(this.NewRow()));
rowCustomersRow.ItemArray = new object[] {
CustomerID,
CustomerName,
Address,
LastYearSales,
Country};
this.Rows.Add(rowCustomersRow);
return rowCustomersRow;
}
public CustomersRow FindByCustomerID(string CustomerID) {
return ((CustomersRow)(this.Rows.Find(new object[] {
CustomerID})));
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
CustomersDataTable cln = ((CustomersDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new CustomersDataTable();
}
internal void InitVars() {
this.columnCustomerID = this.Columns["CustomerID"];
this.columnCustomerName = this.Columns["CustomerName"];
this.columnAddress = this.Columns["Address"];
this.columnLastYearSales = this.Columns["LastYearSales"];
this.columnCountry = this.Columns["Country"];
}
private void InitClass() {
this.columnCustomerID = new DataColumn("CustomerID", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCustomerID);
this.columnCustomerName = new DataColumn("CustomerName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCustomerName);
this.columnAddress = new DataColumn("Address", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnAddress);
this.columnLastYearSales = new DataColumn("LastYearSales", typeof(System.Decimal), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnLastYearSales);
this.columnCountry = new DataColumn("Country", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCountry);
this.Constraints.Add(new UniqueConstraint("Dataset1Key1", new DataColumn[] {
this.columnCustomerID}, true));
this.columnCustomerID.AllowDBNull = false;
this.columnCustomerID.Unique = true;
this.columnCustomerName.AllowDBNull = false;
this.columnAddress.AllowDBNull = false;
this.columnLastYearSales.AllowDBNull = false;
this.columnCountry.AllowDBNull = false;
}
public CustomersRow NewCustomersRow() {
return ((CustomersRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new CustomersRow(builder);
}
protected override System.Type GetRowType() {
return typeof(CustomersRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.CustomersRowChanged != null)) {
this.CustomersRowChanged(this, new CustomersRowChangeEvent(((CustomersRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.CustomersRowChanging != null)) {
this.CustomersRowChanging(this, new CustomersRowChangeEvent(((CustomersRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.CustomersRowDeleted != null)) {
this.CustomersRowDeleted(this, new CustomersRowChangeEvent(((CustomersRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.CustomersRowDeleting != null)) {
this.CustomersRowDeleting(this, new CustomersRowChangeEvent(((CustomersRow)(e.Row)), e.Action));
}
}
public void RemoveCustomersRow(CustomersRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class CustomersRow : DataRow {
private CustomersDataTable tableCustomers;
internal CustomersRow(DataRowBuilder rb) :
base(rb) {
this.tableCustomers = ((CustomersDataTable)(this.Table));
}
public string CustomerID {
get {
return ((string)(this[this.tableCustomers.CustomerIDColumn]));
}
set {
this[this.tableCustomers.CustomerIDColumn] = value;
}
}
public string CustomerName {
get {
return ((string)(this[this.tableCustomers.CustomerNameColumn]));
}
set {
this[this.tableCustomers.CustomerNameColumn] = value;
}
}
public string Address {
get {
return ((string)(this[this.tableCustomers.AddressColumn]));
}
set {
this[this.tableCustomers.AddressColumn] = value;
}
}
public System.Decimal LastYearSales {
get {
return ((System.Decimal)(this[this.tableCustomers.LastYearSalesColumn]));
}
set {
this[this.tableCustomers.LastYearSalesColumn] = value;
}
}
public string Country {
get {
return ((string)(this[this.tableCustomers.CountryColumn]));
}
set {
this[this.tableCustomers.CountryColumn] = value;
}
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class CustomersRowChangeEvent : EventArgs {
private CustomersRow eventRow;
private DataRowAction eventAction;
public CustomersRowChangeEvent(CustomersRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public CustomersRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -