📄 articlesds.cs
字号:
}
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.AllowDBNull = false;
this.columnFileName.AllowDBNull = false;
this.columnRating.ReadOnly = true;
this.columnStatus.ReadOnly = true;
this.columnAbstract.ReadOnly = true;
this.columnComments.ReadOnly = true;
}
public _TableRow New_TableRow() {
return ((_TableRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new _TableRow(builder);
}
protected override System.Type GetRowType() {
return typeof(_TableRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this._TableRowChanged != null)) {
this._TableRowChanged(this, new _TableRowChangeEvent(((_TableRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this._TableRowChanging != null)) {
this._TableRowChanging(this, new _TableRowChangeEvent(((_TableRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this._TableRowDeleted != null)) {
this._TableRowDeleted(this, new _TableRowChangeEvent(((_TableRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this._TableRowDeleting != null)) {
this._TableRowDeleting(this, new _TableRowChangeEvent(((_TableRow)(e.Row)), e.Action));
}
}
public void Remove_TableRow(_TableRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class _TableRow : DataRow {
private _TableDataTable table_Table;
internal _TableRow(DataRowBuilder rb) :
base(rb) {
this.table_Table = ((_TableDataTable)(this.Table));
}
public int ArticleID {
get {
return ((int)(this[this.table_Table.ArticleIDColumn]));
}
set {
this[this.table_Table.ArticleIDColumn] = value;
}
}
public string Category {
get {
return ((string)(this[this.table_Table.CategoryColumn]));
}
set {
this[this.table_Table.CategoryColumn] = value;
}
}
public string FileName {
get {
return ((string)(this[this.table_Table.FileNameColumn]));
}
set {
this[this.table_Table.FileNameColumn] = value;
}
}
public string Rating {
get {
try {
return ((string)(this[this.table_Table.RatingColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.table_Table.RatingColumn] = value;
}
}
public string Status {
get {
try {
return ((string)(this[this.table_Table.StatusColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.table_Table.StatusColumn] = value;
}
}
public string PostedBy {
get {
try {
return ((string)(this[this.table_Table.PostedByColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.table_Table.PostedByColumn] = value;
}
}
public string Abstract {
get {
try {
return ((string)(this[this.table_Table.AbstractColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.table_Table.AbstractColumn] = value;
}
}
public string Comments {
get {
try {
return ((string)(this[this.table_Table.CommentsColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.table_Table.CommentsColumn] = value;
}
}
public bool IsRatingNull() {
return this.IsNull(this.table_Table.RatingColumn);
}
public void SetRatingNull() {
this[this.table_Table.RatingColumn] = System.Convert.DBNull;
}
public bool IsStatusNull() {
return this.IsNull(this.table_Table.StatusColumn);
}
public void SetStatusNull() {
this[this.table_Table.StatusColumn] = System.Convert.DBNull;
}
public bool IsPostedByNull() {
return this.IsNull(this.table_Table.PostedByColumn);
}
public void SetPostedByNull() {
this[this.table_Table.PostedByColumn] = System.Convert.DBNull;
}
public bool IsAbstractNull() {
return this.IsNull(this.table_Table.AbstractColumn);
}
public void SetAbstractNull() {
this[this.table_Table.AbstractColumn] = System.Convert.DBNull;
}
public bool IsCommentsNull() {
return this.IsNull(this.table_Table.CommentsColumn);
}
public void SetCommentsNull() {
this[this.table_Table.CommentsColumn] = System.Convert.DBNull;
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class _TableRowChangeEvent : EventArgs {
private _TableRow eventRow;
private DataRowAction eventAction;
public _TableRowChangeEvent(_TableRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public _TableRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class CategoryDataTable : DataTable, System.Collections.IEnumerable {
private DataColumn columnCategory;
private DataColumn columnCategoryID;
internal CategoryDataTable() :
base("Category") {
this.InitClass();
}
internal CategoryDataTable(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 CategoryColumn {
get {
return this.columnCategory;
}
}
internal DataColumn CategoryIDColumn {
get {
return this.columnCategoryID;
}
}
public CategoryRow this[int index] {
get {
return ((CategoryRow)(this.Rows[index]));
}
}
public event CategoryRowChangeEventHandler CategoryRowChanged;
public event CategoryRowChangeEventHandler CategoryRowChanging;
public event CategoryRowChangeEventHandler CategoryRowDeleted;
public event CategoryRowChangeEventHandler CategoryRowDeleting;
public void AddCategoryRow(CategoryRow row) {
this.Rows.Add(row);
}
public CategoryRow AddCategoryRow(string Category, int CategoryID) {
CategoryRow rowCategoryRow = ((CategoryRow)(this.NewRow()));
rowCategoryRow.ItemArray = new object[] {
Category,
CategoryID};
this.Rows.Add(rowCategoryRow);
return rowCategoryRow;
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
CategoryDataTable cln = ((CategoryDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new CategoryDataTable();
}
internal void InitVars() {
this.columnCategory = this.Columns["Category"];
this.columnCategoryID = this.Columns["CategoryID"];
}
private void InitClass() {
this.columnCategory = new DataColumn("Category", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCategory);
this.columnCategoryID = new DataColumn("CategoryID", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCategoryID);
this.columnCategory.AllowDBNull = false;
this.columnCategoryID.AllowDBNull = false;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -