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