mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Move all Blazor code to code-behind files.
This commit is contained in:
@@ -376,56 +376,3 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
[Parameter]
|
||||
public int Id { get; set; }
|
||||
|
||||
bool _loaded;
|
||||
Company _company;
|
||||
string _carrouselActive;
|
||||
List<Machine> _computers;
|
||||
List<Machine> _consoles;
|
||||
string _description;
|
||||
Company _soldTo;
|
||||
|
||||
public bool ComputersCollapsed { get; set; } = true;
|
||||
public bool ConsolesCollapsed { get; set; } = true;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if(Id <= 0)
|
||||
{
|
||||
_loaded = true;
|
||||
return;
|
||||
}
|
||||
|
||||
_company = await Service.GetCompanyAsync(Id);
|
||||
var machines = await Service.GetMachinesAsync(Id);
|
||||
|
||||
_computers = machines.Where(m => m.Type == MachineType.Computer).ToList();
|
||||
_consoles = machines.Where(m => m.Type == MachineType.Console).ToList();
|
||||
|
||||
_description = await Service.GetDescriptionAsync(Id);
|
||||
_soldTo = await Service.GetSoldToAsync(_company.SoldToId);
|
||||
|
||||
_loaded = true;
|
||||
}
|
||||
|
||||
private void CollapseComputers()
|
||||
{
|
||||
if (_computers.Count == 0)
|
||||
return;
|
||||
|
||||
ComputersCollapsed = !ComputersCollapsed;
|
||||
}
|
||||
|
||||
private void CollapseConsoles()
|
||||
{
|
||||
if (_consoles.Count == 0)
|
||||
return;
|
||||
|
||||
ConsolesCollapsed = !ConsolesCollapsed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user