Skip to content

Commit 43016de

Browse files
committed
fix: issue#49 Teacher edit type
1 parent 7ec045e commit 43016de

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

grade-management-new/GradeManagement.Client/Pages/Teachers.razor

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
<PropertyColumn Property="x => x.NeptunCode" Title="Neptun Code"/>
1919
<PropertyColumn Property="x => x.GithubId" Title="Github Id"/>
2020
<PropertyColumn Property="x => x.BmeEmail" Title="Bme Email"/>
21-
<PropertyColumn Property="x => x.Type" Title="Type"/>
21+
<TemplateColumn Title="Type">
22+
<CellTemplate>
23+
@context.Item.Type
24+
</CellTemplate>
25+
<EditTemplate>
26+
<SelectUserType @bind-Value="@context.Item.Type"/>
27+
</EditTemplate>
28+
</TemplateColumn>
2229
<DataGridActions TItem="User" OnEditItem="@StartEditing" OnDeleteItem="@DeleteItem"/>
2330
</Columns>
2431
</MudDataGrid>
@@ -38,7 +45,7 @@
3845
{
3946
var user = result.Data as User;
4047
user = await UserClient.CreateAsync(user);
41-
SnackbarService.ShowMessage("user id:" + user.Id);
48+
//SnackbarService.ShowMessage("user id:" + user.Id);
4249
var subject = SubjectService.CurrentSubject;
4350
//await SubjectClient.AddTeacherToSubjectAsync(subject.Id, user.Id);
4451
_teachers.Add(user);
@@ -71,7 +78,12 @@
7178
{
7279
await UserClient.UpdateAsync(items.Id, items);
7380
SnackbarService.ShowEditSuccess();
74-
await loadingComponentRef.StartLoading();
81+
// Run the StartLoading method asynchronously after a short delay
82+
_ = Task.Run(async () =>
83+
{
84+
await Task.Delay(1); // Delay for 100 milliseconds
85+
await loadingComponentRef.StartLoading();
86+
});
7587
}
7688

7789
private async Task DeleteItem(User item)

0 commit comments

Comments
 (0)