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

📄 datasetanalyse.cs

📁 《C#数据库项目案例导航》一书的配套光盘
💻 CS
📖 第 1 页 / 共 2 页
字号:
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                ProSellDataTable cln = ((ProSellDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new ProSellDataTable();
            }
            
            internal void InitVars() {
                this.columnProductID = this.Columns["ProductID"];
                this.columnProSellID = this.Columns["ProSellID"];
                this.columnProductName = this.Columns["ProductName"];
                this.columnProSellNumber = this.Columns["ProSellNumber"];
                this.columnProSellPrice = this.Columns["ProSellPrice"];
                this.columnProSellDate = this.Columns["ProSellDate"];
            }
            
            private void InitClass() {
                this.columnProductID = new DataColumn("ProductID", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProductID);
                this.columnProSellID = new DataColumn("ProSellID", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProSellID);
                this.columnProductName = new DataColumn("ProductName", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProductName);
                this.columnProSellNumber = new DataColumn("ProSellNumber", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProSellNumber);
                this.columnProSellPrice = new DataColumn("ProSellPrice", typeof(System.Double), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProSellPrice);
                this.columnProSellDate = new DataColumn("ProSellDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProSellDate);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnProSellID}, true));
                this.columnProSellID.AllowDBNull = false;
                this.columnProSellID.Unique = true;
            }
            
            public ProSellRow NewProSellRow() {
                return ((ProSellRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new ProSellRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(ProSellRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.ProSellRowChanged != null)) {
                    this.ProSellRowChanged(this, new ProSellRowChangeEvent(((ProSellRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.ProSellRowChanging != null)) {
                    this.ProSellRowChanging(this, new ProSellRowChangeEvent(((ProSellRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.ProSellRowDeleted != null)) {
                    this.ProSellRowDeleted(this, new ProSellRowChangeEvent(((ProSellRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.ProSellRowDeleting != null)) {
                    this.ProSellRowDeleting(this, new ProSellRowChangeEvent(((ProSellRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveProSellRow(ProSellRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ProSellRow : DataRow {
            
            private ProSellDataTable tableProSell;
            
            internal ProSellRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableProSell = ((ProSellDataTable)(this.Table));
            }
            
            public string ProductID {
                get {
                    try {
                        return ((string)(this[this.tableProSell.ProductIDColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ProductIDColumn] = value;
                }
            }
            
            public string ProSellID {
                get {
                    return ((string)(this[this.tableProSell.ProSellIDColumn]));
                }
                set {
                    this[this.tableProSell.ProSellIDColumn] = value;
                }
            }
            
            public string ProductName {
                get {
                    try {
                        return ((string)(this[this.tableProSell.ProductNameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ProductNameColumn] = value;
                }
            }
            
            public int ProSellNumber {
                get {
                    try {
                        return ((int)(this[this.tableProSell.ProSellNumberColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ProSellNumberColumn] = value;
                }
            }
            
            public System.Double ProSellPrice {
                get {
                    try {
                        return ((System.Double)(this[this.tableProSell.ProSellPriceColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ProSellPriceColumn] = value;
                }
            }
            
            public System.DateTime ProSellDate {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableProSell.ProSellDateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ProSellDateColumn] = value;
                }
            }
            
            public bool IsProductIDNull() {
                return this.IsNull(this.tableProSell.ProductIDColumn);
            }
            
            public void SetProductIDNull() {
                this[this.tableProSell.ProductIDColumn] = System.Convert.DBNull;
            }
            
            public bool IsProductNameNull() {
                return this.IsNull(this.tableProSell.ProductNameColumn);
            }
            
            public void SetProductNameNull() {
                this[this.tableProSell.ProductNameColumn] = System.Convert.DBNull;
            }
            
            public bool IsProSellNumberNull() {
                return this.IsNull(this.tableProSell.ProSellNumberColumn);
            }
            
            public void SetProSellNumberNull() {
                this[this.tableProSell.ProSellNumberColumn] = System.Convert.DBNull;
            }
            
            public bool IsProSellPriceNull() {
                return this.IsNull(this.tableProSell.ProSellPriceColumn);
            }
            
            public void SetProSellPriceNull() {
                this[this.tableProSell.ProSellPriceColumn] = System.Convert.DBNull;
            }
            
            public bool IsProSellDateNull() {
                return this.IsNull(this.tableProSell.ProSellDateColumn);
            }
            
            public void SetProSellDateNull() {
                this[this.tableProSell.ProSellDateColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ProSellRowChangeEvent : EventArgs {
            
            private ProSellRow eventRow;
            
            private DataRowAction eventAction;
            
            public ProSellRowChangeEvent(ProSellRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public ProSellRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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