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