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

📄 datasetprosell.cs

📁 《C#数据库项目案例导航》一书的配套光盘
💻 CS
📖 第 1 页 / 共 2 页
字号:
                this.Columns.Add(this.columnClientName);
                this.columnProSellUnit = new DataColumn("ProSellUnit", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProSellUnit);
                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.columnProSellPeople = new DataColumn("ProSellPeople", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProSellPeople);
                this.columnProSellRemark = new DataColumn("ProSellRemark", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProSellRemark);
                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 ProSellID {
                get {
                    return ((string)(this[this.tableProSell.ProSellIDColumn]));
                }
                set {
                    this[this.tableProSell.ProSellIDColumn] = value;
                }
            }
            
            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 ProductName {
                get {
                    try {
                        return ((string)(this[this.tableProSell.ProductNameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ProductNameColumn] = value;
                }
            }
            
            public string ClientID {
                get {
                    try {
                        return ((string)(this[this.tableProSell.ClientIDColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ClientIDColumn] = value;
                }
            }
            
            public string ClientName {
                get {
                    try {
                        return ((string)(this[this.tableProSell.ClientNameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ClientNameColumn] = value;
                }
            }
            
            public string ProSellUnit {
                get {
                    try {
                        return ((string)(this[this.tableProSell.ProSellUnitColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ProSellUnitColumn] = 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 string ProSellPeople {
                get {
                    try {
                        return ((string)(this[this.tableProSell.ProSellPeopleColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ProSellPeopleColumn] = value;
                }
            }
            
            public string ProSellRemark {
                get {
                    try {
                        return ((string)(this[this.tableProSell.ProSellRemarkColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProSell.ProSellRemarkColumn] = 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 IsClientIDNull() {
                return this.IsNull(this.tableProSell.ClientIDColumn);
            }
            
            public void SetClientIDNull() {
                this[this.tableProSell.ClientIDColumn] = System.Convert.DBNull;
            }
            
            public bool IsClientNameNull() {
                return this.IsNull(this.tableProSell.ClientNameColumn);
            }
            
            public void SetClientNameNull() {
                this[this.tableProSell.ClientNameColumn] = System.Convert.DBNull;
            }
            
            public bool IsProSellUnitNull() {
                return this.IsNull(this.tableProSell.ProSellUnitColumn);
            }
            
            public void SetProSellUnitNull() {
                this[this.tableProSell.ProSellUnitColumn] = 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;
            }
            
            public bool IsProSellPeopleNull() {
                return this.IsNull(this.tableProSell.ProSellPeopleColumn);
            }
            
            public void SetProSellPeopleNull() {
                this[this.tableProSell.ProSellPeopleColumn] = System.Convert.DBNull;
            }
            
            public bool IsProSellRemarkNull() {
                return this.IsNull(this.tableProSell.ProSellRemarkColumn);
            }
            
            public void SetProSellRemarkNull() {
                this[this.tableProSell.ProSellRemarkColumn] = 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 + -