📄 flight.cs
字号:
internal DataColumn PriceColumn {
get {
return this.columnPrice;
}
}
internal DataColumn DiscountColumn {
get {
return this.columnDiscount;
}
}
internal DataColumn FlightId_0Column {
get {
return this.columnFlightId_0;
}
}
public CabinRow this[int index] {
get {
return ((CabinRow)(this.Rows[index]));
}
}
public event CabinRowChangeEventHandler CabinRowChanged;
public event CabinRowChangeEventHandler CabinRowChanging;
public event CabinRowChangeEventHandler CabinRowDeleted;
public event CabinRowChangeEventHandler CabinRowDeleting;
public void AddCabinRow(CabinRow row) {
this.Rows.Add(row);
}
public CabinRow AddCabinRow(string CabinName, FlightRow parentFlightRowByFlightCabin, int RemainTickets, string Type, System.Decimal Price, System.Double Discount, FlightRow parentFlightRowByFlight_Cabin) {
CabinRow rowCabinRow = ((CabinRow)(this.NewRow()));
rowCabinRow.ItemArray = new object[] {
null,
CabinName,
parentFlightRowByFlightCabin[0],
RemainTickets,
Type,
Price,
Discount,
parentFlightRowByFlight_Cabin[0]};
this.Rows.Add(rowCabinRow);
return rowCabinRow;
}
public CabinRow FindByCabinId(int CabinId) {
return ((CabinRow)(this.Rows.Find(new object[] {
CabinId})));
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
CabinDataTable cln = ((CabinDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new CabinDataTable();
}
internal void InitVars() {
this.columnCabinId = this.Columns["CabinId"];
this.columnCabinName = this.Columns["CabinName"];
this.columnFlightId = this.Columns["FlightId"];
this.columnRemainTickets = this.Columns["RemainTickets"];
this.columnType = this.Columns["Type"];
this.columnPrice = this.Columns["Price"];
this.columnDiscount = this.Columns["Discount"];
this.columnFlightId_0 = this.Columns["FlightId_0"];
}
private void InitClass() {
this.columnCabinId = new DataColumn("CabinId", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCabinId);
this.columnCabinName = new DataColumn("CabinName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnCabinName);
this.columnFlightId = new DataColumn("FlightId", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnFlightId);
this.columnRemainTickets = new DataColumn("RemainTickets", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnRemainTickets);
this.columnType = new DataColumn("Type", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnType);
this.columnPrice = new DataColumn("Price", typeof(System.Decimal), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnPrice);
this.columnDiscount = new DataColumn("Discount", typeof(System.Double), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnDiscount);
this.columnFlightId_0 = new DataColumn("FlightId_0", typeof(int), null, System.Data.MappingType.Hidden);
this.Columns.Add(this.columnFlightId_0);
this.Constraints.Add(new UniqueConstraint("FlightDataKey2", new DataColumn[] {
this.columnCabinId}, true));
this.columnCabinId.AutoIncrement = true;
this.columnCabinId.AllowDBNull = false;
this.columnCabinId.ReadOnly = true;
this.columnCabinId.Unique = true;
this.columnCabinName.AllowDBNull = false;
this.columnFlightId.AllowDBNull = false;
this.columnRemainTickets.AllowDBNull = false;
this.columnType.AllowDBNull = false;
this.columnPrice.AllowDBNull = false;
}
public CabinRow NewCabinRow() {
return ((CabinRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new CabinRow(builder);
}
protected override System.Type GetRowType() {
return typeof(CabinRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.CabinRowChanged != null)) {
this.CabinRowChanged(this, new CabinRowChangeEvent(((CabinRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.CabinRowChanging != null)) {
this.CabinRowChanging(this, new CabinRowChangeEvent(((CabinRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.CabinRowDeleted != null)) {
this.CabinRowDeleted(this, new CabinRowChangeEvent(((CabinRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.CabinRowDeleting != null)) {
this.CabinRowDeleting(this, new CabinRowChangeEvent(((CabinRow)(e.Row)), e.Action));
}
}
public void RemoveCabinRow(CabinRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class CabinRow : DataRow {
private CabinDataTable tableCabin;
internal CabinRow(DataRowBuilder rb) :
base(rb) {
this.tableCabin = ((CabinDataTable)(this.Table));
}
public int CabinId {
get {
return ((int)(this[this.tableCabin.CabinIdColumn]));
}
set {
this[this.tableCabin.CabinIdColumn] = value;
}
}
public string CabinName {
get {
return ((string)(this[this.tableCabin.CabinNameColumn]));
}
set {
this[this.tableCabin.CabinNameColumn] = value;
}
}
public int FlightId {
get {
return ((int)(this[this.tableCabin.FlightIdColumn]));
}
set {
this[this.tableCabin.FlightIdColumn] = value;
}
}
public int RemainTickets {
get {
return ((int)(this[this.tableCabin.RemainTicketsColumn]));
}
set {
this[this.tableCabin.RemainTicketsColumn] = value;
}
}
public string Type {
get {
return ((string)(this[this.tableCabin.TypeColumn]));
}
set {
this[this.tableCabin.TypeColumn] = value;
}
}
public System.Decimal Price {
get {
return ((System.Decimal)(this[this.tableCabin.PriceColumn]));
}
set {
this[this.tableCabin.PriceColumn] = value;
}
}
public System.Double Discount {
get {
try {
return ((System.Double)(this[this.tableCabin.DiscountColumn]));
}
catch (InvalidCastException e) {
return 10;
}
}
set {
this[this.tableCabin.DiscountColumn] = value;
}
}
public FlightRow FlightRowByFlight_Cabin {
get {
return ((FlightRow)(this.GetParentRow(this.Table.ParentRelations["Flight_Cabin"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["Flight_Cabin"]);
}
}
public FlightRow FlightRowByFlightCabin {
get {
return ((FlightRow)(this.GetParentRow(this.Table.ParentRelations["FlightCabin"])));
}
set {
this.SetParentRow(value, this.Table.ParentRelations["FlightCabin"]);
}
}
public bool IsDiscountNull() {
return this.IsNull(this.tableCabin.DiscountColumn);
}
public void SetDiscountNull() {
this[this.tableCabin.DiscountColumn] = System.Convert.DBNull;
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class CabinRowChangeEvent : EventArgs {
private CabinRow eventRow;
private DataRowAction eventAction;
public CabinRowChangeEvent(CabinRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public CabinRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -