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

📄 articledata.cs

📁 会员管理系统
💻 CS
📖 第 1 页 / 共 3 页
字号:
            
            public event ArticleInfoRowChangeEventHandler ArticleInfoRowDeleting;
            
            public void AddArticleInfoRow(ArticleInfoRow row) {
                this.Rows.Add(row);
            }
            
            public ArticleInfoRow AddArticleInfoRow(string ArticleID, string Title, string Abstract, int Size, System.DateTime RefDate, string URL) {
                ArticleInfoRow rowArticleInfoRow = ((ArticleInfoRow)(this.NewRow()));
                rowArticleInfoRow.ItemArray = new object[] {
                        ArticleID,
                        Title,
                        Abstract,
                        Size,
                        RefDate,
                        URL};
                this.Rows.Add(rowArticleInfoRow);
                return rowArticleInfoRow;
            }
            
            public ArticleInfoRow FindByArticleID(string ArticleID) {
                return ((ArticleInfoRow)(this.Rows.Find(new object[] {
                            ArticleID})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                ArticleInfoDataTable cln = ((ArticleInfoDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new ArticleInfoDataTable();
            }
            
            internal void InitVars() {
                this.columnArticleID = this.Columns["ArticleID"];
                this.columnTitle = this.Columns["Title"];
                this.columnAbstract = this.Columns["Abstract"];
                this.columnSize = this.Columns["Size"];
                this.columnRefDate = this.Columns["RefDate"];
                this.columnURL = this.Columns["URL"];
            }
            
            private void InitClass() {
                this.columnArticleID = new DataColumn("ArticleID", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnArticleID);
                this.columnTitle = new DataColumn("Title", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnTitle);
                this.columnAbstract = new DataColumn("Abstract", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnAbstract);
                this.columnSize = new DataColumn("Size", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnSize);
                this.columnRefDate = new DataColumn("RefDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnRefDate);
                this.columnURL = new DataColumn("URL", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnURL);
                this.Constraints.Add(new UniqueConstraint("ArticleDataKey1", new DataColumn[] {
                                this.columnArticleID}, true));
                this.columnArticleID.AllowDBNull = false;
                this.columnArticleID.Unique = true;
            }
            
            public ArticleInfoRow NewArticleInfoRow() {
                return ((ArticleInfoRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new ArticleInfoRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(ArticleInfoRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.ArticleInfoRowChanged != null)) {
                    this.ArticleInfoRowChanged(this, new ArticleInfoRowChangeEvent(((ArticleInfoRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.ArticleInfoRowChanging != null)) {
                    this.ArticleInfoRowChanging(this, new ArticleInfoRowChangeEvent(((ArticleInfoRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.ArticleInfoRowDeleted != null)) {
                    this.ArticleInfoRowDeleted(this, new ArticleInfoRowChangeEvent(((ArticleInfoRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.ArticleInfoRowDeleting != null)) {
                    this.ArticleInfoRowDeleting(this, new ArticleInfoRowChangeEvent(((ArticleInfoRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveArticleInfoRow(ArticleInfoRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ArticleInfoRow : DataRow {
            
            private ArticleInfoDataTable tableArticleInfo;
            
            internal ArticleInfoRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableArticleInfo = ((ArticleInfoDataTable)(this.Table));
            }
            
            public string ArticleID {
                get {
                    return ((string)(this[this.tableArticleInfo.ArticleIDColumn]));
                }
                set {
                    this[this.tableArticleInfo.ArticleIDColumn] = value;
                }
            }
            
            public string Title {
                get {
                    try {
                        return ((string)(this[this.tableArticleInfo.TitleColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableArticleInfo.TitleColumn] = value;
                }
            }
            
            public string Abstract {
                get {
                    try {
                        return ((string)(this[this.tableArticleInfo.AbstractColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableArticleInfo.AbstractColumn] = value;
                }
            }
            
            public int Size {
                get {
                    try {
                        return ((int)(this[this.tableArticleInfo.SizeColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableArticleInfo.SizeColumn] = value;
                }
            }
            
            public System.DateTime RefDate {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableArticleInfo.RefDateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableArticleInfo.RefDateColumn] = value;
                }
            }
            
            public string URL {
                get {
                    try {
                        return ((string)(this[this.tableArticleInfo.URLColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableArticleInfo.URLColumn] = value;
                }
            }
            
            public bool IsTitleNull() {
                return this.IsNull(this.tableArticleInfo.TitleColumn);
            }
            
            public void SetTitleNull() {
                this[this.tableArticleInfo.TitleColumn] = System.Convert.DBNull;
            }
            
            public bool IsAbstractNull() {
                return this.IsNull(this.tableArticleInfo.AbstractColumn);
            }
            
            public void SetAbstractNull() {
                this[this.tableArticleInfo.AbstractColumn] = System.Convert.DBNull;
            }
            
            public bool IsSizeNull() {
                return this.IsNull(this.tableArticleInfo.SizeColumn);
            }
            
            public void SetSizeNull() {
                this[this.tableArticleInfo.SizeColumn] = System.Convert.DBNull;
            }
            
            public bool IsRefDateNull() {
                return this.IsNull(this.tableArticleInfo.RefDateColumn);
            }
            
            public void SetRefDateNull() {
                this[this.tableArticleInfo.RefDateColumn] = System.Convert.DBNull;
            }
            
            public bool IsURLNull() {
                return this.IsNull(this.tableArticleInfo.URLColumn);
            }
            
            public void SetURLNull() {
                this[this.tableArticleInfo.URLColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ArticleInfoRowChangeEvent : EventArgs {
            
            private ArticleInfoRow eventRow;
            
            private DataRowAction eventAction;
            
            public ArticleInfoRowChangeEvent(ArticleInfoRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;

⌨️ 快捷键说明

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