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

📄 邮编区号.cs

📁 该源代码用 C# 写成
💻 CS
📖 第 1 页 / 共 3 页
字号:
            
            public event ProvinceRowChangeEventHandler ProvinceRowDeleting;
            
            public void AddProvinceRow(ProvinceRow row) {
                this.Rows.Add(row);
            }
            
            public ProvinceRow AddProvinceRow(string Name, string Abbrev, string IsMunicipality, string ProvinceCity) {
                ProvinceRow rowProvinceRow = ((ProvinceRow)(this.NewRow()));
                rowProvinceRow.ItemArray = new object[] {
                        Name,
                        Abbrev,
                        IsMunicipality,
                        ProvinceCity,
                        null};
                this.Rows.Add(rowProvinceRow);
                return rowProvinceRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                ProvinceDataTable cln = ((ProvinceDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new ProvinceDataTable();
            }
            
            internal void InitVars() {
                this.columnName = this.Columns["Name"];
                this.columnAbbrev = this.Columns["Abbrev"];
                this.columnIsMunicipality = this.Columns["IsMunicipality"];
                this.columnProvinceCity = this.Columns["ProvinceCity"];
                this.columnProvince_Id = this.Columns["Province_Id"];
            }
            
            private void InitClass() {
                this.columnName = new DataColumn("Name", typeof(string), null, System.Data.MappingType.Attribute);
                this.Columns.Add(this.columnName);
                this.columnAbbrev = new DataColumn("Abbrev", typeof(string), null, System.Data.MappingType.Attribute);
                this.Columns.Add(this.columnAbbrev);
                this.columnIsMunicipality = new DataColumn("IsMunicipality", typeof(string), null, System.Data.MappingType.Attribute);
                this.Columns.Add(this.columnIsMunicipality);
                this.columnProvinceCity = new DataColumn("ProvinceCity", typeof(string), null, System.Data.MappingType.Attribute);
                this.Columns.Add(this.columnProvinceCity);
                this.columnProvince_Id = new DataColumn("Province_Id", typeof(int), null, System.Data.MappingType.Hidden);
                this.Columns.Add(this.columnProvince_Id);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnProvince_Id}, true));
                this.columnName.Namespace = "";
                this.columnAbbrev.Namespace = "";
                this.columnIsMunicipality.Namespace = "";
                this.columnProvinceCity.Namespace = "";
                this.columnProvince_Id.AutoIncrement = true;
                this.columnProvince_Id.AllowDBNull = false;
                this.columnProvince_Id.Unique = true;
            }
            
            public ProvinceRow NewProvinceRow() {
                return ((ProvinceRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new ProvinceRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(ProvinceRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.ProvinceRowChanged != null)) {
                    this.ProvinceRowChanged(this, new ProvinceRowChangeEvent(((ProvinceRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.ProvinceRowChanging != null)) {
                    this.ProvinceRowChanging(this, new ProvinceRowChangeEvent(((ProvinceRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.ProvinceRowDeleted != null)) {
                    this.ProvinceRowDeleted(this, new ProvinceRowChangeEvent(((ProvinceRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.ProvinceRowDeleting != null)) {
                    this.ProvinceRowDeleting(this, new ProvinceRowChangeEvent(((ProvinceRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveProvinceRow(ProvinceRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ProvinceRow : DataRow {
            
            private ProvinceDataTable tableProvince;
            
            internal ProvinceRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableProvince = ((ProvinceDataTable)(this.Table));
            }
            
            public string Name {
                get {
                    try {
                        return ((string)(this[this.tableProvince.NameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProvince.NameColumn] = value;
                }
            }
            
            public string Abbrev {
                get {
                    try {
                        return ((string)(this[this.tableProvince.AbbrevColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProvince.AbbrevColumn] = value;
                }
            }
            
            public string IsMunicipality {
                get {
                    try {
                        return ((string)(this[this.tableProvince.IsMunicipalityColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProvince.IsMunicipalityColumn] = value;
                }
            }
            
            public string ProvinceCity {
                get {
                    try {
                        return ((string)(this[this.tableProvince.ProvinceCityColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableProvince.ProvinceCityColumn] = value;
                }
            }
            
            public bool IsNameNull() {
                return this.IsNull(this.tableProvince.NameColumn);
            }
            
            public void SetNameNull() {
                this[this.tableProvince.NameColumn] = System.Convert.DBNull;
            }
            
            public bool IsAbbrevNull() {
                return this.IsNull(this.tableProvince.AbbrevColumn);
            }
            
            public void SetAbbrevNull() {
                this[this.tableProvince.AbbrevColumn] = System.Convert.DBNull;
            }
            
            public bool IsIsMunicipalityNull() {
                return this.IsNull(this.tableProvince.IsMunicipalityColumn);
            }
            
            public void SetIsMunicipalityNull() {
                this[this.tableProvince.IsMunicipalityColumn] = System.Convert.DBNull;
            }
            
            public bool IsProvinceCityNull() {
                return this.IsNull(this.tableProvince.ProvinceCityColumn);
            }
            
            public void SetProvinceCityNull() {
                this[this.tableProvince.ProvinceCityColumn] = System.Convert.DBNull;
            }
            
            public CityRow[] GetCityRows() {
                return ((CityRow[])(this.GetChildRows(this.Table.ChildRelations["Province_City"])));
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ProvinceRowChangeEvent : EventArgs {
            
            private ProvinceRow eventRow;
            
            private DataRowAction eventAction;
            
            public ProvinceRowChangeEvent(ProvinceRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public ProvinceRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CityDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnZipCode;
            
            private DataColumn columnPhonePrefix;
            
            private DataColumn columnName;
            
            private DataColumn columnProvince_Id;
            
            internal CityDataTable() : 
                    base("City") {
                this.InitClass();
            }
            
            internal CityDataTable(DataTable table) : 
                    base(table.TableName) {
                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                    this.CaseSensitive = table.CaseSensitive;
                }
                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                    this.Locale = table.Locale;
                }

⌨️ 快捷键说明

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