📄 articlesds.cs
字号:
}
internal DataColumn FileNameColumn {
get {
return this.columnFileName;
}
}
internal DataColumn RatingColumn {
get {
return this.columnRating;
}
}
internal DataColumn StatusColumn {
get {
return this.columnStatus;
}
}
internal DataColumn PostedByColumn {
get {
return this.columnPostedBy;
}
}
internal DataColumn AbstractColumn {
get {
return this.columnAbstract;
}
}
internal DataColumn CommentsColumn {
get {
return this.columnComments;
}
}
public ArticlesRow this[int index] {
get {
return ((ArticlesRow)(this.Rows[index]));
}
}
public event ArticlesRowChangeEventHandler ArticlesRowChanged;
public event ArticlesRowChangeEventHandler ArticlesRowChanging;
public event ArticlesRowChangeEventHandler ArticlesRowDeleted;
public event ArticlesRowChangeEventHandler ArticlesRowDeleting;
public void AddArticlesRow(ArticlesRow row) {
this.Rows.Add(row);
}
public ArticlesRow AddArticlesRow(int ArticleID, string Category, string FileName, string Rating, string Status, string PostedBy, string Abstract, string Comments) {
ArticlesRow rowArticlesRow = ((ArticlesRow)(this.NewRow()));
rowArticlesRow.ItemArray = new object[] {
ArticleID,
Category,
FileName,
Rating,
Status,
PostedBy,
Abstract,
Comments};
this.Rows.Add(rowArticlesRow);
return rowArticlesRow;
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
ArticlesDataTable cln = ((ArticlesDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new ArticlesDataTable();
}
internal void InitVars() {
this.columnArticleID = this.Columns["ArticleID"];
this.columnCategory = this.Columns["Category"];
this.columnFileName = this.Columns["FileName"];
this.columnRating = this.Columns["Rating"];
this.columnStatus = this.Columns["Status"];
this.columnPostedBy = this.Columns["PostedBy"];
this.columnAbstract = this.Columns["Abstract"];
this.columnComments = this.Columns["Comments"];
}
private void InitClass() {
this.columnArticleID = new DataColumn("ArticleID", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnArticleID);
this.columnCategory = new DataColumn("Category", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCategory);
this.columnFileName = new DataColumn("FileName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnFileName);
this.columnRating = new DataColumn("Rating", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnRating);
this.columnStatus = new DataColumn("Status", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnStatus);
this.columnPostedBy = new DataColumn("PostedBy", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnPostedBy);
this.columnAbstract = new DataColumn("Abstract", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnAbstract);
this.columnComments = new DataColumn("Comments", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnComments);
this.columnArticleID.AllowDBNull = false;
this.columnCategory.ReadOnly = true;
this.columnFileName.AllowDBNull = false;
this.columnRating.ReadOnly = true;
this.columnStatus.ReadOnly = true;
this.columnAbstract.ReadOnly = true;
this.columnComments.ReadOnly = true;
}
public ArticlesRow NewArticlesRow() {
return ((ArticlesRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new ArticlesRow(builder);
}
protected override System.Type GetRowType() {
return typeof(ArticlesRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.ArticlesRowChanged != null)) {
this.ArticlesRowChanged(this, new ArticlesRowChangeEvent(((ArticlesRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.ArticlesRowChanging != null)) {
this.ArticlesRowChanging(this, new ArticlesRowChangeEvent(((ArticlesRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.ArticlesRowDeleted != null)) {
this.ArticlesRowDeleted(this, new ArticlesRowChangeEvent(((ArticlesRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.ArticlesRowDeleting != null)) {
this.ArticlesRowDeleting(this, new ArticlesRowChangeEvent(((ArticlesRow)(e.Row)), e.Action));
}
}
public void RemoveArticlesRow(ArticlesRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class ArticlesRow : DataRow {
private ArticlesDataTable tableArticles;
internal ArticlesRow(DataRowBuilder rb) :
base(rb) {
this.tableArticles = ((ArticlesDataTable)(this.Table));
}
public int ArticleID {
get {
return ((int)(this[this.tableArticles.ArticleIDColumn]));
}
set {
this[this.tableArticles.ArticleIDColumn] = value;
}
}
public string Category {
get {
try {
return ((string)(this[this.tableArticles.CategoryColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableArticles.CategoryColumn] = value;
}
}
public string FileName {
get {
return ((string)(this[this.tableArticles.FileNameColumn]));
}
set {
this[this.tableArticles.FileNameColumn] = value;
}
}
public string Rating {
get {
try {
return ((string)(this[this.tableArticles.RatingColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableArticles.RatingColumn] = value;
}
}
public string Status {
get {
try {
return ((string)(this[this.tableArticles.StatusColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableArticles.StatusColumn] = value;
}
}
public string PostedBy {
get {
try {
return ((string)(this[this.tableArticles.PostedByColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableArticles.PostedByColumn] = value;
}
}
public string Abstract {
get {
try {
return ((string)(this[this.tableArticles.AbstractColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableArticles.AbstractColumn] = value;
}
}
public string Comments {
get {
try {
return ((string)(this[this.tableArticles.CommentsColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableArticles.CommentsColumn] = value;
}
}
public bool IsCategoryNull() {
return this.IsNull(this.tableArticles.CategoryColumn);
}
public void SetCategoryNull() {
this[this.tableArticles.CategoryColumn] = System.Convert.DBNull;
}
public bool IsRatingNull() {
return this.IsNull(this.tableArticles.RatingColumn);
}
public void SetRatingNull() {
this[this.tableArticles.RatingColumn] = System.Convert.DBNull;
}
public bool IsStatusNull() {
return this.IsNull(this.tableArticles.StatusColumn);
}
public void SetStatusNull() {
this[this.tableArticles.StatusColumn] = System.Convert.DBNull;
}
public bool IsPostedByNull() {
return this.IsNull(this.tableArticles.PostedByColumn);
}
public void SetPostedByNull() {
this[this.tableArticles.PostedByColumn] = System.Convert.DBNull;
}
public bool IsAbstractNull() {
return this.IsNull(this.tableArticles.AbstractColumn);
}
public void SetAbstractNull() {
this[this.tableArticles.AbstractColumn] = System.Convert.DBNull;
}
public bool IsCommentsNull() {
return this.IsNull(this.tableArticles.CommentsColumn);
}
public void SetCommentsNull() {
this[this.tableArticles.CommentsColumn] = System.Convert.DBNull;
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class ArticlesRowChangeEvent : EventArgs {
private ArticlesRow eventRow;
private DataRowAction eventAction;
public ArticlesRowChangeEvent(ArticlesRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public ArticlesRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -