little fixes
This commit is contained in:
parent
7af5fb909e
commit
9356dab062
|
|
@ -51,7 +51,15 @@ public class BookingCategoryRepository(IDbContextFactory<AppDbContext> contextFa
|
||||||
entity.Id = Guid.NewGuid();
|
entity.Id = Guid.NewGuid();
|
||||||
entity.CreatedAt = DateTime.UtcNow;
|
entity.CreatedAt = DateTime.UtcNow;
|
||||||
await context.BookingCategories.AddAsync(entity, ct);
|
await context.BookingCategories.AddAsync(entity, ct);
|
||||||
await context.SaveChangesAsync(ct);
|
try
|
||||||
|
{
|
||||||
|
await context.SaveChangesAsync(ct);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
[Parameter] public UserDto User { get; set; } = null!;
|
[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 _isProcessing;
|
||||||
private bool _hasChanges;
|
private bool _hasChanges;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
Required="true"
|
Required="true"
|
||||||
RequiredError="Name ist erforderlich"
|
RequiredError="Name ist erforderlich"
|
||||||
Immediate="true"
|
Immediate="true"
|
||||||
|
Disabled="_isSystemCategory"
|
||||||
Class="mb-4" />
|
Class="mb-4" />
|
||||||
|
|
||||||
<MudTextField @bind-Value="_description"
|
<MudTextField @bind-Value="_description"
|
||||||
|
|
@ -106,6 +107,7 @@
|
||||||
|
|
||||||
private MudForm? _form;
|
private MudForm? _form;
|
||||||
private bool _isValid;
|
private bool _isValid;
|
||||||
|
private bool _isSystemCategory;
|
||||||
private string _name = "";
|
private string _name = "";
|
||||||
private string? _description;
|
private string? _description;
|
||||||
private BookingCategoryType _categoryType = BookingCategoryType.Income;
|
private BookingCategoryType _categoryType = BookingCategoryType.Income;
|
||||||
|
|
@ -145,6 +147,7 @@
|
||||||
_color = string.IsNullOrWhiteSpace(Category.Color) ? null : new MudColor(Category.Color);
|
_color = string.IsNullOrWhiteSpace(Category.Color) ? null : new MudColor(Category.Color);
|
||||||
_icon = Category.Icon;
|
_icon = Category.Icon;
|
||||||
_isActive = Category.IsActive;
|
_isActive = Category.IsActive;
|
||||||
|
_isSystemCategory = Category.IsSystemCategory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,8 @@
|
||||||
|
|
||||||
<MudStack Row="true" Spacing="4" Class="mb-4">
|
<MudStack Row="true" Spacing="4" Class="mb-4">
|
||||||
<MudSelect T="int" @bind-Value="_selectedMonth" Label="Monat" Style="width: 150px;">
|
<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>
|
<MudSelectItem Value="@month">@GetMonthName(month)</MudSelectItem>
|
||||||
}
|
}
|
||||||
</MudSelect>
|
</MudSelect>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue