Dataset1.cs
资源名称:Visual.rar [点击查看]
上传用户:yiyuerguo
上传日期:2014-09-27
资源大小:3781k
文件大小:27k
源码类别:
C#编程
开发平台:
Others
- //------------------------------------------------------------------------------
- // <autogenerated>
- // This code was generated by a tool.
- // Runtime Version: 1.1.4322.573
- //
- // Changes to this file may cause incorrect behavior and will be lost if
- // the code is regenerated.
- // </autogenerated>
- //------------------------------------------------------------------------------
- namespace jiaowu {
- 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 Dataset1 : DataSet {
- private StudDataTable tableStud;
- private YuanxiDataTable tableYuanxi;
- public Dataset1() {
- this.InitClass();
- System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
- this.Tables.CollectionChanged += schemaChangedHandler;
- this.Relations.CollectionChanged += schemaChangedHandler;
- }
- protected Dataset1(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["Stud"] != null)) {
- this.Tables.Add(new StudDataTable(ds.Tables["Stud"]));
- }
- if ((ds.Tables["Yuanxi"] != null)) {
- this.Tables.Add(new YuanxiDataTable(ds.Tables["Yuanxi"]));
- }
- 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 StudDataTable Stud {
- get {
- return this.tableStud;
- }
- }
- [System.ComponentModel.Browsable(false)]
- [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
- public YuanxiDataTable Yuanxi {
- get {
- return this.tableYuanxi;
- }
- }
- public override DataSet Clone() {
- Dataset1 cln = ((Dataset1)(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["Stud"] != null)) {
- this.Tables.Add(new StudDataTable(ds.Tables["Stud"]));
- }
- if ((ds.Tables["Yuanxi"] != null)) {
- this.Tables.Add(new YuanxiDataTable(ds.Tables["Yuanxi"]));
- }
- 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.tableStud = ((StudDataTable)(this.Tables["Stud"]));
- if ((this.tableStud != null)) {
- this.tableStud.InitVars();
- }
- this.tableYuanxi = ((YuanxiDataTable)(this.Tables["Yuanxi"]));
- if ((this.tableYuanxi != null)) {
- this.tableYuanxi.InitVars();
- }
- }
- private void InitClass() {
- this.DataSetName = "Dataset1";
- this.Prefix = "";
- this.Namespace = "http://tempuri.org/Dataset1.xsd";
- this.Locale = new System.Globalization.CultureInfo("en-US");
- this.CaseSensitive = false;
- this.EnforceConstraints = true;
- this.tableStud = new StudDataTable();
- this.Tables.Add(this.tableStud);
- this.tableYuanxi = new YuanxiDataTable();
- this.Tables.Add(this.tableYuanxi);
- }
- private bool ShouldSerializeStud() {
- return false;
- }
- private bool ShouldSerializeYuanxi() {
- return false;
- }
- private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
- if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
- this.InitVars();
- }
- }
- public delegate void StudRowChangeEventHandler(object sender, StudRowChangeEvent e);
- public delegate void YuanxiRowChangeEventHandler(object sender, YuanxiRowChangeEvent e);
- [System.Diagnostics.DebuggerStepThrough()]
- public class StudDataTable : DataTable, System.Collections.IEnumerable {
- private DataColumn columns_ID;
- private DataColumn columns_Number;
- private DataColumn columns_Name;
- private DataColumn columns_Age;
- private DataColumn columnY_Number;
- internal StudDataTable() :
- base("Stud") {
- this.InitClass();
- }
- internal StudDataTable(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 s_IDColumn {
- get {
- return this.columns_ID;
- }
- }
- internal DataColumn s_NumberColumn {
- get {
- return this.columns_Number;
- }
- }
- internal DataColumn s_NameColumn {
- get {
- return this.columns_Name;
- }
- }
- internal DataColumn s_AgeColumn {
- get {
- return this.columns_Age;
- }
- }
- internal DataColumn Y_NumberColumn {
- get {
- return this.columnY_Number;
- }
- }
- public StudRow this[int index] {
- get {
- return ((StudRow)(this.Rows[index]));
- }
- }
- public event StudRowChangeEventHandler StudRowChanged;
- public event StudRowChangeEventHandler StudRowChanging;
- public event StudRowChangeEventHandler StudRowDeleted;
- public event StudRowChangeEventHandler StudRowDeleting;
- public void AddStudRow(StudRow row) {
- this.Rows.Add(row);
- }
- public StudRow AddStudRow(string s_Number, string s_Name, int s_Age, int Y_Number) {
- StudRow rowStudRow = ((StudRow)(this.NewRow()));
- rowStudRow.ItemArray = new object[] {
- null,
- s_Number,
- s_Name,
- s_Age,
- Y_Number};
- this.Rows.Add(rowStudRow);
- return rowStudRow;
- }
- public StudRow FindBys_Number(string s_Number) {
- return ((StudRow)(this.Rows.Find(new object[] {
- s_Number})));
- }
- public System.Collections.IEnumerator GetEnumerator() {
- return this.Rows.GetEnumerator();
- }
- public override DataTable Clone() {
- StudDataTable cln = ((StudDataTable)(base.Clone()));
- cln.InitVars();
- return cln;
- }
- protected override DataTable CreateInstance() {
- return new StudDataTable();
- }
- internal void InitVars() {
- this.columns_ID = this.Columns["s_ID"];
- this.columns_Number = this.Columns["s_Number"];
- this.columns_Name = this.Columns["s_Name"];
- this.columns_Age = this.Columns["s_Age"];
- this.columnY_Number = this.Columns["Y_Number"];
- }
- private void InitClass() {
- this.columns_ID = new DataColumn("s_ID", typeof(int), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columns_ID);
- this.columns_Number = new DataColumn("s_Number", typeof(string), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columns_Number);
- this.columns_Name = new DataColumn("s_Name", typeof(string), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columns_Name);
- this.columns_Age = new DataColumn("s_Age", typeof(int), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columns_Age);
- this.columnY_Number = new DataColumn("Y_Number", typeof(int), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columnY_Number);
- this.Constraints.Add(new UniqueConstraint("Dataset1Key1", new DataColumn[] {
- this.columns_Number}, true));
- this.columns_ID.AutoIncrement = true;
- this.columns_ID.AllowDBNull = false;
- this.columns_ID.ReadOnly = true;
- this.columns_Number.AllowDBNull = false;
- this.columns_Number.Unique = true;
- this.columns_Name.AllowDBNull = false;
- this.columns_Age.AllowDBNull = false;
- this.columnY_Number.AllowDBNull = false;
- }
- public StudRow NewStudRow() {
- return ((StudRow)(this.NewRow()));
- }
- protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
- return new StudRow(builder);
- }
- protected override System.Type GetRowType() {
- return typeof(StudRow);
- }
- protected override void OnRowChanged(DataRowChangeEventArgs e) {
- base.OnRowChanged(e);
- if ((this.StudRowChanged != null)) {
- this.StudRowChanged(this, new StudRowChangeEvent(((StudRow)(e.Row)), e.Action));
- }
- }
- protected override void OnRowChanging(DataRowChangeEventArgs e) {
- base.OnRowChanging(e);
- if ((this.StudRowChanging != null)) {
- this.StudRowChanging(this, new StudRowChangeEvent(((StudRow)(e.Row)), e.Action));
- }
- }
- protected override void OnRowDeleted(DataRowChangeEventArgs e) {
- base.OnRowDeleted(e);
- if ((this.StudRowDeleted != null)) {
- this.StudRowDeleted(this, new StudRowChangeEvent(((StudRow)(e.Row)), e.Action));
- }
- }
- protected override void OnRowDeleting(DataRowChangeEventArgs e) {
- base.OnRowDeleting(e);
- if ((this.StudRowDeleting != null)) {
- this.StudRowDeleting(this, new StudRowChangeEvent(((StudRow)(e.Row)), e.Action));
- }
- }
- public void RemoveStudRow(StudRow row) {
- this.Rows.Remove(row);
- }
- }
- [System.Diagnostics.DebuggerStepThrough()]
- public class StudRow : DataRow {
- private StudDataTable tableStud;
- internal StudRow(DataRowBuilder rb) :
- base(rb) {
- this.tableStud = ((StudDataTable)(this.Table));
- }
- public int s_ID {
- get {
- return ((int)(this[this.tableStud.s_IDColumn]));
- }
- set {
- this[this.tableStud.s_IDColumn] = value;
- }
- }
- public string s_Number {
- get {
- return ((string)(this[this.tableStud.s_NumberColumn]));
- }
- set {
- this[this.tableStud.s_NumberColumn] = value;
- }
- }
- public string s_Name {
- get {
- return ((string)(this[this.tableStud.s_NameColumn]));
- }
- set {
- this[this.tableStud.s_NameColumn] = value;
- }
- }
- public int s_Age {
- get {
- return ((int)(this[this.tableStud.s_AgeColumn]));
- }
- set {
- this[this.tableStud.s_AgeColumn] = value;
- }
- }
- public int Y_Number {
- get {
- return ((int)(this[this.tableStud.Y_NumberColumn]));
- }
- set {
- this[this.tableStud.Y_NumberColumn] = value;
- }
- }
- }
- [System.Diagnostics.DebuggerStepThrough()]
- public class StudRowChangeEvent : EventArgs {
- private StudRow eventRow;
- private DataRowAction eventAction;
- public StudRowChangeEvent(StudRow row, DataRowAction action) {
- this.eventRow = row;
- this.eventAction = action;
- }
- public StudRow Row {
- get {
- return this.eventRow;
- }
- }
- public DataRowAction Action {
- get {
- return this.eventAction;
- }
- }
- }
- [System.Diagnostics.DebuggerStepThrough()]
- public class YuanxiDataTable : DataTable, System.Collections.IEnumerable {
- private DataColumn columnY_ID;
- private DataColumn columnY_Number;
- private DataColumn columnY_Name;
- private DataColumn columnY_Head;
- private DataColumn columnY_Des;
- internal YuanxiDataTable() :
- base("Yuanxi") {
- this.InitClass();
- }
- internal YuanxiDataTable(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 Y_IDColumn {
- get {
- return this.columnY_ID;
- }
- }
- internal DataColumn Y_NumberColumn {
- get {
- return this.columnY_Number;
- }
- }
- internal DataColumn Y_NameColumn {
- get {
- return this.columnY_Name;
- }
- }
- internal DataColumn Y_HeadColumn {
- get {
- return this.columnY_Head;
- }
- }
- internal DataColumn Y_DesColumn {
- get {
- return this.columnY_Des;
- }
- }
- public YuanxiRow this[int index] {
- get {
- return ((YuanxiRow)(this.Rows[index]));
- }
- }
- public event YuanxiRowChangeEventHandler YuanxiRowChanged;
- public event YuanxiRowChangeEventHandler YuanxiRowChanging;
- public event YuanxiRowChangeEventHandler YuanxiRowDeleted;
- public event YuanxiRowChangeEventHandler YuanxiRowDeleting;
- public void AddYuanxiRow(YuanxiRow row) {
- this.Rows.Add(row);
- }
- public YuanxiRow AddYuanxiRow(int Y_Number, string Y_Name, string Y_Head, string Y_Des) {
- YuanxiRow rowYuanxiRow = ((YuanxiRow)(this.NewRow()));
- rowYuanxiRow.ItemArray = new object[] {
- null,
- Y_Number,
- Y_Name,
- Y_Head,
- Y_Des};
- this.Rows.Add(rowYuanxiRow);
- return rowYuanxiRow;
- }
- public YuanxiRow FindByY_Number(int Y_Number) {
- return ((YuanxiRow)(this.Rows.Find(new object[] {
- Y_Number})));
- }
- public System.Collections.IEnumerator GetEnumerator() {
- return this.Rows.GetEnumerator();
- }
- public override DataTable Clone() {
- YuanxiDataTable cln = ((YuanxiDataTable)(base.Clone()));
- cln.InitVars();
- return cln;
- }
- protected override DataTable CreateInstance() {
- return new YuanxiDataTable();
- }
- internal void InitVars() {
- this.columnY_ID = this.Columns["Y_ID"];
- this.columnY_Number = this.Columns["Y_Number"];
- this.columnY_Name = this.Columns["Y_Name"];
- this.columnY_Head = this.Columns["Y_Head"];
- this.columnY_Des = this.Columns["Y_Des"];
- }
- private void InitClass() {
- this.columnY_ID = new DataColumn("Y_ID", typeof(int), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columnY_ID);
- this.columnY_Number = new DataColumn("Y_Number", typeof(int), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columnY_Number);
- this.columnY_Name = new DataColumn("Y_Name", typeof(string), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columnY_Name);
- this.columnY_Head = new DataColumn("Y_Head", typeof(string), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columnY_Head);
- this.columnY_Des = new DataColumn("Y_Des", typeof(string), null, System.Data.MappingType.Element);
- this.Columns.Add(this.columnY_Des);
- this.Constraints.Add(new UniqueConstraint("Dataset1Key2", new DataColumn[] {
- this.columnY_Number}, true));
- this.columnY_ID.AutoIncrement = true;
- this.columnY_ID.AllowDBNull = false;
- this.columnY_ID.ReadOnly = true;
- this.columnY_Number.AllowDBNull = false;
- this.columnY_Number.Unique = true;
- this.columnY_Name.AllowDBNull = false;
- this.columnY_Head.AllowDBNull = false;
- }
- public YuanxiRow NewYuanxiRow() {
- return ((YuanxiRow)(this.NewRow()));
- }
- protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
- return new YuanxiRow(builder);
- }
- protected override System.Type GetRowType() {
- return typeof(YuanxiRow);
- }
- protected override void OnRowChanged(DataRowChangeEventArgs e) {
- base.OnRowChanged(e);
- if ((this.YuanxiRowChanged != null)) {
- this.YuanxiRowChanged(this, new YuanxiRowChangeEvent(((YuanxiRow)(e.Row)), e.Action));
- }
- }
- protected override void OnRowChanging(DataRowChangeEventArgs e) {
- base.OnRowChanging(e);
- if ((this.YuanxiRowChanging != null)) {
- this.YuanxiRowChanging(this, new YuanxiRowChangeEvent(((YuanxiRow)(e.Row)), e.Action));
- }
- }
- protected override void OnRowDeleted(DataRowChangeEventArgs e) {
- base.OnRowDeleted(e);
- if ((this.YuanxiRowDeleted != null)) {
- this.YuanxiRowDeleted(this, new YuanxiRowChangeEvent(((YuanxiRow)(e.Row)), e.Action));
- }
- }
- protected override void OnRowDeleting(DataRowChangeEventArgs e) {
- base.OnRowDeleting(e);
- if ((this.YuanxiRowDeleting != null)) {
- this.YuanxiRowDeleting(this, new YuanxiRowChangeEvent(((YuanxiRow)(e.Row)), e.Action));
- }
- }
- public void RemoveYuanxiRow(YuanxiRow row) {
- this.Rows.Remove(row);
- }
- }
- [System.Diagnostics.DebuggerStepThrough()]
- public class YuanxiRow : DataRow {
- private YuanxiDataTable tableYuanxi;
- internal YuanxiRow(DataRowBuilder rb) :
- base(rb) {
- this.tableYuanxi = ((YuanxiDataTable)(this.Table));
- }
- public int Y_ID {
- get {
- return ((int)(this[this.tableYuanxi.Y_IDColumn]));
- }
- set {
- this[this.tableYuanxi.Y_IDColumn] = value;
- }
- }
- public int Y_Number {
- get {
- return ((int)(this[this.tableYuanxi.Y_NumberColumn]));
- }
- set {
- this[this.tableYuanxi.Y_NumberColumn] = value;
- }
- }
- public string Y_Name {
- get {
- return ((string)(this[this.tableYuanxi.Y_NameColumn]));
- }
- set {
- this[this.tableYuanxi.Y_NameColumn] = value;
- }
- }
- public string Y_Head {
- get {
- return ((string)(this[this.tableYuanxi.Y_HeadColumn]));
- }
- set {
- this[this.tableYuanxi.Y_HeadColumn] = value;
- }
- }
- public string Y_Des {
- get {
- try {
- return ((string)(this[this.tableYuanxi.Y_DesColumn]));
- }
- catch (InvalidCastException e) {
- throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
- }
- }
- set {
- this[this.tableYuanxi.Y_DesColumn] = value;
- }
- }
- public bool IsY_DesNull() {
- return this.IsNull(this.tableYuanxi.Y_DesColumn);
- }
- public void SetY_DesNull() {
- this[this.tableYuanxi.Y_DesColumn] = System.Convert.DBNull;
- }
- }
- [System.Diagnostics.DebuggerStepThrough()]
- public class YuanxiRowChangeEvent : EventArgs {
- private YuanxiRow eventRow;
- private DataRowAction eventAction;
- public YuanxiRowChangeEvent(YuanxiRow row, DataRowAction action) {
- this.eventRow = row;
- this.eventAction = action;
- }
- public YuanxiRow Row {
- get {
- return this.eventRow;
- }
- }
- public DataRowAction Action {
- get {
- return this.eventAction;
- }
- }
- }
- }
- }