Compare commits
1 Commits
LC
..
880fbfdb47
| Author | SHA1 | Date | |
|---|---|---|---|
| 880fbfdb47 |
@@ -47,6 +47,9 @@
|
|||||||
<Button Color="Color.Primary" Clicked="@GetCurrentObject">
|
<Button Color="Color.Primary" Clicked="@GetCurrentObject">
|
||||||
<Icon Name="IconName.Redo" />
|
<Icon Name="IconName.Redo" />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button Color="Color.Primary" Clicked="@AddOnFile">
|
||||||
|
<Icon Name="IconName.FileUpload" />
|
||||||
|
</Button>
|
||||||
</Field>
|
</Field>
|
||||||
</CardText>
|
</CardText>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
@@ -439,39 +442,42 @@
|
|||||||
visibleProgress = Visibility.Visible;
|
visibleProgress = Visibility.Visible;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var item in _list_obj)
|
await Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var p = await AllPubData.http.PostAsJsonAsync("api/Object/AddObject", item);
|
foreach (var item in _list_obj)
|
||||||
if (!p.IsSuccessStatusCode)
|
|
||||||
{
|
{
|
||||||
error_group = "ОБЪЕКТ";
|
var p = await AllPubData.http.PostAsJsonAsync("api/Object/AddObject", item);
|
||||||
error_msg = $"{item.NameObject} не добавлено.\r\nСтатус код: {p.StatusCode}";
|
if (!p.IsSuccessStatusCode)
|
||||||
toastError = true;
|
{
|
||||||
//await Task.Delay(500);
|
error_group = "ОБЪЕКТ";
|
||||||
|
error_msg = $"{item.NameObject} не добавлено.\r\nСтатус код: {p.StatusCode}";
|
||||||
|
toastError = true;
|
||||||
|
//await Task.Delay(500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
foreach (var item in _list_type)
|
||||||
foreach (var item in _list_type)
|
|
||||||
{
|
|
||||||
var p = await AllPubData.http.PostAsJsonAsync("api/Type/AddType", item);
|
|
||||||
if (!p.IsSuccessStatusCode)
|
|
||||||
{
|
{
|
||||||
error_group = "ТИП";
|
var p = await AllPubData.http.PostAsJsonAsync("api/Type/AddType", item);
|
||||||
error_msg = $"{item.Name} не добавлено.\r\nСтатус код: {p.StatusCode}";
|
if (!p.IsSuccessStatusCode)
|
||||||
toastError = true;
|
{
|
||||||
//await Task.Delay(500);
|
error_group = "ТИП";
|
||||||
|
error_msg = $"{item.Name} не добавлено.\r\nСтатус код: {p.StatusCode}";
|
||||||
|
toastError = true;
|
||||||
|
//await Task.Delay(500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
foreach (var item in _list_dev)
|
||||||
foreach (var item in _list_dev)
|
|
||||||
{
|
|
||||||
var p = await AllPubData.http.PostAsJsonAsync("api/Device/AddDevice", item);
|
|
||||||
if (!p.IsSuccessStatusCode)
|
|
||||||
{
|
{
|
||||||
error_group = "УСТРОЙСТВА";
|
var p = await AllPubData.http.PostAsJsonAsync("api/Device/AddDevice", item);
|
||||||
error_msg = $"{item.Name} не добавлено.\r\nСтатус код: {p.StatusCode}";
|
if (!p.IsSuccessStatusCode)
|
||||||
toastError = true;
|
{
|
||||||
//await Task.Delay(500);
|
error_group = "УСТРОЙСТВА";
|
||||||
|
error_msg = $"{item.Name} не добавлено.\r\nСтатус код: {p.StatusCode}";
|
||||||
|
toastError = true;
|
||||||
|
//await Task.Delay(500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
@@ -483,6 +489,7 @@
|
|||||||
{
|
{
|
||||||
visibleProgress = Visibility.Invisible;
|
visibleProgress = Visibility.Invisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,4 +499,10 @@
|
|||||||
_list_type = AllPubData.ListDeviceTypeItems;
|
_list_type = AllPubData.ListDeviceTypeItems;
|
||||||
_list_dev = AllPubData.ListDeviceItems;
|
_list_dev = AllPubData.ListDeviceItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AddOnFile()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
///TODO: Добавить возможность загрузить из файла
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user