Team schedule improvements

This commit is contained in:
2025-10-17 07:58:14 -04:00
parent 551688f6fe
commit 3964a61794
11 changed files with 99 additions and 172 deletions
@@ -4,6 +4,7 @@
@using WebApp.Models
@using EventAssignment = Core.Calculation.EventAssignment
@inject AppDbContext Context
@inject IDialogService DialogService
@inject NavigationManager NavigationManager
<PageTitle>Event Assignment - TSA Chapter Organizer</PageTitle>
@@ -238,7 +239,7 @@
</MudTable>
</MudItem>
<MudItem xs="12" lg="4">
<MudText Typo="Typo.h4">TimeSlots</MudText>
<MudText Typo="Typo.h4">Teams</MudText>
<MudTable T="Team" ServerData="SolveAssignments" @ref="_teamData">
<ColGroup>
<col style="width: 200px;" />
@@ -254,7 +255,7 @@
}
<MudTd>
<b>@context.Event.Name</b>&nbsp;
<span>@AppIcons.EventEffort(context.Event) @AppIcons.EventAttributes(context.Event)</span>
<EventAttributes EventDefinition="context.Event"></EventAttributes>
</MudTd>
<MudTd Style="white-space:nowrap">
@@ -444,11 +445,19 @@
public async Task SaveTeams()
{
var teams = await Context.Teams.ExecuteDeleteAsync();
var result = await DialogService
.ShowMessageBox("Save Teams",
(MarkupString)$"Are you sure want to save these teams? Current teams will be erased. This cannot be undone.",
yesText: "Yes",
noText: "Cancel");
await Context.Teams.AddRangeAsync(_teams);
await Context.SaveChangesAsync();
if (result == true)
{
await Context.Teams.ExecuteDeleteAsync();
await Context.Teams.AddRangeAsync(_teams);
await Context.SaveChangesAsync();
NavigationManager.NavigateTo("/teams");
NavigationManager.NavigateTo("/teams");
}
}
}