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

📄 邮编区号.cs

📁 该源代码用 C# 写成
💻 CS
📖 第 1 页 / 共 3 页
字号:
                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 ZipCodeColumn {
                get {
                    return this.columnZipCode;
                }
            }
            
            internal DataColumn PhonePrefixColumn {
                get {
                    return this.columnPhonePrefix;
                }
            }
            
            internal DataColumn NameColumn {
                get {
                    return this.columnName;
                }
            }
            
            internal DataColumn Province_IdColumn {
                get {
                    return this.columnProvince_Id;
                }
            }
            
            public CityRow this[int index] {
                get {
                    return ((CityRow)(this.Rows[index]));
                }
            }
            
            public event CityRowChangeEventHandler CityRowChanged;
            
            public event CityRowChangeEventHandler CityRowChanging;
            
            public event CityRowChangeEventHandler CityRowDeleted;
            
            public event CityRowChangeEventHandler CityRowDeleting;
            
            public void AddCityRow(CityRow row) {
                this.Rows.Add(row);
            }
            
            public CityRow AddCityRow(string ZipCode, string PhonePrefix, string Name, ProvinceRow parentProvinceRowByProvince_City) {
                CityRow rowCityRow = ((CityRow)(this.NewRow()));
                rowCityRow.ItemArray = new object[] {
                        ZipCode,
                        PhonePrefix,
                        Name,
                        parentProvinceRowByProvince_City[4]};
                this.Rows.Add(rowCityRow);
                return rowCityRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                CityDataTable cln = ((CityDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new CityDataTable();
            }
            
            internal void InitVars() {
                this.columnZipCode = this.Columns["ZipCode"];
                this.columnPhonePrefix = this.Columns["PhonePrefix"];
                this.columnName = this.Columns["Name"];
                this.columnProvince_Id = this.Columns["Province_Id"];
            }
            
            private void InitClass() {
                this.columnZipCode = new DataColumn("ZipCode", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnZipCode);
                this.columnPhonePrefix = new DataColumn("PhonePrefix", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnPhonePrefix);
                this.columnName = new DataColumn("Name", typeof(string), null, System.Data.MappingType.Attribute);
                this.Columns.Add(this.columnName);
                this.columnProvince_Id = new DataColumn("Province_Id", typeof(int), null, System.Data.MappingType.Hidden);
                this.Columns.Add(this.columnProvince_Id);
                this.columnName.Namespace = "";
            }
            
            public CityRow NewCityRow() {
                return ((CityRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new CityRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(CityRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.CityRowChanged != null)) {
                    this.CityRowChanged(this, new CityRowChangeEvent(((CityRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.CityRowChanging != null)) {
                    this.CityRowChanging(this, new CityRowChangeEvent(((CityRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.CityRowDeleted != null)) {
                    this.CityRowDeleted(this, new CityRowChangeEvent(((CityRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.CityRowDeleting != null)) {
                    this.CityRowDeleting(this, new CityRowChangeEvent(((CityRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveCityRow(CityRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CityRow : DataRow {
            
            private CityDataTable tableCity;
            
            internal CityRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableCity = ((CityDataTable)(this.Table));
            }
            
            public string ZipCode {
                get {
                    try {
                        return ((string)(this[this.tableCity.ZipCodeColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCity.ZipCodeColumn] = value;
                }
            }
            
            public string PhonePrefix {
                get {
                    try {
                        return ((string)(this[this.tableCity.PhonePrefixColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCity.PhonePrefixColumn] = value;
                }
            }
            
            public string Name {
                get {
                    try {
                        return ((string)(this[this.tableCity.NameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCity.NameColumn] = value;
                }
            }
            
            public ProvinceRow ProvinceRow {
                get {
                    return ((ProvinceRow)(this.GetParentRow(this.Table.ParentRelations["Province_City"])));
                }
                set {
                    this.SetParentRow(value, this.Table.ParentRelations["Province_City"]);
                }
            }
            
            public bool IsZipCodeNull() {
                return this.IsNull(this.tableCity.ZipCodeColumn);
            }
            
            public void SetZipCodeNull() {
                this[this.tableCity.ZipCodeColumn] = System.Convert.DBNull;
            }
            
            public bool IsPhonePrefixNull() {
                return this.IsNull(this.tableCity.PhonePrefixColumn);
            }
            
            public void SetPhonePrefixNull() {
                this[this.tableCity.PhonePrefixColumn] = System.Convert.DBNull;
            }
            
            public bool IsNameNull() {
                return this.IsNull(this.tableCity.NameColumn);
            }
            
            public void SetNameNull() {
                this[this.tableCity.NameColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CityRowChangeEvent : EventArgs {
            
            private CityRow eventRow;
            
            private DataRowAction eventAction;
            
            public CityRowChangeEvent(CityRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public CityRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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