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

📄 datasetborrowreturn.cs

📁 visualc#+sql图书出租管理系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
                BorrowBookRow rowBorrowBookRow = ((BorrowBookRow)(this.NewRow()));
                rowBorrowBookRow.ItemArray = new object[] {
                        ReaderID,
                        BookID,
                        BorrowDate,
                        ReturnDate,
                        FactReturnDate};
                this.Rows.Add(rowBorrowBookRow);
                return rowBorrowBookRow;
            }
            
            public BorrowBookRow FindByReaderIDBookID(string ReaderID, string BookID) {
                return ((BorrowBookRow)(this.Rows.Find(new object[] {
                            ReaderID,
                            BookID})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                BorrowBookDataTable cln = ((BorrowBookDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new BorrowBookDataTable();
            }
            
            internal void InitVars() {
                this.columnReaderID = this.Columns["ReaderID"];
                this.columnBookID = this.Columns["BookID"];
                this.columnBorrowDate = this.Columns["BorrowDate"];
                this.columnReturnDate = this.Columns["ReturnDate"];
                this.columnFactReturnDate = this.Columns["FactReturnDate"];
            }
            
            private void InitClass() {
                this.columnReaderID = new DataColumn("ReaderID", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnReaderID);
                this.columnBookID = new DataColumn("BookID", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnBookID);
                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.columnFactReturnDate = new DataColumn("FactReturnDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnFactReturnDate);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnReaderID,
                                this.columnBookID}, true));
                this.columnReaderID.AllowDBNull = false;
                this.columnBookID.AllowDBNull = false;
            }
            
            public BorrowBookRow NewBorrowBookRow() {
                return ((BorrowBookRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new BorrowBookRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(BorrowBookRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.BorrowBookRowChanged != null)) {
                    this.BorrowBookRowChanged(this, new BorrowBookRowChangeEvent(((BorrowBookRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.BorrowBookRowChanging != null)) {
                    this.BorrowBookRowChanging(this, new BorrowBookRowChangeEvent(((BorrowBookRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.BorrowBookRowDeleted != null)) {
                    this.BorrowBookRowDeleted(this, new BorrowBookRowChangeEvent(((BorrowBookRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.BorrowBookRowDeleting != null)) {
                    this.BorrowBookRowDeleting(this, new BorrowBookRowChangeEvent(((BorrowBookRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveBorrowBookRow(BorrowBookRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class BorrowBookRow : DataRow {
            
            private BorrowBookDataTable tableBorrowBook;
            
            internal BorrowBookRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableBorrowBook = ((BorrowBookDataTable)(this.Table));
            }
            
            public string ReaderID {
                get {
                    return ((string)(this[this.tableBorrowBook.ReaderIDColumn]));
                }
                set {
                    this[this.tableBorrowBook.ReaderIDColumn] = value;
                }
            }
            
            public string BookID {
                get {
                    return ((string)(this[this.tableBorrowBook.BookIDColumn]));
                }
                set {
                    this[this.tableBorrowBook.BookIDColumn] = value;
                }
            }
            
            public System.DateTime BorrowDate {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableBorrowBook.BorrowDateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableBorrowBook.BorrowDateColumn] = value;
                }
            }
            
            public System.DateTime ReturnDate {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableBorrowBook.ReturnDateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableBorrowBook.ReturnDateColumn] = value;
                }
            }
            
            public System.DateTime FactReturnDate {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableBorrowBook.FactReturnDateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableBorrowBook.FactReturnDateColumn] = value;
                }
            }
            
            public bool IsBorrowDateNull() {
                return this.IsNull(this.tableBorrowBook.BorrowDateColumn);
            }
            
            public void SetBorrowDateNull() {
                this[this.tableBorrowBook.BorrowDateColumn] = System.Convert.DBNull;
            }
            
            public bool IsReturnDateNull() {
                return this.IsNull(this.tableBorrowBook.ReturnDateColumn);
            }
            
            public void SetReturnDateNull() {
                this[this.tableBorrowBook.ReturnDateColumn] = System.Convert.DBNull;
            }
            
            public bool IsFactReturnDateNull() {
                return this.IsNull(this.tableBorrowBook.FactReturnDateColumn);
            }
            
            public void SetFactReturnDateNull() {
                this[this.tableBorrowBook.FactReturnDateColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class BorrowBookRowChangeEvent : EventArgs {
            
            private BorrowBookRow eventRow;
            
            private DataRowAction eventAction;
            
            public BorrowBookRowChangeEvent(BorrowBookRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public BorrowBookRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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