Small fixes
This commit is contained in:
@@ -211,8 +211,9 @@ namespace LaDOSE.DesktopApp.ViewModels
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
DataTable grid = new DataTable();
|
||||
var games = Results.Games.Distinct().OrderBy(e=>e.Order).ToList();
|
||||
grid.Columns.Add("Players");
|
||||
Results.Games.ForEach(e => grid.Columns.Add(e.Name.Replace('.',' ')));
|
||||
games.ForEach(e => grid.Columns.Add(e.Name.Replace('.',' ')));
|
||||
grid.Columns.Add("Total").DataType = typeof(Int32);
|
||||
|
||||
|
||||
@@ -222,10 +223,10 @@ namespace LaDOSE.DesktopApp.ViewModels
|
||||
var resultsParticipent = resultsParticipents[i];
|
||||
int total = 0;
|
||||
dataRow["Players"] = resultsParticipent.Name;
|
||||
var gameDtos = Results.Games.Distinct().ToList();
|
||||
|
||||
|
||||
for (int j = 0; j < gameDtos.Count; j++)
|
||||
|
||||
for (int j = 0; j < games.Count; j++)
|
||||
{
|
||||
var resultsGame = Results.Games[j];
|
||||
var dictionary = computed[resultsParticipent.Name];
|
||||
@@ -258,22 +259,25 @@ namespace LaDOSE.DesktopApp.ViewModels
|
||||
|
||||
private void ExportToCSV()
|
||||
{
|
||||
|
||||
|
||||
if (this.GridDataTable != null)
|
||||
{
|
||||
|
||||
var dataTable = this.GridDataTable.DefaultView.ToTable();
|
||||
SaveFileDialog sfDialog = new SaveFileDialog()
|
||||
{
|
||||
Filter = "Text Files (*.csv)|*.csv|All Files (*.*)|*.*",
|
||||
AddExtension = true
|
||||
};
|
||||
if (sfDialog.ShowDialog() == true)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
IEnumerable<string> columnNames = this.GridDataTable.Columns.Cast<DataColumn>()
|
||||
IEnumerable<string> columnNames = dataTable.Columns.Cast<DataColumn>()
|
||||
.Select(column => column.ColumnName);
|
||||
sb.AppendLine(string.Join(";", columnNames));
|
||||
|
||||
foreach (DataRow row in this.GridDataTable.Rows)
|
||||
foreach (DataRow row in dataTable.Rows)
|
||||
{
|
||||
//EXCEL IS A BITCH
|
||||
IEnumerable<string> fields = row.ItemArray.Select(field =>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Tournament">
|
||||
<MenuItem Header="_Tournaments">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<cal:ActionMessage MethodName="TournamentResult">
|
||||
@@ -51,7 +51,7 @@
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
|
||||
<TabControl Grid.Row="1" x:Name="Items">
|
||||
<TabControl Grid.Row="1" x:Name="Items" Background="{StaticResource WindowBackgroundBrush}">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel>
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
|
||||
<Label> Date : </Label>
|
||||
<StackPanel Orientation="Horizontal" Width="200">
|
||||
<DatePicker SelectedDate="{Binding From}" Width="100">
|
||||
<StackPanel Orientation="Horizontal" Width="210">
|
||||
<DatePicker SelectedDate="{Binding From}" Width="100" BorderBrush="{x:Null}">
|
||||
<DatePicker.Resources>
|
||||
<Style TargetType="{x:Type DatePickerTextBox}">
|
||||
<Setter Property="Control.Template">
|
||||
@@ -39,10 +39,13 @@
|
||||
</DatePicker.Resources>
|
||||
</DatePicker>
|
||||
|
||||
<DatePicker SelectedDate="{Binding To}" Width="100">
|
||||
<DatePicker SelectedDate="{Binding To}" Width="100" Margin="5,0,5,0" BorderBrush="{x:Null}">
|
||||
<DatePicker.Resources>
|
||||
|
||||
<Style TargetType="{x:Type DatePickerTextBox}">
|
||||
|
||||
<Setter Property="Control.Template">
|
||||
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<TextBox x:Name="PART_TextBox" Foreground="White"
|
||||
@@ -56,11 +59,11 @@
|
||||
</StackPanel>
|
||||
|
||||
<Label>Usefull :</Label>
|
||||
<Button x:Name="SelectMonth">Month</Button>
|
||||
<Button x:Name="SelectYear">Year</Button>
|
||||
<Button Padding="5,0,5,0" x:Name="SelectMonth">Month</Button>
|
||||
<Button Padding="5,0,5,0" Margin="5,0,5,0" x:Name="SelectYear">Year</Button>
|
||||
<Label>Select :</Label>
|
||||
<TextBox Width="200" Text="{Binding SelectRegex}"></TextBox>
|
||||
<Button x:Name="SelectRegexp">Select</Button>
|
||||
<Button Padding="5,0,5,0" Margin="5,0,5,0" x:Name="SelectRegexp">Select</Button>
|
||||
</StackPanel>
|
||||
<Button Grid.Row="1" x:Name="LoadTournaments">Update</Button>
|
||||
<ListView Grid.Row="2" ItemsSource="{Binding Tournaments}" x:Name="TournamentList" Margin="0,0,0,5"
|
||||
@@ -97,7 +100,7 @@
|
||||
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.ColumnSpan="3" Orientation="Horizontal">
|
||||
<TextBlock> Jeux :</TextBlock>
|
||||
<TextBlock> Game :</TextBlock>
|
||||
<TextBlock Margin="5,0,0,0" Text="{Binding Results.Games.Count}" />
|
||||
|
||||
</StackPanel>
|
||||
|
||||
Reference in New Issue
Block a user