edit_page

This commit is contained in:
i.roger authored and admin committed 2026-10-22 15:59:00 +07:00
1 parent 28f9b9ce08
commit 5c186a1fa6
4 files changed
+146 -2

No files matched your search

+2
View File
@@ -4,3 +4,5 @@ services:
build:
context: .
dockerfile: medica-info/Dockerfile
volumes:
- 'M:/:/app/Data/Medica_info'
@@ -19,6 +19,11 @@
<span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Аптека
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="uslugi">
<span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Услугии
</NavLink>
</div>
</nav>
</div>
+4 -2
View File
@@ -5,7 +5,7 @@
<PageTitle>Apteka</PageTitle>
<h1>Центральный склад НСК</h1>
<h1>Центральный склад</h1>
@@ -65,6 +65,7 @@ else
@code {
private List<AptekaFore> apteka = new List<AptekaFore>();
private string lekInput { set; get; } = string.Empty;
private string lekInputMNN { set; get; } = string.Empty;
private string otdValue { set; get; } = string.Empty;
private string data { set; get; } = string.Empty;
@@ -94,7 +95,7 @@ else
private async Task LoadAndFilterAptekaAsync(string? filter, string? filterOTD)
{
// string file = @"\\192.168.232.33\medica.info\Apteka\price.xml";
string file = @"/app/Apteka/price.xml";
string file = @"/app/Data/Medica_info/Apteka/price.xml";
XmlDocument xml = new XmlDocument();
xml.Load(file);
XmlElement? root = xml.DocumentElement;
@@ -174,6 +175,7 @@ else
{
float val = float.Parse(value);
int vali =(int)MathF.Round(val);
if (vali == 0) return value;
return vali.ToString();
}
+135
View File
@@ -0,0 +1,135 @@
@page "/uslugi"
@using System.Xml
@using Microsoft.AspNetCore.Components.Web
@rendermode RenderMode.InteractiveServer
<PageTitle>uslugi</PageTitle>
<h1>Услуги</h1>
<div>
<InputText @onkeydown="HandleKeyPress" @bind-Value="UslugiInput" />
<button class="btn btn-primary" @onclick="OnSearchClicked">Поиск</button>
</div>
@if (apteka == null || apteka.Count == 0)
{
<p><em>Данные не найдены или загружаются...</em></p>
}
else
{
<p>Актуальная информация по базе в ООО "Медика НСК", на <label>@DateTime.Now.ToString("dd-MM-yyyy")</label></p>
<form>
<table class="table">
<thead>
<tr>
<th>Код услуги</th>
<th>Название</th>
<th>Стоимость</th>
<th>Даба изменения цены</th>
</tr>
</thead>
<tbody>
@foreach (var item in apteka)
{
<tr>
<td>@item.code</td>
<td>@item.name</td>
<td>@item.amount</td>
<td>@item.date_up</td>
</tr>
}
</tbody>
</table>
</form>
}
@code {
private List<UslugiFore> apteka = new List<UslugiFore>();
private string data { set; get; } = string.Empty;
private string UslugiInput { set; get; } = string.Empty;
protected override async Task OnInitializedAsync()
{
string filter = string.IsNullOrWhiteSpace(UslugiInput) ? null : UslugiInput.Trim();
await LoadAndFilterUslugiAsync(filter);
}
private async Task OnSearchClicked()
{
string filter = string.IsNullOrWhiteSpace(UslugiInput) ? null : UslugiInput.Trim();
await LoadAndFilterUslugiAsync(filter);
}
private async Task HandleKeyPress(KeyboardEventArgs keyboardEventArgs)
{
if (keyboardEventArgs.Code == "Enter")
{
await OnSearchClicked();
}
}
private async Task LoadAndFilterUslugiAsync(string? filter)
{
// string file = @"\\192.168.232.33\medica.info\Apteka\price.xml";
string file = @"/app/Data/Medica_info/PriceNSK/price.xml";
XmlDocument xml = new XmlDocument();
xml.Load(file);
XmlElement? root = xml.DocumentElement;
apteka.Clear();
if (root != null)
{
foreach (XmlElement row in root.ChildNodes)
{
if (row.Name != "ROW")
continue;
var prodNode = row.SelectSingleNode("TEXT");
if (prodNode == null)
continue;
if (!string.IsNullOrEmpty(filter) &&
!prodNode.InnerText.Contains(filter, StringComparison.OrdinalIgnoreCase))
{
continue;
}
UslugiFore item = new UslugiFore();
foreach (XmlNode child in row.ChildNodes)
{
switch (child.Name)
{
case "CODE":
item.code = child.InnerText;
break;
case "TEXT":
item.name = child.InnerText;
break;
case "PRICE_4078":
item.amount = child.InnerText;
break;
case "PR_UPD":
item.date_up = child.InnerText;
break;
}
}
apteka.Add(item);
}
}
StateHasChanged();
await Task.CompletedTask;
}
private class UslugiFore
{
public string code { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
public string amount { get; set; } = string.Empty;
public string date_up { get; set; } = string.Empty;
}
}