|
|
@ -20,6 +20,8 @@ |
|
|
|
<th>User name</th> |
|
|
|
<th>User name</th> |
|
|
|
<th>Score</th> |
|
|
|
<th>Score</th> |
|
|
|
<th>Date</th> |
|
|
|
<th>Date</th> |
|
|
|
|
|
|
|
<th>Update</th> |
|
|
|
|
|
|
|
<th>Delete</th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tbody> |
|
|
@ -29,6 +31,16 @@ |
|
|
|
<td>@gameResult.UserName</td> |
|
|
|
<td>@gameResult.UserName</td> |
|
|
|
<td>@gameResult.Score</td> |
|
|
|
<td>@gameResult.Score</td> |
|
|
|
<td>@gameResult.Date.ToShortDateString()</td> |
|
|
|
<td>@gameResult.Date.ToShortDateString()</td> |
|
|
|
|
|
|
|
<td> |
|
|
|
|
|
|
|
<button class="btn btn-primary" @onclick="(() => UpdateGameResult(gameResult))"> |
|
|
|
|
|
|
|
Edit |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
</td> |
|
|
|
|
|
|
|
<td> |
|
|
|
|
|
|
|
<button class="btn btn-danger" @onclick="(() => DeleteGameResult(gameResult))"> |
|
|
|
|
|
|
|
Delete |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
} |
|
|
|
} |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
@ -89,6 +101,19 @@ |
|
|
|
_gameResult = new GameResult() { Id = 0 }; |
|
|
|
_gameResult = new GameResult() { Id = 0 }; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async Task UpdateGameResult(GameResult gameResult) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_gameResult = gameResult; |
|
|
|
|
|
|
|
_showPopup = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async Task DeleteGameResult(GameResult gameResult) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var result = _rankingService.DeleteGameResult(gameResult); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_gameResults = await _rankingService.GetGameResultsAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ClosePopup() |
|
|
|
void ClosePopup() |
|
|
|
{ |
|
|
|
{ |
|
|
|
_showPopup = false; |
|
|
|
_showPopup = false; |
|
|
@ -96,6 +121,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
async Task SaveGameResult() |
|
|
|
async Task SaveGameResult() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
ClosePopup(); |
|
|
|
if (_gameResult.Id == 0) |
|
|
|
if (_gameResult.Id == 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_gameResult.Date = DateTime.Now; |
|
|
|
_gameResult.Date = DateTime.Now; |
|
|
@ -103,10 +129,9 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
var result = _rankingService.UpdateGameResult(_gameResult); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_gameResults = await _rankingService.GetGameResultsAsync(); |
|
|
|
_gameResults = await _rankingService.GetGameResultsAsync(); |
|
|
|
ClosePopup(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|