修复了添加设备的一些问题

This commit is contained in:
2025-06-12 18:56:25 +08:00
parent 6ee5f10aed
commit 080b9f0aa9
3 changed files with 24 additions and 10 deletions

View File

@@ -29,11 +29,15 @@ public partial class DevicesViewModel : ViewModelBase
{
try
{
Device device = new Device();
await _deviceDialogService.ShowAddDeviceDialog(device);
DbDevice dbDevice = new DbDevice();
device.CopyTo<DbDevice>(dbDevice);
await _devicesRepositories.Add(dbDevice);
Device device= await _deviceDialogService.ShowAddDeviceDialog();
if (device != null)
{
DbDevice dbDevice = new DbDevice();
device.CopyTo<DbDevice>(dbDevice);
await _devicesRepositories.Add(dbDevice);
}
}
catch (DbExistException e)
{