|
|
@@ -9,6 +9,7 @@ using System.Collections.ObjectModel; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading; |
|
|
|
using System.Windows.Media; |
|
|
|
using HKControl; |
|
|
|
|
|
|
|
namespace HKCardOUT.ViewModels |
|
|
|
{ |
|
|
@@ -19,8 +20,8 @@ namespace HKCardOUT.ViewModels |
|
|
|
{ |
|
|
|
ALInfo = new ObservableCollection<ScreenInfoDto>(); |
|
|
|
ARInfo = new ObservableCollection<ScreenInfoDto>(); |
|
|
|
_LInfo = new ScreenInfoDto() { UserName = "--" }; |
|
|
|
_RInfo = new ScreenInfoDto() { UserName = "--" }; |
|
|
|
_LInfo = new ScreenInfoDto(); |
|
|
|
_RInfo = new ScreenInfoDto(); |
|
|
|
} |
|
|
|
|
|
|
|
#region 属性 |
|
|
@@ -108,14 +109,41 @@ namespace HKCardOUT.ViewModels |
|
|
|
if (Foods == null) |
|
|
|
{ |
|
|
|
string GateId = string.Empty; |
|
|
|
int[] loc = new int[2]; |
|
|
|
if (ScreenLoc == 0) |
|
|
|
{ |
|
|
|
loc[0] = 0; |
|
|
|
loc[1] = 1; |
|
|
|
GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "02" || t.Address == "01").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
} |
|
|
|
else if (ScreenLoc == 1) |
|
|
|
{ |
|
|
|
loc[0] = 4; |
|
|
|
loc[1] = 5; |
|
|
|
GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "05" || t.Address == "06").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
} |
|
|
|
else if (ScreenLoc == 2) |
|
|
|
{ |
|
|
|
loc[0] = 2; |
|
|
|
loc[1] = 3; |
|
|
|
GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "03" || t.Address == "04").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
} |
|
|
|
var res = DataBus.Menu.GateFood.Where(t => t.GateId == GateId)?.Select(t => t.Foods)?.FirstOrDefault(); |
|
|
|
if (res != null) Foods = new ObservableCollection<string>(res); |
|
|
|
Main.GetInstance.CompleteNotify[loc[0]] = new Action(() => |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
})); |
|
|
|
}); |
|
|
|
Main.GetInstance.CompleteNotify[loc[1]] = new Action(() => |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
})); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@@ -124,6 +152,7 @@ namespace HKCardOUT.ViewModels |
|
|
|
{ |
|
|
|
|
|
|
|
FoodsInit(BindScreen); |
|
|
|
|
|
|
|
ThreadManage.GetInstance().StartLong(() => |
|
|
|
{ |
|
|
|
var model = (new HKCore()).PullDaySaleLog(BindScreen); |
|
|
@@ -170,37 +199,37 @@ namespace HKCardOUT.ViewModels |
|
|
|
|
|
|
|
if (BindScreen == 1) |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
}); |
|
|
|
//App.Current.Dispatcher.Invoke(() => |
|
|
|
//{ |
|
|
|
// if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
// ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
// ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
//}); |
|
|
|
LInfo = data.Location == "6" ? data : new ScreenInfoDto(); |
|
|
|
RInfo = data.Location == "5" ? data : new ScreenInfoDto(); |
|
|
|
} |
|
|
|
if (BindScreen == 0) |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
}); |
|
|
|
//App.Current.Dispatcher.Invoke(() => |
|
|
|
//{ |
|
|
|
// if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
// ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
// ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
//}); |
|
|
|
LInfo = data.Location == "2" ? data : new ScreenInfoDto(); |
|
|
|
RInfo = data.Location == "1" ? data : new ScreenInfoDto(); |
|
|
|
} |
|
|
|
if (BindScreen == 2) |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
}); |
|
|
|
//App.Current.Dispatcher.Invoke(() => |
|
|
|
//{ |
|
|
|
// if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
// ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
// ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
//}); |
|
|
|
LInfo = data.Location == "4" ? data : new ScreenInfoDto(); |
|
|
|
RInfo = data.Location == "3" ? data : new ScreenInfoDto(); |
|
|
|
} |
|
|
|