Skip to content

Commit

Permalink
Fixed issues with sort ordering in 'Choose Flight' and added icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve authored and Steve committed Sep 16, 2020
1 parent cbc3457 commit 3c3a227
Show file tree
Hide file tree
Showing 6 changed files with 2,303 additions and 5 deletions.
4 changes: 4 additions & 0 deletions FS2020PlanePath/FS2020PlanePath.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.3.0\lib\net45\EntityFramework.dll</HintPath>
Expand Down Expand Up @@ -155,6 +158,7 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
<Content Include="SimConnect.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
2 changes: 1 addition & 1 deletion FS2020PlanePath/FS2020_SQLLiteDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public List<FlightListData> GetFlightList()
SQLiteCommand sqlite_cmd;
string Selectsql;
sqlite_cmd = sqlite_conn.CreateCommand();
Selectsql = "SELECT FlightID, aircraft, start_datetimestamp FROM Flights";
Selectsql = "SELECT FlightID, aircraft, start_datetimestamp FROM Flights ORDER BY FlightID ASC";
sqlite_cmd.CommandText = Selectsql;
SQLiteDataReader r = sqlite_cmd.ExecuteReader();
int n = 0;
Expand Down
4 changes: 3 additions & 1 deletion FS2020PlanePath/MainPage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions FS2020PlanePath/MainPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,16 +429,16 @@ private void LoadFlightList()
FlightPickerLV.Columns.Clear();

FlightList = FlightPathDB.GetFlightList();
foreach (FlightListData flist in FlightList)

// reverse order guarantees newest on top since they come from the database in order of creation (oldest first)
foreach (FlightListData flist in Enumerable.Reverse(FlightList))
{
ListViewItem lvi = new ListViewItem();
lvi.Text = new DateTime(flist.Start_flight_timestamp).ToString();
lvi.SubItems.Add(flist.Aircraft);
lvi.Tag = flist.FlightID1;
FlightPickerLV.Items.Add(lvi);
}
FlightPickerLV.Sorting = SortOrder.Descending;
FlightPickerLV.Sort();

FlightPickerLV.Columns.Add("Flight Start Date/Time", -1, HorizontalAlignment.Left);
FlightPickerLV.Columns.Add("Aircraft", -1, HorizontalAlignment.Left);
Expand Down
Loading

0 comments on commit 3c3a227

Please sign in to comment.