?? datasetquery.cs
字號:
return ((BookRow)(this.Rows[index]));
}
}
public event BookRowChangeEventHandler BookRowChanged;
public event BookRowChangeEventHandler BookRowChanging;
public event BookRowChangeEventHandler BookRowDeleted;
public event BookRowChangeEventHandler BookRowDeleting;
public void AddBookRow(BookRow row) {
this.Rows.Add(row);
}
public BookRow AddBookRow(string BookID, string BookName, string BookWriter, string BookPublish, System.DateTime BookPublishDate, System.Double BookPrice, string BookSort, int BookAmount, int BookRemain) {
BookRow rowBookRow = ((BookRow)(this.NewRow()));
rowBookRow.ItemArray = new object[] {
BookID,
BookName,
BookWriter,
BookPublish,
BookPublishDate,
BookPrice,
BookSort,
BookAmount,
BookRemain};
this.Rows.Add(rowBookRow);
return rowBookRow;
}
public BookRow FindByBookID(string BookID) {
return ((BookRow)(this.Rows.Find(new object[] {
BookID})));
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
BookDataTable cln = ((BookDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new BookDataTable();
}
internal void InitVars() {
this.columnBookID = this.Columns["BookID"];
this.columnBookName = this.Columns["BookName"];
this.columnBookWriter = this.Columns["BookWriter"];
this.columnBookPublish = this.Columns["BookPublish"];
this.columnBookPublishDate = this.Columns["BookPublishDate"];
this.columnBookPrice = this.Columns["BookPrice"];
this.columnBookSort = this.Columns["BookSort"];
this.columnBookAmount = this.Columns["BookAmount"];
this.columnBookRemain = this.Columns["BookRemain"];
}
private void InitClass() {
this.columnBookID = new DataColumn("BookID", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBookID);
this.columnBookName = new DataColumn("BookName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBookName);
this.columnBookWriter = new DataColumn("BookWriter", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBookWriter);
this.columnBookPublish = new DataColumn("BookPublish", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBookPublish);
this.columnBookPublishDate = new DataColumn("BookPublishDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBookPublishDate);
this.columnBookPrice = new DataColumn("BookPrice", typeof(System.Double), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBookPrice);
this.columnBookSort = new DataColumn("BookSort", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBookSort);
this.columnBookAmount = new DataColumn("BookAmount", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBookAmount);
this.columnBookRemain = new DataColumn("BookRemain", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnBookRemain);
this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
this.columnBookID}, true));
this.columnBookID.AllowDBNull = false;
this.columnBookID.Unique = true;
}
public BookRow NewBookRow() {
return ((BookRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new BookRow(builder);
}
protected override System.Type GetRowType() {
return typeof(BookRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.BookRowChanged != null)) {
this.BookRowChanged(this, new BookRowChangeEvent(((BookRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.BookRowChanging != null)) {
this.BookRowChanging(this, new BookRowChangeEvent(((BookRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.BookRowDeleted != null)) {
this.BookRowDeleted(this, new BookRowChangeEvent(((BookRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.BookRowDeleting != null)) {
this.BookRowDeleting(this, new BookRowChangeEvent(((BookRow)(e.Row)), e.Action));
}
}
public void RemoveBookRow(BookRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class BookRow : DataRow {
private BookDataTable tableBook;
internal BookRow(DataRowBuilder rb) :
base(rb) {
this.tableBook = ((BookDataTable)(this.Table));
}
public string BookID {
get {
return ((string)(this[this.tableBook.BookIDColumn]));
}
set {
this[this.tableBook.BookIDColumn] = value;
}
}
public string BookName {
get {
try {
return ((string)(this[this.tableBook.BookNameColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("無法獲取值,因為它是 DBNull。", e);
}
}
set {
this[this.tableBook.BookNameColumn] = value;
}
}
public string BookWriter {
get {
try {
return ((string)(this[this.tableBook.BookWriterColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("無法獲取值,因為它是 DBNull。", e);
}
}
set {
this[this.tableBook.BookWriterColumn] = value;
}
}
public string BookPublish {
get {
try {
return ((string)(this[this.tableBook.BookPublishColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("無法獲取值,因為它是 DBNull。", e);
}
}
set {
this[this.tableBook.BookPublishColumn] = value;
}
}
public System.DateTime BookPublishDate {
get {
try {
return ((System.DateTime)(this[this.tableBook.BookPublishDateColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("無法獲取值,因為它是 DBNull。", e);
}
}
set {
this[this.tableBook.BookPublishDateColumn] = value;
}
}
public System.Double BookPrice {
get {
try {
return ((System.Double)(this[this.tableBook.BookPriceColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("無法獲取值,因為它是 DBNull。", e);
}
}
set {
this[this.tableBook.BookPriceColumn] = value;
}
}
public string BookSort {
get {
try {
return ((string)(this[this.tableBook.BookSortColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("無法獲取值,因為它是 DBNull。", e);
}
}
set {
this[this.tableBook.BookSortColumn] = value;
}
}
public int BookAmount {
get {
try {
return ((int)(this[this.tableBook.BookAmountColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("無法獲取值,因為它是 DBNull。", e);
}
}
set {
this[this.tableBook.BookAmountColumn] = value;
}
}
public int BookRemain {
get {
try {
return ((int)(this[this.tableBook.BookRemainColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("無法獲取值,因為它是 DBNull。", e);
}
}
set {
this[this.tableBook.BookRemainColumn] = value;
}
}
public bool IsBookNameNull() {
return this.IsNull(this.tableBook.BookNameColumn);
}
public void SetBookNameNull() {
this[this.tableBook.BookNameColumn] = System.Convert.DBNull;
}
public bool IsBookWriterNull() {
return this.IsNull(this.tableBook.BookWriterColumn);
}
public void SetBookWriterNull() {
this[this.tableBook.BookWriterColumn] = System.Convert.DBNull;
}
public bool IsBookPublishNull() {
return this.IsNull(this.tableBook.BookPublishColumn);
}
public void SetBookPublishNull() {
this[this.tableBook.BookPublishColumn] = System.Convert.DBNull;
}
public bool IsBookPublishDateNull() {
return this.IsNull(this.tableBook.BookPublishDateColumn);
}
public void SetBookPublishDateNull() {
this[this.tableBook.BookPublishDateColumn] = System.Convert.DBNull;
}
public bool IsBookPriceNull() {
return this.IsNull(this.tableBook.BookPriceColumn);
}
public void SetBookPriceNull() {
this[this.tableBook.BookPriceColumn] = System.Convert.DBNull;
}
public bool IsBookSortNull() {
return this.IsNull(this.tableBook.BookSortColumn);
}
public void SetBookSortNull() {
this[this.tableBook.BookSortColumn] = System.Convert.DBNull;
}
public bool IsBookAmountNull() {
return this.IsNull(this.tableBook.BookAmountColumn);
}
public void SetBookAmountNull() {
this[this.tableBook.BookAmountColumn] = System.Convert.DBNull;
}
public bool IsBookRemainNull() {
return this.IsNull(this.tableBook.BookRemainColumn);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -