Add year and mandator dropdown
This commit is contained in:
parent
3c04220437
commit
38a1fb65c5
4 changed files with 53 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<FluentLayout>
|
<FluentLayout>
|
||||||
<FluentHeader Class="hidePrint">
|
<FluentHeader Class="hidePrint">
|
||||||
AccountingNext
|
<MyHeader/>
|
||||||
</FluentHeader>
|
</FluentHeader>
|
||||||
<FluentStack Class="main" Orientation="Orientation.Horizontal" Width="100%">
|
<FluentStack Class="main" Orientation="Orientation.Horizontal" Width="100%">
|
||||||
<NavMenu />
|
<NavMenu />
|
||||||
|
|
|
||||||
17
Schaad.Accounting.UI/Components/MyHeader.razor
Normal file
17
Schaad.Accounting.UI/Components/MyHeader.razor
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
|
AccountingNext
|
||||||
|
|
||||||
|
<FluentStack Orientation="Orientation.Horizontal" HorizontalAlignment="HorizontalAlignment.Right">
|
||||||
|
<FluentSelect TOption="int"
|
||||||
|
Items=@years
|
||||||
|
OptionText="@(i => i.ToString())"
|
||||||
|
OptionValue="@(i => i.ToString())"
|
||||||
|
@bind-SelectedOption="@selectedYear"
|
||||||
|
ValueChanged="YearChanged" />
|
||||||
|
|
||||||
|
</FluentStack>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
}
|
||||||
31
Schaad.Accounting.UI/Components/MyHeader.razor.cs
Normal file
31
Schaad.Accounting.UI/Components/MyHeader.razor.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Schaad.Accounting.Interfaces;
|
||||||
|
|
||||||
|
namespace Schaad.Accounting.UI.Components;
|
||||||
|
|
||||||
|
public partial class MyHeader : ComponentBase
|
||||||
|
{
|
||||||
|
[Inject]
|
||||||
|
private ISettingsService settingsService { get; set; } = null!;
|
||||||
|
|
||||||
|
private List<int> years = new ();
|
||||||
|
private int selectedYear;
|
||||||
|
|
||||||
|
protected override Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
for (var year = DateTime.Now.Year; year >= 2015; year--)
|
||||||
|
{
|
||||||
|
years.Add(year);
|
||||||
|
}
|
||||||
|
|
||||||
|
selectedYear = settingsService.GetYear();
|
||||||
|
|
||||||
|
return base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void YearChanged(string obj)
|
||||||
|
{
|
||||||
|
settingsService.SetYear(int.Parse(obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -4,5 +4,9 @@
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Settings": {
|
||||||
|
"DataPath": "D:\\Developer\\AccountingData\\",
|
||||||
|
"FixerIoApiKey": "ee23142f1120bb1223b0e76f98abfa97"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue