📄 flight.cs
字号:
public FlightRow AddFlightRow(string FlightName, int DepartureCityId, int ArrivalCityId, System.DateTime DepartureTime, System.DateTime ArrivalTime) {
FlightRow rowFlightRow = ((FlightRow)(this.NewRow()));
rowFlightRow.ItemArray = new object[] {
null,
FlightName,
DepartureCityId,
ArrivalCityId,
DepartureTime,
ArrivalTime};
this.Rows.Add(rowFlightRow);
return rowFlightRow;
}
public FlightRow FindByFlightId(int FlightId) {
return ((FlightRow)(this.Rows.Find(new object[] {
FlightId})));
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
FlightDataTable cln = ((FlightDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new FlightDataTable();
}
internal void InitVars() {
this.columnFlightId = this.Columns["FlightId"];
this.columnFlightName = this.Columns["FlightName"];
this.columnDepartureCityId = this.Columns["DepartureCityId"];
this.columnArrivalCityId = this.Columns["ArrivalCityId"];
this.columnDepartureTime = this.Columns["DepartureTime"];
this.columnArrivalTime = this.Columns["ArrivalTime"];
}
private void InitClass() {
this.columnFlightId = new DataColumn("FlightId", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnFlightId);
this.columnFlightName = new DataColumn("FlightName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnFlightName);
this.columnDepartureCityId = new DataColumn("DepartureCityId", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnDepartureCityId);
this.columnArrivalCityId = new DataColumn("ArrivalCityId", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnArrivalCityId);
this.columnDepartureTime = new DataColumn("DepartureTime", typeof(System.DateTime), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnDepartureTime);
this.columnArrivalTime = new DataColumn("ArrivalTime", typeof(System.DateTime), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnArrivalTime);
this.Constraints.Add(new UniqueConstraint("FlightDataKey1", new DataColumn[] {
this.columnFlightId}, true));
this.columnFlightId.AutoIncrement = true;
this.columnFlightId.AllowDBNull = false;
this.columnFlightId.ReadOnly = true;
this.columnFlightId.Unique = true;
this.columnFlightName.AllowDBNull = false;
this.columnDepartureCityId.AllowDBNull = false;
this.columnArrivalCityId.AllowDBNull = false;
this.columnDepartureTime.AllowDBNull = false;
this.columnArrivalTime.AllowDBNull = false;
}
public FlightRow NewFlightRow() {
return ((FlightRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new FlightRow(builder);
}
protected override System.Type GetRowType() {
return typeof(FlightRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.FlightRowChanged != null)) {
this.FlightRowChanged(this, new FlightRowChangeEvent(((FlightRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.FlightRowChanging != null)) {
this.FlightRowChanging(this, new FlightRowChangeEvent(((FlightRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.FlightRowDeleted != null)) {
this.FlightRowDeleted(this, new FlightRowChangeEvent(((FlightRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.FlightRowDeleting != null)) {
this.FlightRowDeleting(this, new FlightRowChangeEvent(((FlightRow)(e.Row)), e.Action));
}
}
public void RemoveFlightRow(FlightRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class FlightRow : DataRow {
private FlightDataTable tableFlight;
internal FlightRow(DataRowBuilder rb) :
base(rb) {
this.tableFlight = ((FlightDataTable)(this.Table));
}
public int FlightId {
get {
return ((int)(this[this.tableFlight.FlightIdColumn]));
}
set {
this[this.tableFlight.FlightIdColumn] = value;
}
}
public string FlightName {
get {
return ((string)(this[this.tableFlight.FlightNameColumn]));
}
set {
this[this.tableFlight.FlightNameColumn] = value;
}
}
public int DepartureCityId {
get {
return ((int)(this[this.tableFlight.DepartureCityIdColumn]));
}
set {
this[this.tableFlight.DepartureCityIdColumn] = value;
}
}
public int ArrivalCityId {
get {
return ((int)(this[this.tableFlight.ArrivalCityIdColumn]));
}
set {
this[this.tableFlight.ArrivalCityIdColumn] = value;
}
}
public System.DateTime DepartureTime {
get {
return ((System.DateTime)(this[this.tableFlight.DepartureTimeColumn]));
}
set {
this[this.tableFlight.DepartureTimeColumn] = value;
}
}
public System.DateTime ArrivalTime {
get {
return ((System.DateTime)(this[this.tableFlight.ArrivalTimeColumn]));
}
set {
this[this.tableFlight.ArrivalTimeColumn] = value;
}
}
public CabinRow[] GetCabinRowsByFlight_Cabin() {
return ((CabinRow[])(this.GetChildRows(this.Table.ChildRelations["Flight_Cabin"])));
}
public CabinRow[] GetCabinRowsByFlightCabin() {
return ((CabinRow[])(this.GetChildRows(this.Table.ChildRelations["FlightCabin"])));
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class FlightRowChangeEvent : EventArgs {
private FlightRow eventRow;
private DataRowAction eventAction;
public FlightRowChangeEvent(FlightRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public FlightRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class CabinDataTable : DataTable, System.Collections.IEnumerable {
private DataColumn columnCabinId;
private DataColumn columnCabinName;
private DataColumn columnFlightId;
private DataColumn columnRemainTickets;
private DataColumn columnType;
private DataColumn columnPrice;
private DataColumn columnDiscount;
private DataColumn columnFlightId_0;
internal CabinDataTable() :
base("Cabin") {
this.InitClass();
}
internal CabinDataTable(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 CabinIdColumn {
get {
return this.columnCabinId;
}
}
internal DataColumn CabinNameColumn {
get {
return this.columnCabinName;
}
}
internal DataColumn FlightIdColumn {
get {
return this.columnFlightId;
}
}
internal DataColumn RemainTicketsColumn {
get {
return this.columnRemainTickets;
}
}
internal DataColumn TypeColumn {
get {
return this.columnType;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -