|
|
@@ -1,4 +1,5 @@ |
|
|
|
using BPA.SingleDevice.Services; |
|
|
|
using System.DirectoryServices.Protocols; |
|
|
|
|
|
|
|
namespace BPA.SingleDevice.ViewModel |
|
|
|
{ |
|
|
@@ -13,12 +14,13 @@ namespace BPA.SingleDevice.ViewModel |
|
|
|
{ |
|
|
|
SqlHelper.GetInstance.GetListAsync<RawMaterTB>().Result.OnSuccess(s => |
|
|
|
{ |
|
|
|
var result = s.OrderBy(r=>r.DeviceNum).ThenBy(r=>r.WarehouseNum); |
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
s.ForEach(item => |
|
|
|
foreach (var item in result) |
|
|
|
{ |
|
|
|
RawMaterInfos.Add(new RawMaterInfo(item.Id, item.Name, item.DeviceNum, item.WarehouseNum, item.LastModified)); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
@@ -110,6 +112,25 @@ namespace BPA.SingleDevice.ViewModel |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
RefreshCommand = new(() => |
|
|
|
{ |
|
|
|
RawMaterInfos.Clear(); |
|
|
|
Task.Run(() => |
|
|
|
{ |
|
|
|
SqlHelper.GetInstance.GetListAsync<RawMaterTB>().Result.OnSuccess(s => |
|
|
|
{ |
|
|
|
var result = s.OrderBy(r => r.DeviceNum).ThenBy(r => r.WarehouseNum); |
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
foreach (var item in result) |
|
|
|
{ |
|
|
|
RawMaterInfos.Add(new RawMaterInfo(item.Id, item.Name, item.DeviceNum, item.WarehouseNum, item.LastModified)); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@@ -120,5 +141,7 @@ namespace BPA.SingleDevice.ViewModel |
|
|
|
public BPARelayCommand<object> CopyCommand { get; set; } |
|
|
|
public BPARelayCommand<object> EditCommand { get; set; } |
|
|
|
public BPARelayCommand<object> RemoveCommand { get; set; } |
|
|
|
|
|
|
|
public BPARelayCommand RefreshCommand { get; set; } |
|
|
|
} |
|
|
|
} |