⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dspublisherstitles.cs

📁 C#150例
💻 CS
📖 第 1 页 / 共 2 页
字号:
//------------------------------------------------------------------------------
// <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 Example129_同时显示相关表数据 {
    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 dsPublishersTitles : DataSet {
        
        private publishersDataTable tablepublishers;
        
        private titlesDataTable tabletitles;
        
        private DataRelation relationpublisherstitles;
        
        public dsPublishersTitles() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected dsPublishersTitles(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["publishers"] != null)) {
                    this.Tables.Add(new publishersDataTable(ds.Tables["publishers"]));
                }
                if ((ds.Tables["titles"] != null)) {
                    this.Tables.Add(new titlesDataTable(ds.Tables["titles"]));
                }
                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 publishersDataTable publishers {
            get {
                return this.tablepublishers;
            }
        }
        
        [System.ComponentModel.Browsable(false)]
        [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
        public titlesDataTable titles {
            get {
                return this.tabletitles;
            }
        }
        
        public override DataSet Clone() {
            dsPublishersTitles cln = ((dsPublishersTitles)(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["publishers"] != null)) {
                this.Tables.Add(new publishersDataTable(ds.Tables["publishers"]));
            }
            if ((ds.Tables["titles"] != null)) {
                this.Tables.Add(new titlesDataTable(ds.Tables["titles"]));
            }
            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.tablepublishers = ((publishersDataTable)(this.Tables["publishers"]));
            if ((this.tablepublishers != null)) {
                this.tablepublishers.InitVars();
            }
            this.tabletitles = ((titlesDataTable)(this.Tables["titles"]));
            if ((this.tabletitles != null)) {
                this.tabletitles.InitVars();
            }
            this.relationpublisherstitles = this.Relations["publisherstitles"];
        }
        
        private void InitClass() {
            this.DataSetName = "dsPublishersTitles";
            this.Prefix = "";
            this.Namespace = "http://www.tempuri.org/dsPublishersTitles.xsd";
            this.Locale = new System.Globalization.CultureInfo("zh-CN");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tablepublishers = new publishersDataTable();
            this.Tables.Add(this.tablepublishers);
            this.tabletitles = new titlesDataTable();
            this.Tables.Add(this.tabletitles);
            ForeignKeyConstraint fkc;
            fkc = new ForeignKeyConstraint("publisherstitles", new DataColumn[] {
                        this.tablepublishers.pub_idColumn}, new DataColumn[] {
                        this.tabletitles.pub_idColumn});
            this.tabletitles.Constraints.Add(fkc);
            fkc.AcceptRejectRule = AcceptRejectRule.None;
            fkc.DeleteRule = Rule.Cascade;
            fkc.UpdateRule = Rule.Cascade;
            this.relationpublisherstitles = new DataRelation("publisherstitles", new DataColumn[] {
                        this.tablepublishers.pub_idColumn}, new DataColumn[] {
                        this.tabletitles.pub_idColumn}, false);
            this.Relations.Add(this.relationpublisherstitles);
        }
        
        private bool ShouldSerializepublishers() {
            return false;
        }
        
        private bool ShouldSerializetitles() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void publishersRowChangeEventHandler(object sender, publishersRowChangeEvent e);
        
        public delegate void titlesRowChangeEventHandler(object sender, titlesRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class publishersDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnpub_id;
            
            private DataColumn columnpub_name;
            
            internal publishersDataTable() : 
                    base("publishers") {
                this.InitClass();
            }
            
            internal publishersDataTable(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 pub_idColumn {
                get {
                    return this.columnpub_id;
                }
            }
            
            internal DataColumn pub_nameColumn {
                get {
                    return this.columnpub_name;
                }
            }
            
            public publishersRow this[int index] {
                get {
                    return ((publishersRow)(this.Rows[index]));
                }
            }
            
            public event publishersRowChangeEventHandler publishersRowChanged;
            
            public event publishersRowChangeEventHandler publishersRowChanging;
            
            public event publishersRowChangeEventHandler publishersRowDeleted;
            
            public event publishersRowChangeEventHandler publishersRowDeleting;
            
            public void AddpublishersRow(publishersRow row) {
                this.Rows.Add(row);
            }
            
            public publishersRow AddpublishersRow(string pub_id, string pub_name) {
                publishersRow rowpublishersRow = ((publishersRow)(this.NewRow()));
                rowpublishersRow.ItemArray = new object[] {
                        pub_id,
                        pub_name};
                this.Rows.Add(rowpublishersRow);
                return rowpublishersRow;
            }
            
            public publishersRow FindBypub_id(string pub_id) {
                return ((publishersRow)(this.Rows.Find(new object[] {
                            pub_id})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                publishersDataTable cln = ((publishersDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new publishersDataTable();
            }
            
            internal void InitVars() {
                this.columnpub_id = this.Columns["pub_id"];
                this.columnpub_name = this.Columns["pub_name"];
            }
            
            private void InitClass() {
                this.columnpub_id = new DataColumn("pub_id", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnpub_id);
                this.columnpub_name = new DataColumn("pub_name", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnpub_name);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnpub_id}, true));
                this.columnpub_id.AllowDBNull = false;
                this.columnpub_id.Unique = true;
            }
            
            public publishersRow NewpublishersRow() {
                return ((publishersRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new publishersRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(publishersRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.publishersRowChanged != null)) {
                    this.publishersRowChanged(this, new publishersRowChangeEvent(((publishersRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.publishersRowChanging != null)) {
                    this.publishersRowChanging(this, new publishersRowChangeEvent(((publishersRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.publishersRowDeleted != null)) {
                    this.publishersRowDeleted(this, new publishersRowChangeEvent(((publishersRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.publishersRowDeleting != null)) {
                    this.publishersRowDeleting(this, new publishersRowChangeEvent(((publishersRow)(e.Row)), e.Action));
                }
            }
            
            public void RemovepublishersRow(publishersRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class publishersRow : DataRow {
            
            private publishersDataTable tablepublishers;
            
            internal publishersRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tablepublishers = ((publishersDataTable)(this.Table));
            }
            
            public string pub_id {
                get {
                    return ((string)(this[this.tablepublishers.pub_idColumn]));
                }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -