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

📄 datasetquery.cs

📁 visualc#+sql图书出租管理系统
💻 CS
📖 第 1 页 / 共 5 页
字号:
                        return ((string)(this[this.tableBorrow.BookWriterColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableBorrow.BookWriterColumn] = value;
                }
            }
            
            public System.DateTime BorrowDate {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableBorrow.BorrowDateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableBorrow.BorrowDateColumn] = value;
                }
            }
            
            public System.DateTime ReturnDate {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableBorrow.ReturnDateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableBorrow.ReturnDateColumn] = value;
                }
            }
            
            public bool IsReaderNameNull() {
                return this.IsNull(this.tableBorrow.ReaderNameColumn);
            }
            
            public void SetReaderNameNull() {
                this[this.tableBorrow.ReaderNameColumn] = System.Convert.DBNull;
            }
            
            public bool IsReaderPhoneNoNull() {
                return this.IsNull(this.tableBorrow.ReaderPhoneNoColumn);
            }
            
            public void SetReaderPhoneNoNull() {
                this[this.tableBorrow.ReaderPhoneNoColumn] = System.Convert.DBNull;
            }
            
            public bool IsBookNameNull() {
                return this.IsNull(this.tableBorrow.BookNameColumn);
            }
            
            public void SetBookNameNull() {
                this[this.tableBorrow.BookNameColumn] = System.Convert.DBNull;
            }
            
            public bool IsBookWriterNull() {
                return this.IsNull(this.tableBorrow.BookWriterColumn);
            }
            
            public void SetBookWriterNull() {
                this[this.tableBorrow.BookWriterColumn] = System.Convert.DBNull;
            }
            
            public bool IsBorrowDateNull() {
                return this.IsNull(this.tableBorrow.BorrowDateColumn);
            }
            
            public void SetBorrowDateNull() {
                this[this.tableBorrow.BorrowDateColumn] = System.Convert.DBNull;
            }
            
            public bool IsReturnDateNull() {
                return this.IsNull(this.tableBorrow.ReturnDateColumn);
            }
            
            public void SetReturnDateNull() {
                this[this.tableBorrow.ReturnDateColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class BorrowRowChangeEvent : EventArgs {
            
            private BorrowRow eventRow;
            
            private DataRowAction eventAction;
            
            public BorrowRowChangeEvent(BorrowRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public BorrowRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class PublishCompanyDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnPublishName;
            
            private DataColumn columnPublishAddress;
            
            private DataColumn columnPublishPhoneNo;
            
            private DataColumn columnPbulishEmail;
            
            internal PublishCompanyDataTable() : 
                    base("PublishCompany") {
                this.InitClass();
            }
            
            internal PublishCompanyDataTable(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 PublishNameColumn {
                get {
                    return this.columnPublishName;
                }
            }
            
            internal DataColumn PublishAddressColumn {
                get {
                    return this.columnPublishAddress;
                }
            }
            
            internal DataColumn PublishPhoneNoColumn {
                get {
                    return this.columnPublishPhoneNo;
                }
            }
            
            internal DataColumn PbulishEmailColumn {
                get {
                    return this.columnPbulishEmail;
                }
            }
            
            public PublishCompanyRow this[int index] {
                get {
                    return ((PublishCompanyRow)(this.Rows[index]));
                }
            }
            
            public event PublishCompanyRowChangeEventHandler PublishCompanyRowChanged;
            
            public event PublishCompanyRowChangeEventHandler PublishCompanyRowChanging;
            
            public event PublishCompanyRowChangeEventHandler PublishCompanyRowDeleted;
            
            public event PublishCompanyRowChangeEventHandler PublishCompanyRowDeleting;
            
            public void AddPublishCompanyRow(PublishCompanyRow row) {
                this.Rows.Add(row);
            }
            
            public PublishCompanyRow AddPublishCompanyRow(string PublishName, string PublishAddress, string PublishPhoneNo, string PbulishEmail) {
                PublishCompanyRow rowPublishCompanyRow = ((PublishCompanyRow)(this.NewRow()));
                rowPublishCompanyRow.ItemArray = new object[] {
                        PublishName,
                        PublishAddress,
                        PublishPhoneNo,
                        PbulishEmail};
                this.Rows.Add(rowPublishCompanyRow);
                return rowPublishCompanyRow;
            }
            
            public PublishCompanyRow FindByPublishName(string PublishName) {
                return ((PublishCompanyRow)(this.Rows.Find(new object[] {
                            PublishName})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                PublishCompanyDataTable cln = ((PublishCompanyDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new PublishCompanyDataTable();
            }
            
            internal void InitVars() {
                this.columnPublishName = this.Columns["PublishName"];
                this.columnPublishAddress = this.Columns["PublishAddress"];
                this.columnPublishPhoneNo = this.Columns["PublishPhoneNo"];
                this.columnPbulishEmail = this.Columns["PbulishEmail"];
            }
            
            private void InitClass() {
                this.columnPublishName = new DataColumn("PublishName", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnPublishName);
                this.columnPublishAddress = new DataColumn("PublishAddress", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnPublishAddress);
                this.columnPublishPhoneNo = new DataColumn("PublishPhoneNo", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnPublishPhoneNo);
                this.columnPbulishEmail = new DataColumn("PbulishEmail", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnPbulishEmail);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnPublishName}, true));
                this.columnPublishName.AllowDBNull = false;
                this.columnPublishName.Unique = true;
            }
            
            public PublishCompanyRow NewPublishCompanyRow() {
                return ((PublishCompanyRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new PublishCompanyRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(PublishCompanyRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.PublishCompanyRowChanged != null)) {
                    this.PublishCompanyRowChanged(this, new PublishCompanyRowChangeEvent(((PublishCompanyRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.PublishCompanyRowChanging != null)) {
                    this.PublishCompanyRowChanging(this, new PublishCompanyRowChangeEvent(((PublishCompanyRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.PublishCompanyRowDeleted != null)) {
                    this.PublishCompanyRowDeleted(this, new PublishCompanyRowChangeEvent(((PublishCompanyRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.PublishCompanyRowDeleting != null)) {
                    this.PublishCompanyRowDeleting(this, new PublishCompanyRowChangeEvent(((PublishCompanyRow)(e.Row)), e.Action));
                }
            }
            
            public void RemovePublishCompanyRow(PublishCompanyRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class PublishCompanyRow : DataRow {
            
            private PublishCompanyDataTable tablePublishCompany;
            
            internal PublishCompanyRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tablePublishCompany = ((PublishCompanyDataTable)(this.Table));
            }
            
            public string PublishName {
                get {
                    return ((string)(this[this.tablePublishCompany.PublishNameColumn]));
                }
                set {
                    this[this.tablePublishCompany.PublishNameColumn] = value;
                }
            }
            
            public string PublishAddress {
                get {
                    try {
                        return ((string)(this[this.tablePublishCompany.PublishAddressColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tablePublishCompany.PublishAddressColumn] = value;
                }
            }

⌨️ 快捷键说明

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