📄 dsorderhistory.cs
字号:
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.0.3705.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------
namespace DatagridHierarchical {
using System;
using System.Data;
using System.Xml;
using System.Runtime.Serialization;
[Serializable()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Diagnostics.DebuggerStepThrough()]
[System.ComponentModel.ToolboxItem(true)]
public class dsOrderHistory : DataSet {
private CustomersDataTable tableCustomers;
private OrdersDataTable tableOrders;
private DataRelation relationCustomersOrders;
public dsOrderHistory() {
this.InitClass();
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
protected dsOrderHistory(SerializationInfo info, StreamingContext context) {
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((strSchema != null)) {
DataSet ds = new DataSet();
ds.ReadXmlSchema(new XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["Customers"] != null)) {
this.Tables.Add(new CustomersDataTable(ds.Tables["Customers"]));
}
if ((ds.Tables["Orders"] != null)) {
this.Tables.Add(new OrdersDataTable(ds.Tables["Orders"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.InitClass();
}
this.GetSerializationData(info, context);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
public CustomersDataTable Customers {
get {
return this.tableCustomers;
}
}
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
public OrdersDataTable Orders {
get {
return this.tableOrders;
}
}
public override DataSet Clone() {
dsOrderHistory cln = ((dsOrderHistory)(base.Clone()));
cln.InitVars();
return cln;
}
protected override bool ShouldSerializeTables() {
return false;
}
protected override bool ShouldSerializeRelations() {
return false;
}
protected override void ReadXmlSerializable(XmlReader reader) {
this.Reset();
DataSet ds = new DataSet();
ds.ReadXml(reader);
if ((ds.Tables["Customers"] != null)) {
this.Tables.Add(new CustomersDataTable(ds.Tables["Customers"]));
}
if ((ds.Tables["Orders"] != null)) {
this.Tables.Add(new OrdersDataTable(ds.Tables["Orders"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
System.IO.MemoryStream stream = new System.IO.MemoryStream();
this.WriteXmlSchema(new XmlTextWriter(stream, null));
stream.Position = 0;
return System.Xml.Schema.XmlSchema.Read(new XmlTextReader(stream), null);
}
internal void InitVars() {
this.tableCustomers = ((CustomersDataTable)(this.Tables["Customers"]));
if ((this.tableCustomers != null)) {
this.tableCustomers.InitVars();
}
this.tableOrders = ((OrdersDataTable)(this.Tables["Orders"]));
if ((this.tableOrders != null)) {
this.tableOrders.InitVars();
}
this.relationCustomersOrders = this.Relations["CustomersOrders"];
}
private void InitClass() {
this.DataSetName = "dsOrderHistory";
this.Prefix = "";
this.Namespace = "http://www.tempuri.org/dsOrderHistory.xsd";
this.Locale = new System.Globalization.CultureInfo("en-US");
this.CaseSensitive = false;
this.EnforceConstraints = true;
this.tableCustomers = new CustomersDataTable();
this.Tables.Add(this.tableCustomers);
this.tableOrders = new OrdersDataTable();
this.Tables.Add(this.tableOrders);
ForeignKeyConstraint fkc;
fkc = new ForeignKeyConstraint("CustomersOrders", new DataColumn[] {
this.tableCustomers.CustomerIDColumn}, new DataColumn[] {
this.tableOrders.CustomerIDColumn});
this.tableOrders.Constraints.Add(fkc);
fkc.AcceptRejectRule = AcceptRejectRule.None;
fkc.DeleteRule = Rule.Cascade;
fkc.UpdateRule = Rule.Cascade;
this.relationCustomersOrders = new DataRelation("CustomersOrders", new DataColumn[] {
this.tableCustomers.CustomerIDColumn}, new DataColumn[] {
this.tableOrders.CustomerIDColumn}, false);
this.Relations.Add(this.relationCustomersOrders);
}
private bool ShouldSerializeCustomers() {
return false;
}
private bool ShouldSerializeOrders() {
return false;
}
private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
this.InitVars();
}
}
public delegate void CustomersRowChangeEventHandler(object sender, CustomersRowChangeEvent e);
public delegate void OrdersRowChangeEventHandler(object sender, OrdersRowChangeEvent e);
[System.Diagnostics.DebuggerStepThrough()]
public class CustomersDataTable : DataTable, System.Collections.IEnumerable {
private DataColumn columnCustomerID;
private DataColumn columnCompanyName;
private DataColumn columnAddress;
private DataColumn columnCity;
private DataColumn columnPostalCode;
private DataColumn columnCountry;
internal CustomersDataTable() :
base("Customers") {
this.InitClass();
}
internal CustomersDataTable(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 CustomerIDColumn {
get {
return this.columnCustomerID;
}
}
internal DataColumn CompanyNameColumn {
get {
return this.columnCompanyName;
}
}
internal DataColumn AddressColumn {
get {
return this.columnAddress;
}
}
internal DataColumn CityColumn {
get {
return this.columnCity;
}
}
internal DataColumn PostalCodeColumn {
get {
return this.columnPostalCode;
}
}
internal DataColumn CountryColumn {
get {
return this.columnCountry;
}
}
public CustomersRow this[int index] {
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 CompanyName, string Address, string City, string PostalCode, string Country) {
CustomersRow rowCustomersRow = ((CustomersRow)(this.NewRow()));
rowCustomersRow.ItemArray = new object[] {
CustomerID,
CompanyName,
Address,
City,
PostalCode,
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.columnCompanyName = this.Columns["CompanyName"];
this.columnAddress = this.Columns["Address"];
this.columnCity = this.Columns["City"];
this.columnPostalCode = this.Columns["PostalCode"];
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.columnCompanyName = new DataColumn("CompanyName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCompanyName);
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.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.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
this.columnCustomerID}, true));
this.columnCustomerID.AllowDBNull = false;
this.columnCustomerID.Unique = true;
this.columnCompanyName.AllowDBNull = false;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -