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

📄 datasetquery.cs

📁 visualc#+sql图书出租管理系统
💻 CS
📖 第 1 页 / 共 5 页
字号:
            
            public void SetBookRemainNull() {
                this[this.tableBook.BookRemainColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class BookRowChangeEvent : EventArgs {
            
            private BookRow eventRow;
            
            private DataRowAction eventAction;
            
            public BookRowChangeEvent(BookRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public BookRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class BorrowDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnReaderID;
            
            private DataColumn columnReaderName;
            
            private DataColumn columnReaderPhoneNo;
            
            private DataColumn columnBookID;
            
            private DataColumn columnBookName;
            
            private DataColumn columnBookWriter;
            
            private DataColumn columnBorrowDate;
            
            private DataColumn columnReturnDate;
            
            internal BorrowDataTable() : 
                    base("Borrow") {
                this.InitClass();
            }
            
            internal BorrowDataTable(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;
                }
                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 ReaderIDColumn {
                get {
                    return this.columnReaderID;
                }
            }
            
            internal DataColumn ReaderNameColumn {
                get {
                    return this.columnReaderName;
                }
            }
            
            internal DataColumn ReaderPhoneNoColumn {
                get {
                    return this.columnReaderPhoneNo;
                }
            }
            
            internal DataColumn BookIDColumn {
                get {
                    return this.columnBookID;
                }
            }
            
            internal DataColumn BookNameColumn {
                get {
                    return this.columnBookName;
                }
            }
            
            internal DataColumn BookWriterColumn {
                get {
                    return this.columnBookWriter;
                }
            }
            
            internal DataColumn BorrowDateColumn {
                get {
                    return this.columnBorrowDate;
                }
            }
            
            internal DataColumn ReturnDateColumn {
                get {
                    return this.columnReturnDate;
                }
            }
            
            public BorrowRow this[int index] {
                get {
                    return ((BorrowRow)(this.Rows[index]));
                }
            }
            
            public event BorrowRowChangeEventHandler BorrowRowChanged;
            
            public event BorrowRowChangeEventHandler BorrowRowChanging;
            
            public event BorrowRowChangeEventHandler BorrowRowDeleted;
            
            public event BorrowRowChangeEventHandler BorrowRowDeleting;
            
            public void AddBorrowRow(BorrowRow row) {
                this.Rows.Add(row);
            }
            
            public BorrowRow AddBorrowRow(string ReaderID, string ReaderName, string ReaderPhoneNo, string BookID, string BookName, string BookWriter, System.DateTime BorrowDate, System.DateTime ReturnDate) {
                BorrowRow rowBorrowRow = ((BorrowRow)(this.NewRow()));
                rowBorrowRow.ItemArray = new object[] {
                        ReaderID,
                        ReaderName,
                        ReaderPhoneNo,
                        BookID,
                        BookName,
                        BookWriter,
                        BorrowDate,
                        ReturnDate};
                this.Rows.Add(rowBorrowRow);
                return rowBorrowRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                BorrowDataTable cln = ((BorrowDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new BorrowDataTable();
            }
            
            internal void InitVars() {
                this.columnReaderID = this.Columns["ReaderID"];
                this.columnReaderName = this.Columns["ReaderName"];
                this.columnReaderPhoneNo = this.Columns["ReaderPhoneNo"];
                this.columnBookID = this.Columns["BookID"];
                this.columnBookName = this.Columns["BookName"];
                this.columnBookWriter = this.Columns["BookWriter"];
                this.columnBorrowDate = this.Columns["BorrowDate"];
                this.columnReturnDate = this.Columns["ReturnDate"];
            }
            
            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.columnReaderPhoneNo = new DataColumn("ReaderPhoneNo", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnReaderPhoneNo);
                this.columnBookID = new DataColumn("BookID", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnBookID);
                this.columnBookName = new DataColumn("BookName", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnBookName);
                this.columnBookWriter = new DataColumn("BookWriter", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnBookWriter);
                this.columnBorrowDate = new DataColumn("BorrowDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnBorrowDate);
                this.columnReturnDate = new DataColumn("ReturnDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnReturnDate);
                this.columnReaderID.AllowDBNull = false;
                this.columnBookID.AllowDBNull = false;
            }
            
            public BorrowRow NewBorrowRow() {
                return ((BorrowRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new BorrowRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(BorrowRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.BorrowRowChanged != null)) {
                    this.BorrowRowChanged(this, new BorrowRowChangeEvent(((BorrowRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.BorrowRowChanging != null)) {
                    this.BorrowRowChanging(this, new BorrowRowChangeEvent(((BorrowRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.BorrowRowDeleted != null)) {
                    this.BorrowRowDeleted(this, new BorrowRowChangeEvent(((BorrowRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.BorrowRowDeleting != null)) {
                    this.BorrowRowDeleting(this, new BorrowRowChangeEvent(((BorrowRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveBorrowRow(BorrowRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class BorrowRow : DataRow {
            
            private BorrowDataTable tableBorrow;
            
            internal BorrowRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableBorrow = ((BorrowDataTable)(this.Table));
            }
            
            public string ReaderID {
                get {
                    return ((string)(this[this.tableBorrow.ReaderIDColumn]));
                }
                set {
                    this[this.tableBorrow.ReaderIDColumn] = value;
                }
            }
            
            public string ReaderName {
                get {
                    try {
                        return ((string)(this[this.tableBorrow.ReaderNameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableBorrow.ReaderNameColumn] = value;
                }
            }
            
            public string ReaderPhoneNo {
                get {
                    try {
                        return ((string)(this[this.tableBorrow.ReaderPhoneNoColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableBorrow.ReaderPhoneNoColumn] = value;
                }
            }
            
            public string BookID {
                get {
                    return ((string)(this[this.tableBorrow.BookIDColumn]));
                }
                set {
                    this[this.tableBorrow.BookIDColumn] = value;
                }
            }
            
            public string BookName {
                get {
                    try {
                        return ((string)(this[this.tableBorrow.BookNameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableBorrow.BookNameColumn] = value;
                }
            }
            
            public string BookWriter {
                get {
                    try {

⌨️ 快捷键说明

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