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

📄 product.cs

📁 C#高级编程第四版 第十九章源代码 敬请下载
💻 CS
📖 第 1 页 / 共 4 页
字号:
            this.columnUnitsInStock.ExtendedProperties.Add("Generator_EventArgName", "UnitsInStockChangeEventArg");
            base.Columns.Add(this.columnUnitsInStock);
            this.columnUnitsOnOrder = new System.Data.DataColumn("UnitsOnOrder", typeof(short), null, System.Data.MappingType.Element);
            this.columnUnitsOnOrder.ExtendedProperties.Add("Generator_ChangedEventName", "UnitsOnOrderChanged");
            this.columnUnitsOnOrder.ExtendedProperties.Add("Generator_ChangingEventName", "UnitsOnOrderChanging");
            this.columnUnitsOnOrder.ExtendedProperties.Add("Generator_ColumnPropNameInRow", "UnitsOnOrder");
            this.columnUnitsOnOrder.ExtendedProperties.Add("Generator_ColumnPropNameInTable", "UnitsOnOrderColumn");
            this.columnUnitsOnOrder.ExtendedProperties.Add("Generator_ColumnVarNameInTable", "columnUnitsOnOrder");
            this.columnUnitsOnOrder.ExtendedProperties.Add("Generator_DelegateName", "UnitsOnOrderChangeEventHandler");
            this.columnUnitsOnOrder.ExtendedProperties.Add("Generator_EventArgName", "UnitsOnOrderChangeEventArg");
            base.Columns.Add(this.columnUnitsOnOrder);
            this.columnReorderLevel = new System.Data.DataColumn("ReorderLevel", typeof(short), null, System.Data.MappingType.Element);
            this.columnReorderLevel.ExtendedProperties.Add("Generator_ChangedEventName", "ReorderLevelChanged");
            this.columnReorderLevel.ExtendedProperties.Add("Generator_ChangingEventName", "ReorderLevelChanging");
            this.columnReorderLevel.ExtendedProperties.Add("Generator_ColumnPropNameInRow", "ReorderLevel");
            this.columnReorderLevel.ExtendedProperties.Add("Generator_ColumnPropNameInTable", "ReorderLevelColumn");
            this.columnReorderLevel.ExtendedProperties.Add("Generator_ColumnVarNameInTable", "columnReorderLevel");
            this.columnReorderLevel.ExtendedProperties.Add("Generator_DelegateName", "ReorderLevelChangeEventHandler");
            this.columnReorderLevel.ExtendedProperties.Add("Generator_EventArgName", "ReorderLevelChangeEventArg");
            base.Columns.Add(this.columnReorderLevel);
            this.columnDiscontinued = new System.Data.DataColumn("Discontinued", typeof(bool), null, System.Data.MappingType.Element);
            this.columnDiscontinued.ExtendedProperties.Add("Generator_ChangedEventName", "DiscontinuedChanged");
            this.columnDiscontinued.ExtendedProperties.Add("Generator_ChangingEventName", "DiscontinuedChanging");
            this.columnDiscontinued.ExtendedProperties.Add("Generator_ColumnPropNameInRow", "Discontinued");
            this.columnDiscontinued.ExtendedProperties.Add("Generator_ColumnPropNameInTable", "DiscontinuedColumn");
            this.columnDiscontinued.ExtendedProperties.Add("Generator_ColumnVarNameInTable", "columnDiscontinued");
            this.columnDiscontinued.ExtendedProperties.Add("Generator_DelegateName", "DiscontinuedChangeEventHandler");
            this.columnDiscontinued.ExtendedProperties.Add("Generator_EventArgName", "DiscontinuedChangeEventArg");
            base.Columns.Add(this.columnDiscontinued);
            this.columnProductID.AutoIncrement = true;
            this.columnProductID.AllowDBNull = false;
            this.columnProductID.ReadOnly = true;
            this.columnProductName.AllowDBNull = false;
            this.columnDiscontinued.AllowDBNull = false;
            this.Namespace = "http://tempuri.org/XMLSchema1.xsd";
            this.ExtendedProperties.Add("Generator_RowClassName", "ProductRow");
            this.ExtendedProperties.Add("Generator_RowEvArgName", "ProductRowChangeEvent");
            this.ExtendedProperties.Add("Generator_RowEvHandlerName", "ProductRowChangeEventHandler");
            this.ExtendedProperties.Add("Generator_SuspendValidationPropName", "SuspendValidation");
            this.ExtendedProperties.Add("Generator_SuspendValidationVarName", "m_suspendValidation");
            this.ExtendedProperties.Add("Generator_TableClassName", "ProductDataTable");
            this.ExtendedProperties.Add("Generator_TablePropName", "Product");
            this.ExtendedProperties.Add("Generator_TableVarName", "tableProduct");
        }
        
        public ProductRow NewProductRow() {
            return ((ProductRow)(this.NewRow()));
        }
        
        protected override System.Data.DataRow NewRowFromBuilder(System.Data.DataRowBuilder builder) {
            return new ProductRow(builder);
        }
        
        protected override System.Type GetRowType() {
            return typeof(ProductRow);
        }
        
        protected override void OnRowChanged(System.Data.DataRowChangeEventArgs e) {
            base.OnRowChanged(e);
            if ((this.ProductRowChanged != null)) {
                this.ProductRowChanged(this, new ProductRowChangeEvent(((ProductRow)(e.Row)), e.Action));
            }
        }
        
        protected override void OnRowChanging(System.Data.DataRowChangeEventArgs e) {
            base.OnRowChanging(e);
            if ((this.ProductRowChanging != null)) {
                this.ProductRowChanging(this, new ProductRowChangeEvent(((ProductRow)(e.Row)), e.Action));
            }
        }
        
        protected override void OnRowDeleted(System.Data.DataRowChangeEventArgs e) {
            base.OnRowDeleted(e);
            if ((this.ProductRowDeleted != null)) {
                this.ProductRowDeleted(this, new ProductRowChangeEvent(((ProductRow)(e.Row)), e.Action));
            }
        }
        
        protected override void OnRowDeleting(System.Data.DataRowChangeEventArgs e) {
            base.OnRowDeleting(e);
            if ((this.ProductRowDeleting != null)) {
                this.ProductRowDeleting(this, new ProductRowChangeEvent(((ProductRow)(e.Row)), e.Action));
            }
        }
        
        public void RemoveProductRow(ProductRow row) {
            this.Rows.Remove(row);
        }
        
        public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) {
            System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
            System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
            Products ds = new Products();
            xs.Add(ds.GetSchemaSerializable());
            System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
            any1.Namespace = "http://www.w3.org/2001/XMLSchema";
            any1.MinOccurs = new System.Decimal(0);
            any1.MaxOccurs = System.Decimal.MaxValue;
            any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
            sequence.Items.Add(any1);
            System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
            any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
            any2.MinOccurs = new System.Decimal(1);
            any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
            sequence.Items.Add(any2);
            System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute();
            attribute1.Name = "namespace";
            attribute1.FixedValue = ds.Namespace;
            type.Attributes.Add(attribute1);
            System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute();
            attribute2.Name = "tableTypeName";
            attribute2.FixedValue = "ProductDataTable";
            type.Attributes.Add(attribute2);
            type.Particle = sequence;
            return type;
        }
        
        public delegate void ProductIDChangeEventHandler(ProductDataTable sender, ProductIDChangeEventArg e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ProductIDChangeEventArg : System.EventArgs {
            
            private System.Data.DataColumnChangeEventArgs evArgs;
            
            public ProductIDChangeEventArg(System.Data.DataColumnChangeEventArgs args) {
                this.evArgs = args;
            }
            
            public ProductRow Row {
                get {
                    return ((ProductRow)(this.evArgs.Row));
                }
            }
            
            public System.Data.DataColumn ProductIDColumn {
                get {
                    return this.evArgs.Column;
                }
            }
            
            public int ProposedValue {
                get {
                    return ((int)(this.evArgs.ProposedValue));
                }
                set {
                    this.evArgs.ProposedValue = ((int)(value));
                }
            }
        }
        
        public delegate void ProductNameChangeEventHandler(ProductDataTable sender, ProductNameChangeEventArg e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ProductNameChangeEventArg : System.EventArgs {
            
            private System.Data.DataColumnChangeEventArgs evArgs;
            
            public ProductNameChangeEventArg(System.Data.DataColumnChangeEventArgs args) {
                this.evArgs = args;
            }
            
            public ProductRow Row {
                get {
                    return ((ProductRow)(this.evArgs.Row));
                }
            }
            
            public System.Data.DataColumn ProductNameColumn {
                get {
                    return this.evArgs.Column;
                }
            }
            
            public string ProposedValue {
                get {
                    return ((string)(this.evArgs.ProposedValue));
                }
                set {
                    this.evArgs.ProposedValue = ((string)(value));
                }
            }
        }
        
        public delegate void SupplierIDChangeEventHandler(ProductDataTable sender, SupplierIDChangeEventArg e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class SupplierIDChangeEventArg : System.EventArgs {
            
            private System.Data.DataColumnChangeEventArgs evArgs;
            
            public SupplierIDChangeEventArg(System.Data.DataColumnChangeEventArgs args) {
                this.evArgs = args;
            }
            
            public ProductRow Row {
                get {
                    return ((ProductRow)(this.evArgs.Row));
                }
            }
            
            public System.Data.DataColumn SupplierIDColumn {
                get {
                    return this.evArgs.Column;
                }
            }
            
            public int ProposedValue {
                get {
                    return ((int)(this.evArgs.ProposedValue));
                }
                set {
                    this.evArgs.ProposedValue = ((int)(value));
                }
            }
        }
        
        public delegate void CategoryIDChangeEventHandler(ProductDataTable sender, CategoryIDChangeEventArg e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CategoryIDChangeEventArg : System.EventArgs {
            
            private System.Data.DataColumnChangeEventArgs evArgs;
            
            public CategoryIDChangeEventArg(System.Data.DataColumnChangeEventArgs args) {
                this.evArgs = args;
            }
            
            public ProductRow Row {
                get {
                    return ((ProductRow)(this.evArgs.Row));
                }
            }
            
            public System.Data.DataColumn CategoryIDColumn {
                get {
                    return this.evArgs.Column;
                }
            }
            
            public int ProposedValue {
                get {
                    return ((int)(this.evArgs.ProposedValue));
                }
                set {
                    this.evArgs.ProposedValue = ((int)(value));
                }
            }
        }
        
        public delegate void QuantityPerUnitChangeEventHandler(ProductDataTable sender, QuantityPerUnitChangeEventArg e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class QuantityPerUnitChangeEventArg : System.EventArgs {
            
            private System.Data.DataColumnChangeEventArgs evArgs;
            
            public QuantityPerUnitChangeEventArg(System.Data.DataColumnChangeEventArgs args) {
                this.evArgs = args;
            }
            
            public ProductRow Row {
                get {
                    return ((ProductRow)(this.evArgs.Row));
                }
            }
            
            public System.Data.DataColumn QuantityPerUnitColumn {
                get {
                    return this.evArgs.Column;
                }
            }
            
            public string ProposedValue {
                get {
                    return ((string)(this.evArgs.ProposedValue));
                }
                set {
                    this.evArgs.ProposedValue = ((string)(value));
                }
            }
        }
        
        public delegate void UnitPriceChangeEventHandler(ProductDataTable sender, UnitPriceChangeEventArg e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class UnitPriceChangeEventArg : System.EventArgs {
            
            private System.Data.DataColumnChangeEventArgs evArgs;
            
            public UnitPriceChangeEventArg(System.Data.DataColumnChangeEventArgs args) {
                this.evArgs = args;
            }
            
            public ProductRow Row {
                get {
                    return ((ProductRow)(this.evArgs.Row));
                }
            }
            
            public System.Data.DataColumn UnitPriceColumn {
                get {
                    return this.evArgs.Column;
                }
            }
            
            public System.Decimal ProposedValue {
                get {
                    return ((System.Decimal)(this.evArgs.ProposedValue));
                }
                set {
                    this.evArgs.ProposedValue = ((System.Decimal)(value));
                }
            }
        }
        
        public delegate void UnitsInStockChangeEventHandler(ProductDataTable sender, UnitsInStockChangeEventArg e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class UnitsInStockChangeEventArg : System.EventArgs {
            
            private System.Data.DataColumnChangeEventArgs evArgs;
            
            public UnitsInStockChangeEventArg(System.Data.DataColumnChangeEventArgs args) {
                this.evArgs = args;
            }
            
            public ProductRow Row {
                get {
                    return ((ProductRow)(this.evArgs.Row));
                }
            }
            
            public System.Data.DataColumn UnitsInStockColumn {

⌨️ 快捷键说明

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