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

📄 dataset4.cs

📁 学生选课系统 可工学生学习用!大家可以互相学习互相借鉴
💻 CS
📖 第 1 页 / 共 3 页
字号:
                    return ((int)(this[this.tableStudentInfo.IDColumn]));
                }
                set {
                    this[this.tableStudentInfo.IDColumn] = value;
                }
            }
            
            public string name {
                get {
                    try {
                        return ((string)(this[this.tableStudentInfo.nameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableStudentInfo.nameColumn] = value;
                }
            }
            
            public System.Double Credit {
                get {
                    try {
                        return ((System.Double)(this[this.tableStudentInfo.CreditColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableStudentInfo.CreditColumn] = value;
                }
            }
            
            public bool IsnameNull() {
                return this.IsNull(this.tableStudentInfo.nameColumn);
            }
            
            public void SetnameNull() {
                this[this.tableStudentInfo.nameColumn] = System.Convert.DBNull;
            }
            
            public bool IsCreditNull() {
                return this.IsNull(this.tableStudentInfo.CreditColumn);
            }
            
            public void SetCreditNull() {
                this[this.tableStudentInfo.CreditColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class StudentInfoRowChangeEvent : EventArgs {
            
            private StudentInfoRow eventRow;
            
            private DataRowAction eventAction;
            
            public StudentInfoRowChangeEvent(StudentInfoRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public StudentInfoRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CourseInfoDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnCourseName;
            
            private DataColumn columnCredit;
            
            private DataColumn columnCapacity;
            
            private DataColumn columnTeacher;
            
            private DataColumn columnCourseID;
            
            internal CourseInfoDataTable() : 
                    base("CourseInfo") {
                this.InitClass();
            }
            
            internal CourseInfoDataTable(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 CourseNameColumn {
                get {
                    return this.columnCourseName;
                }
            }
            
            internal DataColumn CreditColumn {
                get {
                    return this.columnCredit;
                }
            }
            
            internal DataColumn CapacityColumn {
                get {
                    return this.columnCapacity;
                }
            }
            
            internal DataColumn TeacherColumn {
                get {
                    return this.columnTeacher;
                }
            }
            
            internal DataColumn CourseIDColumn {
                get {
                    return this.columnCourseID;
                }
            }
            
            public CourseInfoRow this[int index] {
                get {
                    return ((CourseInfoRow)(this.Rows[index]));
                }
            }
            
            public event CourseInfoRowChangeEventHandler CourseInfoRowChanged;
            
            public event CourseInfoRowChangeEventHandler CourseInfoRowChanging;
            
            public event CourseInfoRowChangeEventHandler CourseInfoRowDeleted;
            
            public event CourseInfoRowChangeEventHandler CourseInfoRowDeleting;
            
            public void AddCourseInfoRow(CourseInfoRow row) {
                this.Rows.Add(row);
            }
            
            public CourseInfoRow AddCourseInfoRow(string CourseName, System.Double Credit, int Capacity, string Teacher, int CourseID) {
                CourseInfoRow rowCourseInfoRow = ((CourseInfoRow)(this.NewRow()));
                rowCourseInfoRow.ItemArray = new object[] {
                        CourseName,
                        Credit,
                        Capacity,
                        Teacher,
                        CourseID};
                this.Rows.Add(rowCourseInfoRow);
                return rowCourseInfoRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                CourseInfoDataTable cln = ((CourseInfoDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new CourseInfoDataTable();
            }
            
            internal void InitVars() {
                this.columnCourseName = this.Columns["CourseName"];
                this.columnCredit = this.Columns["Credit"];
                this.columnCapacity = this.Columns["Capacity"];
                this.columnTeacher = this.Columns["Teacher"];
                this.columnCourseID = this.Columns["CourseID"];
            }
            
            private void InitClass() {
                this.columnCourseName = new DataColumn("CourseName", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCourseName);
                this.columnCredit = new DataColumn("Credit", typeof(System.Double), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCredit);
                this.columnCapacity = new DataColumn("Capacity", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCapacity);
                this.columnTeacher = new DataColumn("Teacher", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnTeacher);
                this.columnCourseID = new DataColumn("CourseID", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCourseID);
                this.columnCourseID.AllowDBNull = false;
            }
            
            public CourseInfoRow NewCourseInfoRow() {
                return ((CourseInfoRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new CourseInfoRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(CourseInfoRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.CourseInfoRowChanged != null)) {
                    this.CourseInfoRowChanged(this, new CourseInfoRowChangeEvent(((CourseInfoRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.CourseInfoRowChanging != null)) {
                    this.CourseInfoRowChanging(this, new CourseInfoRowChangeEvent(((CourseInfoRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.CourseInfoRowDeleted != null)) {
                    this.CourseInfoRowDeleted(this, new CourseInfoRowChangeEvent(((CourseInfoRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.CourseInfoRowDeleting != null)) {
                    this.CourseInfoRowDeleting(this, new CourseInfoRowChangeEvent(((CourseInfoRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveCourseInfoRow(CourseInfoRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CourseInfoRow : DataRow {
            
            private CourseInfoDataTable tableCourseInfo;
            
            internal CourseInfoRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableCourseInfo = ((CourseInfoDataTable)(this.Table));
            }
            
            public string CourseName {
                get {
                    try {
                        return ((string)(this[this.tableCourseInfo.CourseNameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCourseInfo.CourseNameColumn] = value;
                }
            }
            
            public System.Double Credit {
                get {
                    try {
                        return ((System.Double)(this[this.tableCourseInfo.CreditColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCourseInfo.CreditColumn] = value;
                }
            }
            
            public int Capacity {
                get {
                    try {
                        return ((int)(this[this.tableCourseInfo.CapacityColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCourseInfo.CapacityColumn] = value;
                }
            }
            
            public string Teacher {
                get {
                    try {
                        return ((string)(this[this.tableCourseInfo.TeacherColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCourseInfo.TeacherColumn] = value;
                }
            }
            
            public int CourseID {
                get {
                    return ((int)(this[this.tableCourseInfo.CourseIDColumn]));
                }
                set {
                    this[this.tableCourseInfo.CourseIDColumn] = value;
                }
            }
            
            public bool IsCourseNameNull() {
                return this.IsNull(this.tableCourseInfo.CourseNameColumn);
            }
            
            public void SetCourseNameNull() {
                this[this.tableCourseInfo.CourseNameColumn] = System.Convert.DBNull;
            }
            
            public bool IsCreditNull() {
                return this.IsNull(this.tableCourseInfo.CreditColumn);
            }
            
            public void SetCreditNull() {
                this[this.tableCourseInfo.CreditColumn] = System.Convert.DBNull;
            }
            
            public bool IsCapacityNull() {
                return this.IsNull(this.tableCourseInfo.CapacityColumn);
            }
            
            public void SetCapacityNull() {
                this[this.tableCourseInfo.CapacityColumn] = System.Convert.DBNull;
            }
            
            public bool IsTeacherNull() {
                return this.IsNull(this.tableCourseInfo.TeacherColumn);
            }

⌨️ 快捷键说明

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