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

📄 datasetreader.cs

📁 visualc#+sql图书出租管理系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                ReaderDataTable cln = ((ReaderDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new ReaderDataTable();
            }
            
            internal void InitVars() {
                this.columnReaderID = this.Columns["ReaderID"];
                this.columnReaderName = this.Columns["ReaderName"];
                this.columnReaderPassword = this.Columns["ReaderPassword"];
                this.columnReaderPhoneNo = this.Columns["ReaderPhoneNo"];
                this.columnReaderEmail = this.Columns["ReaderEmail"];
                this.columnReaderBorrowedbooks = this.Columns["ReaderBorrowedbooks"];
            }
            
            private void InitClass() {
                this.columnReaderID = new DataColumn("ReaderID", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnReaderID);
                this.columnReaderName = new DataColumn("ReaderName", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnReaderName);
                this.columnReaderPassword = new DataColumn("ReaderPassword", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnReaderPassword);
                this.columnReaderPhoneNo = new DataColumn("ReaderPhoneNo", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnReaderPhoneNo);
                this.columnReaderEmail = new DataColumn("ReaderEmail", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnReaderEmail);
                this.columnReaderBorrowedbooks = new DataColumn("ReaderBorrowedbooks", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnReaderBorrowedbooks);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnReaderID}, true));
                this.columnReaderID.AllowDBNull = false;
                this.columnReaderID.Unique = true;
            }
            
            public ReaderRow NewReaderRow() {
                return ((ReaderRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new ReaderRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(ReaderRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.ReaderRowChanged != null)) {
                    this.ReaderRowChanged(this, new ReaderRowChangeEvent(((ReaderRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.ReaderRowChanging != null)) {
                    this.ReaderRowChanging(this, new ReaderRowChangeEvent(((ReaderRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.ReaderRowDeleted != null)) {
                    this.ReaderRowDeleted(this, new ReaderRowChangeEvent(((ReaderRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.ReaderRowDeleting != null)) {
                    this.ReaderRowDeleting(this, new ReaderRowChangeEvent(((ReaderRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveReaderRow(ReaderRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ReaderRow : DataRow {
            
            private ReaderDataTable tableReader;
            
            internal ReaderRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableReader = ((ReaderDataTable)(this.Table));
            }
            
            public string ReaderID {
                get {
                    return ((string)(this[this.tableReader.ReaderIDColumn]));
                }
                set {
                    this[this.tableReader.ReaderIDColumn] = value;
                }
            }
            
            public string ReaderName {
                get {
                    try {
                        return ((string)(this[this.tableReader.ReaderNameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableReader.ReaderNameColumn] = value;
                }
            }
            
            public string ReaderPassword {
                get {
                    try {
                        return ((string)(this[this.tableReader.ReaderPasswordColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableReader.ReaderPasswordColumn] = value;
                }
            }
            
            public string ReaderPhoneNo {
                get {
                    try {
                        return ((string)(this[this.tableReader.ReaderPhoneNoColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableReader.ReaderPhoneNoColumn] = value;
                }
            }
            
            public string ReaderEmail {
                get {
                    try {
                        return ((string)(this[this.tableReader.ReaderEmailColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableReader.ReaderEmailColumn] = value;
                }
            }
            
            public int ReaderBorrowedbooks {
                get {
                    try {
                        return ((int)(this[this.tableReader.ReaderBorrowedbooksColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableReader.ReaderBorrowedbooksColumn] = value;
                }
            }
            
            public bool IsReaderNameNull() {
                return this.IsNull(this.tableReader.ReaderNameColumn);
            }
            
            public void SetReaderNameNull() {
                this[this.tableReader.ReaderNameColumn] = System.Convert.DBNull;
            }
            
            public bool IsReaderPasswordNull() {
                return this.IsNull(this.tableReader.ReaderPasswordColumn);
            }
            
            public void SetReaderPasswordNull() {
                this[this.tableReader.ReaderPasswordColumn] = System.Convert.DBNull;
            }
            
            public bool IsReaderPhoneNoNull() {
                return this.IsNull(this.tableReader.ReaderPhoneNoColumn);
            }
            
            public void SetReaderPhoneNoNull() {
                this[this.tableReader.ReaderPhoneNoColumn] = System.Convert.DBNull;
            }
            
            public bool IsReaderEmailNull() {
                return this.IsNull(this.tableReader.ReaderEmailColumn);
            }
            
            public void SetReaderEmailNull() {
                this[this.tableReader.ReaderEmailColumn] = System.Convert.DBNull;
            }
            
            public bool IsReaderBorrowedbooksNull() {
                return this.IsNull(this.tableReader.ReaderBorrowedbooksColumn);
            }
            
            public void SetReaderBorrowedbooksNull() {
                this[this.tableReader.ReaderBorrowedbooksColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ReaderRowChangeEvent : EventArgs {
            
            private ReaderRow eventRow;
            
            private DataRowAction eventAction;
            
            public ReaderRowChangeEvent(ReaderRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public ReaderRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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