|
|
|
@ -27,6 +27,7 @@ using System.Windows.Interop;
|
|
|
|
|
using static Dm.net.buffer.ByteArrayBuffer;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Collections.Concurrent;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.RfidUpload.UI.viewModel
|
|
|
|
|
{
|
|
|
|
@ -51,9 +52,48 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
|
|
|
|
|
//暂存库存容器分发配发机构数据
|
|
|
|
|
private Institution Institution;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 参数定义
|
|
|
|
|
|
|
|
|
|
#region 5秒以后才可以点击
|
|
|
|
|
private bool _isButtonEnabled = true;
|
|
|
|
|
public bool IsButtonEnabled
|
|
|
|
|
{
|
|
|
|
|
get { return _isButtonEnabled; }
|
|
|
|
|
set { _isButtonEnabled = value; RaisePropertyChanged(() => IsButtonEnabled); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string finishText = "完成";
|
|
|
|
|
public string FinishText
|
|
|
|
|
{
|
|
|
|
|
get { return finishText; }
|
|
|
|
|
set { finishText = value; RaisePropertyChanged(() => FinishText); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void ButtonIsEnabled()
|
|
|
|
|
{
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
FinishText = "请等待..";
|
|
|
|
|
IsButtonEnabled = false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//Task.Run(() =>
|
|
|
|
|
//{
|
|
|
|
|
// Thread.Sleep(5000);
|
|
|
|
|
// Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
// {
|
|
|
|
|
// FinishText = "完成";
|
|
|
|
|
// IsButtonEnabled = true;
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
//});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -216,7 +256,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
|
|
|
|
|
ReUploadRecordCommand = new RelayCommand(ReUploadRecord);
|
|
|
|
|
this.Init();
|
|
|
|
|
|
|
|
|
|
// test1();
|
|
|
|
|
// test1();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void test1()
|
|
|
|
@ -366,6 +406,10 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
ButtonIsEnabled();
|
|
|
|
|
|
|
|
|
|
// MessageBox.Show("数据上传中...5s以后才能再次点击");
|
|
|
|
|
|
|
|
|
|
if (workModelParam == 1) //新容器入库
|
|
|
|
|
{
|
|
|
|
|
var info = labelItems.ToList();
|
|
|
|
@ -555,6 +599,13 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
|
|
|
|
|
}catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(ex.Message);
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
FinishText = "完成";
|
|
|
|
|
IsButtonEnabled = true;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
@ -615,18 +666,24 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void EmptyFiles()
|
|
|
|
|
{
|
|
|
|
|
No = 0;
|
|
|
|
|
No = 0;
|
|
|
|
|
labelItems.Clear(); // 清空 labelItems 集合
|
|
|
|
|
LabelInfoDataGrid = Enumerable.Empty<DataGridEnt>();
|
|
|
|
|
|
|
|
|
|
LabelCountParam = 0;
|
|
|
|
|
_rfidQueue.Clear();
|
|
|
|
|
_dataGridQueue.Clear();
|
|
|
|
|
_labelResultSet.Clear();
|
|
|
|
|
|
|
|
|
|
MainPageTipMessage = "";
|
|
|
|
|
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
FinishText = "完成";
|
|
|
|
|
IsButtonEnabled = true;
|
|
|
|
|
labelItems.Clear(); // 清空 labelItems 集合
|
|
|
|
|
LabelInfoDataGrid = Enumerable.Empty<DataGridEnt>();
|
|
|
|
|
|
|
|
|
|
LabelCountParam = 0;
|
|
|
|
|
_rfidQueue.Clear();
|
|
|
|
|
_dataGridQueue.Clear();
|
|
|
|
|
_labelResultSet.Clear();
|
|
|
|
|
No = 0;
|
|
|
|
|
|
|
|
|
|
MainPageTipMessage = "";
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sqliteHelper.DeleteRFIDList();
|
|
|
|
|
GetRfidList();
|
|
|
|
|
|
|
|
|
@ -736,6 +793,10 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
|
|
|
|
|
/// <param name="code"></param>
|
|
|
|
|
private void RefreshLabelInfoDataGrid(string code)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(_transferOrderInfo.dbdh))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 检查是否已存在
|
|
|
|
|
if (_labelResultSet.Contains(code))
|
|
|
|
|
{
|
|
|
|
|