更改FTP文件导入
This commit is contained in:
@@ -11,8 +11,8 @@ using System.Windows;
|
||||
namespace FATrace.WPLApp.ViewModels
|
||||
{
|
||||
/// <summary>
|
||||
/// 工厂-出入库 数据查询 VM
|
||||
/// 仅展示从 Excel 导入的 FactoryInventoryTransaction 数据,支持简单条件与分页。
|
||||
/// 工厂-原料出入库 数据查询 VM
|
||||
/// 仅展示从 Excel 导入的 FactoryRawInOutbound 数据,支持简单条件与分页。
|
||||
/// </summary>
|
||||
public class FactoryInventoryTransactionViewModel : NavigationViewModel
|
||||
{
|
||||
@@ -24,7 +24,7 @@ namespace FATrace.WPLApp.ViewModels
|
||||
_fsql = fsql;
|
||||
_log = log;
|
||||
|
||||
Items = new ObservableCollection<FactoryInventoryTransaction>();
|
||||
Items = new ObservableCollection<FactoryRawInOutbound>();
|
||||
|
||||
SearchCommand = new DelegateCommand(async () => await SearchAsync(), () => !IsBusy)
|
||||
.ObservesProperty(() => IsBusy);
|
||||
@@ -79,7 +79,7 @@ namespace FATrace.WPLApp.ViewModels
|
||||
#endregion
|
||||
|
||||
#region 列表与分页
|
||||
public ObservableCollection<FactoryInventoryTransaction> Items { get; }
|
||||
public ObservableCollection<FactoryRawInOutbound> Items { get; }
|
||||
|
||||
private bool _isBusy;
|
||||
public bool IsBusy { get => _isBusy; set { _isBusy = value; RaisePropertyChanged(); } }
|
||||
@@ -133,11 +133,11 @@ namespace FATrace.WPLApp.ViewModels
|
||||
try
|
||||
{
|
||||
IsBusy = true;
|
||||
_log.Info("FactoryInventoryTransaction 查询开始");
|
||||
_log.Info("FactoryRawInOutbound 查询开始");
|
||||
|
||||
var data = await Task.Run(() =>
|
||||
{
|
||||
var q = _fsql.Select<FactoryInventoryTransaction>();
|
||||
var q = _fsql.Select<FactoryRawInOutbound>();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Origin))
|
||||
q = q.Where(a => a.Origin != null && a.Origin.Contains(Origin));
|
||||
@@ -187,11 +187,11 @@ namespace FATrace.WPLApp.ViewModels
|
||||
PageIndex = data.normalizedPage == 0 ? 1 : data.normalizedPage;
|
||||
});
|
||||
|
||||
_log.Info($"FactoryInventoryTransaction 查询完成,记录数: {TotalCount}");
|
||||
_log.Info($"FactoryRawInOutbound 查询完成,记录数: {TotalCount}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_log.Error($"FactoryInventoryTransaction 查询失败: {ex}");
|
||||
_log.Error($"FactoryRawInOutbound 查询失败: {ex}");
|
||||
MessageBox.Show($"查询失败: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user