mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
Добавил модель картриджа, так же создал страничку в Web с выводом списка картриджей в бд
This commit is contained in:
1 parent
99cdf44c87
commit
3d52cd5691
13 files changed
+420
-1
No files matched your search
@@ -0,0 +1,42 @@
|
||||
@page "/Cartridges"
|
||||
@using CartriX.Shared.Models
|
||||
@using Newtonsoft.Json
|
||||
|
||||
|
||||
<RadzenStack Orientation="Orientation.Vertical" Gap="16px">
|
||||
<RadzenPanel>
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="16px">
|
||||
<RadzenButton Text="прикеол"/>
|
||||
</RadzenStack>
|
||||
</RadzenPanel>
|
||||
|
||||
<RadzenDataGrid Data="@cartridges">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Title="Модель">
|
||||
<Template Context="data">
|
||||
@(data.model.name)
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
|
||||
</RadzenStack>
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
HttpClient httpClient = new();
|
||||
List<Cartridge> cartridges = null!;
|
||||
|
||||
|
||||
string textlol = null!;
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
var query = await httpClient.GetAsync("http://localhost:5197/api/Cartridge/GetAll");
|
||||
|
||||
textlol = await query.Content.ReadAsStringAsync();
|
||||
cartridges = JsonConvert.DeserializeObject<List<Cartridge>>(await query.Content.ReadAsStringAsync())!;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user