little fixes

This commit is contained in:
beo3000 2026-01-04 18:03:47 +01:00
parent 7af5fb909e
commit 9356dab062
4 changed files with 14 additions and 4 deletions

View File

@ -51,7 +51,15 @@ public class BookingCategoryRepository(IDbContextFactory<AppDbContext> contextFa
entity.Id = Guid.NewGuid();
entity.CreatedAt = DateTime.UtcNow;
await context.BookingCategories.AddAsync(entity, ct);
await context.SaveChangesAsync(ct);
try
{
await context.SaveChangesAsync(ct);
}
catch (Exception e)
{
throw;
}
return entity;
}

View File

@ -50,7 +50,7 @@
[Parameter] public UserDto User { get; set; } = null!;
private readonly string[] _availableRoles = { UserRole.Viewer, UserRole.Editor, UserRole.Admin };
private readonly string[] _availableRoles = { UserRole.Viewer, UserRole.Editor, UserRole.Treasurer, UserRole.Admin };
private bool _isProcessing;
private bool _hasChanges;

View File

@ -15,6 +15,7 @@
Required="true"
RequiredError="Name ist erforderlich"
Immediate="true"
Disabled="_isSystemCategory"
Class="mb-4" />
<MudTextField @bind-Value="_description"
@ -106,6 +107,7 @@
private MudForm? _form;
private bool _isValid;
private bool _isSystemCategory;
private string _name = "";
private string? _description;
private BookingCategoryType _categoryType = BookingCategoryType.Income;
@ -145,6 +147,7 @@
_color = string.IsNullOrWhiteSpace(Category.Color) ? null : new MudColor(Category.Color);
_icon = Category.Icon;
_isActive = Category.IsActive;
_isSystemCategory = Category.IsSystemCategory;
}
}

View File

@ -11,9 +11,8 @@
<MudStack Row="true" Spacing="4" Class="mb-4">
<MudSelect T="int" @bind-Value="_selectedMonth" Label="Monat" Style="width: 150px;">
@for (int m = 1; m <= 12; m++)
@foreach (var month in Enumerable.Range(1, 12))
{
var month = m;
<MudSelectItem Value="@month">@GetMonthName(month)</MudSelectItem>
}
</MudSelect>