|
|
|
@ -87,15 +87,31 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
|
|
|
|
|
}
|
|
|
|
|
public void Load()
|
|
|
|
|
{
|
|
|
|
|
var infos = baseMaterialInfoService.getAllInfos();
|
|
|
|
|
MaterialDataGrid.Clear();
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
foreach (BaseMaterialInfo info in infos)
|
|
|
|
|
List<BaseMaterialInfo> infos = null;
|
|
|
|
|
if (spaceCodes.Contains("XK"))
|
|
|
|
|
{
|
|
|
|
|
MaterialDataGrid.Add(info);
|
|
|
|
|
infos = baseMaterialInfoService.getShellAndLiner().Where(x => x.MaterialSubclass == "400").ToList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
infos = baseMaterialInfoService.getShellAndLiner().Where(x => x.MaterialSubclass == "500").ToList();
|
|
|
|
|
}
|
|
|
|
|
if (infos == null) return;
|
|
|
|
|
MaterialDataGrid.Clear();
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
foreach (BaseMaterialInfo info in infos)
|
|
|
|
|
{
|
|
|
|
|
MaterialDataGrid.Add(info);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
logHelper.Error(ex.Message.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ObservableCollection<BaseMaterialInfo> materialDataGrid;
|
|
|
|
@ -303,17 +319,33 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
|
|
|
|
|
/// </summary>
|
|
|
|
|
private async void searchData()
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(searchText))
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var infos = baseMaterialInfoService.getAllInfos().Where(x => x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText));
|
|
|
|
|
MaterialDataGrid.Clear();
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
List<BaseMaterialInfo> infos = null;
|
|
|
|
|
if (!string.IsNullOrEmpty(searchText))
|
|
|
|
|
{
|
|
|
|
|
foreach (BaseMaterialInfo info in infos)
|
|
|
|
|
if (spaceCodes.Contains("XK"))
|
|
|
|
|
{
|
|
|
|
|
MaterialDataGrid.Add(info);
|
|
|
|
|
infos = baseMaterialInfoService.getShellAndLiner().Where(x => x.MaterialSubclass == "400" && (x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText))).ToList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
infos = baseMaterialInfoService.getShellAndLiner().Where(x => x.MaterialSubclass == "500" && (x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText))).ToList();
|
|
|
|
|
}
|
|
|
|
|
if (infos == null) return;
|
|
|
|
|
MaterialDataGrid.Clear();
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
foreach (BaseMaterialInfo info in infos)
|
|
|
|
|
{
|
|
|
|
|
MaterialDataGrid.Add(info);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
logHelper.Error(ex.Message.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|