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

📄 customerdataset.cs

📁 跟踪每个月客户的造访次数
💻 CS
📖 第 1 页 / 共 2 页
字号:
            }
            
            public tblCustomerRow AddtblCustomerRow(string CarNo, string Name, string Address, string Make) {
                tblCustomerRow rowtblCustomerRow = ((tblCustomerRow)(this.NewRow()));
                rowtblCustomerRow.ItemArray = new object[] {
                        CarNo,
                        Name,
                        Address,
                        Make};
                this.Rows.Add(rowtblCustomerRow);
                return rowtblCustomerRow;
            }
            
            public tblCustomerRow FindByCarNo(string CarNo) {
                return ((tblCustomerRow)(this.Rows.Find(new object[] {
                            CarNo})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                tblCustomerDataTable cln = ((tblCustomerDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new tblCustomerDataTable();
            }
            
            internal void InitVars() {
                this.columnCarNo = this.Columns["CarNo"];
                this.columnName = this.Columns["Name"];
                this.columnAddress = this.Columns["Address"];
                this.columnMake = this.Columns["Make"];
            }
            
            private void InitClass() {
                this.columnCarNo = new DataColumn("CarNo", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCarNo);
                this.columnName = new DataColumn("Name", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnName);
                this.columnAddress = new DataColumn("Address", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnAddress);
                this.columnMake = new DataColumn("Make", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnMake);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnCarNo}, true));
                this.columnCarNo.AllowDBNull = false;
                this.columnCarNo.Unique = true;
            }
            
            public tblCustomerRow NewtblCustomerRow() {
                return ((tblCustomerRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new tblCustomerRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(tblCustomerRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.tblCustomerRowChanged != null)) {
                    this.tblCustomerRowChanged(this, new tblCustomerRowChangeEvent(((tblCustomerRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.tblCustomerRowChanging != null)) {
                    this.tblCustomerRowChanging(this, new tblCustomerRowChangeEvent(((tblCustomerRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.tblCustomerRowDeleted != null)) {
                    this.tblCustomerRowDeleted(this, new tblCustomerRowChangeEvent(((tblCustomerRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.tblCustomerRowDeleting != null)) {
                    this.tblCustomerRowDeleting(this, new tblCustomerRowChangeEvent(((tblCustomerRow)(e.Row)), e.Action));
                }
            }
            
            public void RemovetblCustomerRow(tblCustomerRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class tblCustomerRow : DataRow {
            
            private tblCustomerDataTable tabletblCustomer;
            
            internal tblCustomerRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tabletblCustomer = ((tblCustomerDataTable)(this.Table));
            }
            
            public string CarNo {
                get {
                    return ((string)(this[this.tabletblCustomer.CarNoColumn]));
                }
                set {
                    this[this.tabletblCustomer.CarNoColumn] = value;
                }
            }
            
            public string Name {
                get {
                    try {
                        return ((string)(this[this.tabletblCustomer.NameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tabletblCustomer.NameColumn] = value;
                }
            }
            
            public string Address {
                get {
                    try {
                        return ((string)(this[this.tabletblCustomer.AddressColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tabletblCustomer.AddressColumn] = value;
                }
            }
            
            public string Make {
                get {
                    try {
                        return ((string)(this[this.tabletblCustomer.MakeColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tabletblCustomer.MakeColumn] = value;
                }
            }
            
            public bool IsNameNull() {
                return this.IsNull(this.tabletblCustomer.NameColumn);
            }
            
            public void SetNameNull() {
                this[this.tabletblCustomer.NameColumn] = System.Convert.DBNull;
            }
            
            public bool IsAddressNull() {
                return this.IsNull(this.tabletblCustomer.AddressColumn);
            }
            
            public void SetAddressNull() {
                this[this.tabletblCustomer.AddressColumn] = System.Convert.DBNull;
            }
            
            public bool IsMakeNull() {
                return this.IsNull(this.tabletblCustomer.MakeColumn);
            }
            
            public void SetMakeNull() {
                this[this.tabletblCustomer.MakeColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class tblCustomerRowChangeEvent : EventArgs {
            
            private tblCustomerRow eventRow;
            
            private DataRowAction eventAction;
            
            public tblCustomerRowChangeEvent(tblCustomerRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public tblCustomerRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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