Add WPFUi to prevent stuck state
Add Range to TournamentService Use DataTable to export CSV DataTable can be ordered on Total
This commit is contained in:
@@ -21,13 +21,19 @@ namespace LaDOSE.Api.Controllers
|
|||||||
|
|
||||||
_service = service;
|
_service = service;
|
||||||
}
|
}
|
||||||
|
//This may be a get , but i dont know what the RFC State for Get request with Body
|
||||||
[HttpGet("GetTournaments")]
|
//As i don't like to populate GET request with body this will be a post (and i think
|
||||||
public async Task<List<TournamentDTO>> GetChallonges()
|
//it will be easier to proxy.
|
||||||
|
[HttpPost("GetTournaments")]
|
||||||
|
public async Task<List<TournamentDTO>> GetChallonges([FromBody] TimeRangeDTO dto)
|
||||||
{
|
{
|
||||||
|
if (dto.To.HasValue | dto.From.HasValue)
|
||||||
var tournaments = await _service.GetTournaments(DateTime.Now.AddMonths(-2), null);
|
{
|
||||||
|
var tournaments = await _service.GetTournaments(dto.From, dto.To);
|
||||||
return AutoMapper.Mapper.Map<List<TournamentDTO>>(tournaments);
|
return AutoMapper.Mapper.Map<List<TournamentDTO>>(tournaments);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
LaDOSE.Src/LaDOSE.DTO/TimeRangeDTO.cs
Normal file
10
LaDOSE.Src/LaDOSE.DTO/TimeRangeDTO.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace LaDOSE.DTO
|
||||||
|
{
|
||||||
|
public class TimeRangeDTO
|
||||||
|
{
|
||||||
|
public DateTime? From { get; set; }
|
||||||
|
public DateTime? To { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace LaDOSE.DesktopApp.Utils
|
namespace LaDOSE.DesktopApp.Utils
|
||||||
{
|
{
|
||||||
@@ -14,5 +17,30 @@ namespace LaDOSE.DesktopApp.Utils
|
|||||||
Application.Current.Dispatcher.BeginInvoke(action);
|
Application.Current.Dispatcher.BeginInvoke(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Await(Action function,string message=null)
|
||||||
|
{
|
||||||
|
Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
|
||||||
|
Task tsk = Task.Factory.StartNew(new Action(function));
|
||||||
|
|
||||||
|
tsk.ContinueWith(t =>
|
||||||
|
{
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
System.Windows.Input.Mouse.OverrideCursor = null);
|
||||||
|
MessageBox.Show(t.Exception.InnerException.Message);
|
||||||
|
|
||||||
|
},
|
||||||
|
CancellationToken.None, TaskContinuationOptions.OnlyOnFaulted,
|
||||||
|
TaskScheduler.FromCurrentSynchronizationContext());
|
||||||
|
tsk.ContinueWith(task =>
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(message))
|
||||||
|
MessageBox.Show(message);
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
System.Windows.Input.Mouse.OverrideCursor = null);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ using System.Data;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using LaDOSE.DesktopApp.Utils;
|
using LaDOSE.DesktopApp.Utils;
|
||||||
@@ -22,12 +23,44 @@ namespace LaDOSE.DesktopApp.ViewModels
|
|||||||
|
|
||||||
private RestService RestService { get; set; }
|
private RestService RestService { get; set; }
|
||||||
|
|
||||||
public TournamentResultViewModel(RestService restService)
|
#region Properties
|
||||||
|
private String _selectRegex;
|
||||||
|
|
||||||
|
public String SelectRegex
|
||||||
{
|
{
|
||||||
this.RestService = restService;
|
get { return _selectRegex; }
|
||||||
_selectedTournaments = new ObservableCollection<TournamentDTO>();
|
set
|
||||||
Tournaments = new List<TournamentDTO>();
|
{
|
||||||
|
_selectRegex = value;
|
||||||
|
NotifyOfPropertyChange(() => SelectRegex);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private DateTime _from;
|
||||||
|
|
||||||
|
public DateTime From
|
||||||
|
{
|
||||||
|
get { return _from; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_from = value;
|
||||||
|
NotifyOfPropertyChange(() => From);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private DateTime _to;
|
||||||
|
public DateTime To
|
||||||
|
{
|
||||||
|
get { return _to; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_to = value;
|
||||||
|
NotifyOfPropertyChange(() => To);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private TournamentsResultDTO _results;
|
private TournamentsResultDTO _results;
|
||||||
public List<TournamentDTO> Tournaments { get; set; }
|
public List<TournamentDTO> Tournaments { get; set; }
|
||||||
@@ -96,18 +129,36 @@ namespace LaDOSE.DesktopApp.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
public TournamentResultViewModel(RestService restService)
|
||||||
|
{
|
||||||
|
this.RestService = restService;
|
||||||
|
_selectedTournaments = new ObservableCollection<TournamentDTO>();
|
||||||
|
Tournaments = new List<TournamentDTO>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected override void OnInitialize()
|
protected override void OnInitialize()
|
||||||
{
|
{
|
||||||
|
this.To=DateTime.Now;
|
||||||
|
this.From = DateTime.Now.AddMonths(-1);
|
||||||
|
this.SelectRegex = "Ranking";
|
||||||
LoadTournaments();
|
LoadTournaments();
|
||||||
base.OnInitialize();
|
base.OnInitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadTournaments()
|
public void LoadTournaments()
|
||||||
{
|
{
|
||||||
var tournamentDtos = this.RestService.GetTournaments().ToList();
|
WpfUtil.Await(() =>
|
||||||
|
{
|
||||||
|
var tournamentDtos = this.RestService
|
||||||
|
.GetTournaments(new TimeRangeDTO() {From = this.From, To = this.To}).ToList();
|
||||||
this.Tournaments = tournamentDtos;
|
this.Tournaments = tournamentDtos;
|
||||||
|
|
||||||
NotifyOfPropertyChange("Tournaments");
|
NotifyOfPropertyChange("Tournaments");
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataTable GridDataTable
|
public DataTable GridDataTable
|
||||||
@@ -121,11 +172,35 @@ namespace LaDOSE.DesktopApp.ViewModels
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Select()
|
public void Select()
|
||||||
|
{
|
||||||
|
WpfUtil.Await(() =>
|
||||||
{
|
{
|
||||||
var tournamentsIds = SelectedTournaments.Select(e => e.Id).ToList();
|
var tournamentsIds = SelectedTournaments.Select(e => e.Id).ToList();
|
||||||
var resultsDto = this.RestService.GetResults(tournamentsIds);
|
var resultsDto = this.RestService.GetResults(tournamentsIds);
|
||||||
this.Results = resultsDto;
|
this.Results = resultsDto;
|
||||||
ComputeDataGrid();
|
ComputeDataGrid();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SelectYear()
|
||||||
|
{
|
||||||
|
this.To = DateTime.Now;
|
||||||
|
this.From = new DateTime(DateTime.Now.Year,1,1);
|
||||||
|
|
||||||
|
}
|
||||||
|
public void SelectMonth()
|
||||||
|
{
|
||||||
|
this.To = DateTime.Now;
|
||||||
|
this.From = DateTime.Now.AddMonths(-1);
|
||||||
|
}
|
||||||
|
public void SelectRegexp()
|
||||||
|
{
|
||||||
|
var selectedTournaments = this.Tournaments.Where(e => Regex.IsMatch(e.Name, this.SelectRegex)).ToList();
|
||||||
|
this.SelectedTournaments.Clear();
|
||||||
|
if(selectedTournaments.Count>0)
|
||||||
|
selectedTournaments.ForEach(e=>this.SelectedTournaments.AddUI(e));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ComputeDataGrid()
|
private void ComputeDataGrid()
|
||||||
@@ -138,7 +213,7 @@ namespace LaDOSE.DesktopApp.ViewModels
|
|||||||
DataTable grid = new DataTable();
|
DataTable grid = new DataTable();
|
||||||
grid.Columns.Add("Players");
|
grid.Columns.Add("Players");
|
||||||
Results.Games.ForEach(e => grid.Columns.Add(e.Name.Replace('.',' ')));
|
Results.Games.ForEach(e => grid.Columns.Add(e.Name.Replace('.',' ')));
|
||||||
grid.Columns.Add("Total");
|
grid.Columns.Add("Total").DataType = typeof(Int32);
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < resultsParticipents.Count; i++)
|
for (int i = 0; i < resultsParticipents.Count; i++)
|
||||||
@@ -157,7 +232,7 @@ namespace LaDOSE.DesktopApp.ViewModels
|
|||||||
if (dictionary.ContainsKey(resultsGame.Id))
|
if (dictionary.ContainsKey(resultsGame.Id))
|
||||||
{
|
{
|
||||||
int points = dictionary[resultsGame.Id];
|
int points = dictionary[resultsGame.Id];
|
||||||
dataRow[resultsGame.Name.Replace('.', ' ')] = points.ToString();
|
dataRow[resultsGame.Name.Replace('.', ' ')] = points;
|
||||||
total += points;
|
total += points;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,9 +240,10 @@ namespace LaDOSE.DesktopApp.ViewModels
|
|||||||
dataRow[resultsGame.Name.Replace('.', ' ')] = null;
|
dataRow[resultsGame.Name.Replace('.', ' ')] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataRow["Total"] = total.ToString();
|
dataRow["Total"] = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grid.DefaultView.Sort = "Total DESC";
|
||||||
this.GridDataTable = grid;
|
this.GridDataTable = grid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,72 +258,33 @@ namespace LaDOSE.DesktopApp.ViewModels
|
|||||||
|
|
||||||
private void ExportToCSV()
|
private void ExportToCSV()
|
||||||
{
|
{
|
||||||
|
if (this.GridDataTable != null)
|
||||||
|
{
|
||||||
|
|
||||||
SaveFileDialog sfDialog = new SaveFileDialog()
|
SaveFileDialog sfDialog = new SaveFileDialog()
|
||||||
{
|
{
|
||||||
AddExtension = true
|
AddExtension = true
|
||||||
};
|
};
|
||||||
if (sfDialog.ShowDialog() == true)
|
if (sfDialog.ShowDialog() == true)
|
||||||
{
|
{
|
||||||
var resultsParticipents = this.Results.Participents.OrderBy(e => e.Name).ToList();
|
|
||||||
var computed = ResultsToDataDictionary(resultsParticipents);
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
IEnumerable<string> columnNames = this.GridDataTable.Columns.Cast<DataColumn>()
|
||||||
|
.Select(column => column.ColumnName);
|
||||||
|
sb.AppendLine(string.Join(";", columnNames));
|
||||||
|
|
||||||
sb.AppendLine(Results.Games.Aggregate("Player;", (current, t) => current + (t.Name + ";")));
|
foreach (DataRow row in this.GridDataTable.Rows)
|
||||||
|
|
||||||
for (int i = 0; i < resultsParticipents.Count; i++)
|
|
||||||
{
|
{
|
||||||
var entry = "";
|
//EXCEL IS A BITCH
|
||||||
|
IEnumerable<string> fields = row.ItemArray.Select(field =>
|
||||||
var resultsParticipent = resultsParticipents[i];
|
string.Concat("\"", field.ToString().Replace("\"", "\"\""), "\""));
|
||||||
|
sb.AppendLine(string.Join(";", fields));
|
||||||
entry = resultsParticipent.Name + ";";
|
|
||||||
var gameDtos = Results.Games.Distinct().ToList();
|
|
||||||
for (int j = 0; j < gameDtos.Count; j++)
|
|
||||||
{
|
|
||||||
var resultsGame = Results.Games[j];
|
|
||||||
var dictionary = computed[resultsParticipent.Name];
|
|
||||||
entry += dictionary.ContainsKey(resultsGame.Id)
|
|
||||||
? dictionary[resultsGame.Id].ToString() + ";"
|
|
||||||
: ";";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.AppendLine(entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//string[][] resultCsv = new string[resultsParticipents.Count + 1][];
|
|
||||||
//resultCsv[0] = new string[Results.Games.Count + 1];
|
|
||||||
//resultCsv[0][0] = "Player";
|
|
||||||
//for (int j = 0; j < Results.Games.Count; j++)
|
|
||||||
//{
|
|
||||||
// resultCsv[0][j + 1] = Results.Games[j].Name;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//for (int i = 0; i < resultsParticipents.Count; i++)
|
|
||||||
//{
|
|
||||||
// resultCsv[i + 1] = new string[Results.Games.Count + 1];
|
|
||||||
|
|
||||||
// var resultsParticipent = resultsParticipents[i];
|
|
||||||
|
|
||||||
// resultCsv[i + 1][0] = resultsParticipent.Name;
|
|
||||||
// for (int j = 0; j < Results.Games.Count; j++)
|
|
||||||
// {
|
|
||||||
// var resultsGame = Results.Games[j];
|
|
||||||
// var dictionary = computed[resultsParticipent.Name];
|
|
||||||
// if (dictionary.ContainsKey(resultsGame.Id))
|
|
||||||
// {
|
|
||||||
// var i1 = dictionary[resultsGame.Id];
|
|
||||||
// resultCsv[i + 1][j + 1] = i1.ToString();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//Save
|
|
||||||
File.WriteAllText(sfDialog.FileName, sb.ToString());
|
File.WriteAllText(sfDialog.FileName, sb.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Dictionary<string, Dictionary<int, int>> ResultsToDataDictionary(
|
private Dictionary<string, Dictionary<int, int>> ResultsToDataDictionary(
|
||||||
List<ParticipentDTO> resultsParticipents)
|
List<ParticipentDTO> resultsParticipents)
|
||||||
|
|||||||
@@ -122,17 +122,7 @@ namespace LaDOSE.DesktopApp.ViewModels
|
|||||||
|
|
||||||
public void UpdateDb()
|
public void UpdateDb()
|
||||||
{
|
{
|
||||||
Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
|
WpfUtil.Await(()=>this.RestService.RefreshDb(), "Updated");
|
||||||
var tsk = Task.Factory.StartNew(new Action(()=>this.RestService.RefreshDb()));
|
|
||||||
tsk.ContinueWith(t =>
|
|
||||||
{
|
|
||||||
MessageBox.Show(t.Exception.InnerException.Message);
|
|
||||||
},
|
|
||||||
CancellationToken.None, TaskContinuationOptions.OnlyOnFaulted,
|
|
||||||
TaskScheduler.FromCurrentSynchronizationContext());
|
|
||||||
|
|
||||||
MessageBox.Show("Database updated");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Generate()
|
public void Generate()
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
<Grid Row="2" Column="1">
|
<Grid Row="2" Column="1">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="2*" />
|
<RowDefinition Height="2*" />
|
||||||
@@ -20,16 +21,58 @@
|
|||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Button Grid.Row="0" x:Name="LoadTournaments">Update</Button>
|
<StackPanel Orientation="Horizontal">
|
||||||
<ListView Grid.Row="1" ItemsSource="{Binding Tournaments}" x:Name="TournamentList" Margin="0,0,0,5"
|
<Label> Date : </Label>
|
||||||
IsTextSearchEnabled="True" TextSearch.TextPath="Name" behaviors:MultiSelectorBehaviours.SynchronizedSelectedItems="{Binding SelectedTournaments}"
|
<StackPanel Orientation="Horizontal" Width="200">
|
||||||
|
<DatePicker SelectedDate="{Binding From}" Width="100">
|
||||||
|
<DatePicker.Resources>
|
||||||
|
<Style TargetType="{x:Type DatePickerTextBox}">
|
||||||
|
<Setter Property="Control.Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate>
|
||||||
|
<TextBox x:Name="PART_TextBox" Foreground="White"
|
||||||
|
Text="{Binding Path=SelectedDate, RelativeSource={RelativeSource AncestorType={x:Type DatePicker}},StringFormat=d}" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</DatePicker.Resources>
|
||||||
|
</DatePicker>
|
||||||
|
|
||||||
|
<DatePicker SelectedDate="{Binding To}" Width="100">
|
||||||
|
<DatePicker.Resources>
|
||||||
|
<Style TargetType="{x:Type DatePickerTextBox}">
|
||||||
|
<Setter Property="Control.Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate>
|
||||||
|
<TextBox x:Name="PART_TextBox" Foreground="White"
|
||||||
|
Text="{Binding Path=SelectedDate, RelativeSource={RelativeSource AncestorType={x:Type DatePicker}},StringFormat=d}" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</DatePicker.Resources>
|
||||||
|
</DatePicker>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Label>Usefull :</Label>
|
||||||
|
<Button x:Name="SelectMonth">Month</Button>
|
||||||
|
<Button x:Name="SelectYear">Year</Button>
|
||||||
|
<Label>Select :</Label>
|
||||||
|
<TextBox Width="200" Text="{Binding SelectRegex}"></TextBox>
|
||||||
|
<Button 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"
|
||||||
|
IsTextSearchEnabled="True" TextSearch.TextPath="Name"
|
||||||
|
behaviors:MultiSelectorBehaviours.SynchronizedSelectedItems="{Binding SelectedTournaments}"
|
||||||
SelectionMode="Multiple">
|
SelectionMode="Multiple">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="{Binding Id}" />
|
<TextBlock Text="{Binding Id}" />
|
||||||
<TextBlock Margin="5,0,0,0" Text="{Binding Name}" />
|
<TextBlock Margin="5,0,0,0" Text="{Binding Name}" />
|
||||||
<TextBlock > - </TextBlock>
|
<TextBlock> - </TextBlock>
|
||||||
<TextBlock Margin="5,0,0,0" Text="{Binding Game.Name}" />
|
<TextBlock Margin="5,0,0,0" Text="{Binding Game.Name}" />
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -37,7 +80,7 @@
|
|||||||
</ListView.ItemTemplate>
|
</ListView.ItemTemplate>
|
||||||
|
|
||||||
</ListView>
|
</ListView>
|
||||||
<Grid Row="2">
|
<Grid Row="3">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -59,7 +102,8 @@
|
|||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ListView Grid.Row="2" ItemsSource="{Binding Results.Games}" Margin="5,5,5,5"
|
<ListView Grid.Row="2" ItemsSource="{Binding Results.Games}" Margin="5,5,5,5"
|
||||||
IsTextSearchEnabled="True" TextSearch.TextPath="Name" SelectedItem="{Binding SelectedGame, UpdateSourceTrigger=PropertyChanged}">
|
IsTextSearchEnabled="True" TextSearch.TextPath="Name"
|
||||||
|
SelectedItem="{Binding SelectedGame, UpdateSourceTrigger=PropertyChanged}">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
@@ -87,18 +131,17 @@
|
|||||||
|
|
||||||
</ListView>
|
</ListView>
|
||||||
|
|
||||||
<TabControl Grid.Row="2" Grid.Column="2" >
|
<TabControl Grid.Row="2" Grid.Column="2">
|
||||||
<TabItem Header="Result">
|
<TabItem Header="Result">
|
||||||
<DataGrid ItemsSource="{Binding GridDataTable}" AutoGenerateColumns="True" CanUserAddRows="False" CanUserDeleteRows="False">
|
<DataGrid ItemsSource="{Binding GridDataTable}" AutoGenerateColumns="True" CanUserAddRows="False"
|
||||||
|
CanUserDeleteRows="False" />
|
||||||
</DataGrid>
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="By Game">
|
<TabItem Header="By Game">
|
||||||
<DockPanel >
|
<DockPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
|
||||||
<TextBlock> Total :</TextBlock>
|
<TextBlock> Total :</TextBlock>
|
||||||
<TextBlock Text="{Binding SelectedGameResult.Count,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
|
<TextBlock Text="{Binding SelectedGameResult.Count,UpdateSourceTrigger=PropertyChanged}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ListView ItemsSource="{Binding SelectedGameResult}" Margin="5,5,5,5"
|
<ListView ItemsSource="{Binding SelectedGameResult}" Margin="5,5,5,5"
|
||||||
IsTextSearchEnabled="True" TextSearch.TextPath="Name" DockPanel.Dock="Top">
|
IsTextSearchEnabled="True" TextSearch.TextPath="Name" DockPanel.Dock="Top">
|
||||||
@@ -117,7 +160,7 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
|
||||||
<Button Grid.Row="3" Grid.ColumnSpan="3" x:Name="Export">Export</Button>
|
<Button Grid.Row="4" Grid.ColumnSpan="3" x:Name="Export">Export</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -252,12 +252,11 @@ namespace LaDOSE.REST
|
|||||||
|
|
||||||
#region Tournaments
|
#region Tournaments
|
||||||
|
|
||||||
public List<TournamentDTO> GetTournaments()
|
public List<TournamentDTO> GetTournaments(TimeRangeDTO timeRange)
|
||||||
{
|
{
|
||||||
CheckToken();
|
CheckToken();
|
||||||
var restRequest = new RestRequest("/api/Tournament/GetTournaments", Method.GET);
|
List<TournamentDTO> tournamentDtos = Post<TimeRangeDTO, List<TournamentDTO>>("/api/Tournament/GetTournaments",timeRange);
|
||||||
var restResponse = Client.Get<List<TournamentDTO>>(restRequest);
|
return tournamentDtos;
|
||||||
return restResponse.Data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TournamentsResultDTO GetResults(List<int> ids)
|
public TournamentsResultDTO GetResults(List<int> ids)
|
||||||
|
|||||||
Reference in New Issue
Block a user