📄 datasetbook.cs
字号:
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);
}
public void SetBookRemainNull() {
this[this.tableBook.BookRemainColumn] = System.Convert.DBNull;
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class BookRowChangeEvent : EventArgs {
private BookRow eventRow;
private DataRowAction eventAction;
public BookRowChangeEvent(BookRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public BookRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -