|
@@ -1,5 +1,6 @@ |
|
|
using BPASmartClient.MorkCL.Model.DB; |
|
|
using BPASmartClient.MorkCL.Model.DB; |
|
|
using BPASmartClient.MorkCL.Server; |
|
|
using BPASmartClient.MorkCL.Server; |
|
|
|
|
|
using SqlSugar; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
@@ -14,72 +15,127 @@ namespace BPASmartClient.MorkCL.ViewModel |
|
|
{ |
|
|
{ |
|
|
testCommand = new BPARelayCommand(() => |
|
|
testCommand = new BPARelayCommand(() => |
|
|
{ |
|
|
{ |
|
|
SqliteHelper.GetInstance.Init(); |
|
|
|
|
|
|
|
|
ControlData cd = new ControlData(); |
|
|
|
|
|
cd.Name = "莲白回锅"; |
|
|
|
|
|
cd.DeviceType = EDeviceType.炒锅1; |
|
|
|
|
|
|
|
|
for (int i = 0; i < 10; i++) |
|
|
|
|
|
|
|
|
cd.ControlFuncs.Enqueue(new FuncModel() |
|
|
{ |
|
|
{ |
|
|
SqliteHelper.GetInstance.AddAccessories(new Model.DB.AccessoriesTB() |
|
|
|
|
|
{ |
|
|
|
|
|
Description = "AccessoriesTB", |
|
|
|
|
|
Loc = 1, |
|
|
|
|
|
Name = $"AccessoriesTB{i}" |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
SqliteHelper.GetInstance.AddIngredients(new Model.DB.IngredientsTB() |
|
|
|
|
|
{ |
|
|
|
|
|
Description = "IngredientsTB", |
|
|
|
|
|
Loc = 1, |
|
|
|
|
|
Name = $"IngredientsTB{i}" |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
SqliteHelper.GetInstance.AddSeasoning(new Model.DB.SeasoningTB() |
|
|
|
|
|
{ |
|
|
|
|
|
Description = "SeasoningTB", |
|
|
|
|
|
Loc = 1, |
|
|
|
|
|
Name = $"SeasoningTB{i}" |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var Accessories = SqliteHelper.GetInstance.GetAccessories(); |
|
|
|
|
|
var Ingredients = SqliteHelper.GetInstance.GetIngredients(); |
|
|
|
|
|
var Seasoning = SqliteHelper.GetInstance.GetSeasoning(); |
|
|
|
|
|
|
|
|
|
|
|
Accessories?.ForEach(x => |
|
|
|
|
|
|
|
|
eFunc = EFunc.加热启动, |
|
|
|
|
|
funcPars = new FuncPar[1] { new FuncPar() { ParValue = 1 } }.ToList() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
cd.ControlFuncs.Enqueue(new FuncModel() |
|
|
|
|
|
{ |
|
|
|
|
|
eFunc = EFunc.炒制, |
|
|
|
|
|
funcPars = new FuncPar[1] { new FuncPar() { ParValue = 10 } }.ToList() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
cd.ControlFuncs.Enqueue(new FuncModel() |
|
|
|
|
|
{ |
|
|
|
|
|
eFunc = EFunc.搅拌启动, |
|
|
|
|
|
funcPars = new FuncPar[1] { new FuncPar() { ParValue = 30 } }.ToList() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
cd.ControlFuncs.Enqueue(new FuncModel() |
|
|
|
|
|
{ |
|
|
|
|
|
eFunc = EFunc.添加调料, |
|
|
|
|
|
funcPars = new FuncPar[1] { new FuncPar() { ParValue = 30, Id = "" } }.ToList() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
cd.ControlFuncs.Enqueue(new FuncModel() |
|
|
{ |
|
|
{ |
|
|
SqliteHelper.GetInstance.EditAccessories(new Model.DB.AccessoriesTB() |
|
|
|
|
|
{ |
|
|
|
|
|
Description = "AccessoriesTB1111", |
|
|
|
|
|
Loc = x.Loc, |
|
|
|
|
|
Name = x.Name, |
|
|
|
|
|
Id = x.Id |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
eFunc = EFunc.添加调料, |
|
|
|
|
|
funcPars = new FuncPar[1] { new FuncPar() { ParValue = 30, Id = "" } }.ToList() |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
Ingredients?.ForEach(x => |
|
|
|
|
|
|
|
|
cd.ControlFuncs.Enqueue(new FuncModel() |
|
|
{ |
|
|
{ |
|
|
SqliteHelper.GetInstance.EditIngredients(new Model.DB.IngredientsTB() |
|
|
|
|
|
{ |
|
|
|
|
|
Description = "IngredientsTB1111", |
|
|
|
|
|
Loc = x.Loc, |
|
|
|
|
|
Name = x.Name, |
|
|
|
|
|
Id = x.Id |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
eFunc = EFunc.添加调料, |
|
|
|
|
|
funcPars = new FuncPar[1] { new FuncPar() { ParValue = 30, Id = "" } }.ToList() |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
Seasoning?.ForEach(x => |
|
|
|
|
|
|
|
|
cd.ControlFuncs.Enqueue(new FuncModel() |
|
|
{ |
|
|
{ |
|
|
SqliteHelper.GetInstance.EditSeasoning(new Model.DB.SeasoningTB() |
|
|
|
|
|
{ |
|
|
|
|
|
Description = "SeasoningTB1111", |
|
|
|
|
|
Loc = x.Loc, |
|
|
|
|
|
Name = x.Name, |
|
|
|
|
|
Id = x.Id |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
eFunc = EFunc.添加辅料, |
|
|
|
|
|
funcPars = new FuncPar[1] { new FuncPar() { ParValue = 30, Id = "" } }.ToList() |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
var Accessories1 = SqliteHelper.GetInstance.GetAccessories(); |
|
|
|
|
|
var Ingredients1 = SqliteHelper.GetInstance.GetIngredients(); |
|
|
|
|
|
var Seasoning1 = SqliteHelper.GetInstance.GetSeasoning(); |
|
|
|
|
|
|
|
|
ActionManage.GetInstance.Send(NotifyTopic.FormulaDistribution, cd); |
|
|
|
|
|
//ActionManage.GetInstance.Register(new Action<object>(o => |
|
|
|
|
|
//{ |
|
|
|
|
|
// if (o != null && o is ControlData cd) morkCL.cds.Enqueue(cd); |
|
|
|
|
|
//}), NotifyTopic.FormulaDistribution); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//SqliteHelper.GetInstance.Init(); |
|
|
|
|
|
|
|
|
|
|
|
//for (int i = 0; i < 10; i++) |
|
|
|
|
|
//{ |
|
|
|
|
|
// SqliteHelper.GetInstance.AddAccessories(new Model.DB.AccessoriesTB() |
|
|
|
|
|
// { |
|
|
|
|
|
// Description = "AccessoriesTB", |
|
|
|
|
|
// Loc = 1, |
|
|
|
|
|
// Name = $"AccessoriesTB{i}" |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
// SqliteHelper.GetInstance.AddIngredients(new Model.DB.IngredientsTB() |
|
|
|
|
|
// { |
|
|
|
|
|
// Description = "IngredientsTB", |
|
|
|
|
|
// Loc = 1, |
|
|
|
|
|
// Name = $"IngredientsTB{i}" |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
// SqliteHelper.GetInstance.AddSeasoning(new Model.DB.SeasoningTB() |
|
|
|
|
|
// { |
|
|
|
|
|
// Description = "SeasoningTB", |
|
|
|
|
|
// Loc = 1, |
|
|
|
|
|
// Name = $"SeasoningTB{i}" |
|
|
|
|
|
// }); |
|
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
|
|
//var Accessories = SqliteHelper.GetInstance.GetAccessories(); |
|
|
|
|
|
//var Ingredients = SqliteHelper.GetInstance.GetIngredients(); |
|
|
|
|
|
//var Seasoning = SqliteHelper.GetInstance.GetSeasoning(); |
|
|
|
|
|
|
|
|
|
|
|
//Accessories?.ForEach(x => |
|
|
|
|
|
//{ |
|
|
|
|
|
// SqliteHelper.GetInstance.EditAccessories(new Model.DB.AccessoriesTB() |
|
|
|
|
|
// { |
|
|
|
|
|
// Description = "AccessoriesTB1111", |
|
|
|
|
|
// Loc = x.Loc, |
|
|
|
|
|
// Name = x.Name, |
|
|
|
|
|
// Id = x.Id |
|
|
|
|
|
// }); |
|
|
|
|
|
//}); |
|
|
|
|
|
|
|
|
|
|
|
//Ingredients?.ForEach(x => |
|
|
|
|
|
//{ |
|
|
|
|
|
// SqliteHelper.GetInstance.EditIngredients(new Model.DB.IngredientsTB() |
|
|
|
|
|
// { |
|
|
|
|
|
// Description = "IngredientsTB1111", |
|
|
|
|
|
// Loc = x.Loc, |
|
|
|
|
|
// Name = x.Name, |
|
|
|
|
|
// Id = x.Id |
|
|
|
|
|
// }); |
|
|
|
|
|
//}); |
|
|
|
|
|
|
|
|
|
|
|
//Seasoning?.ForEach(x => |
|
|
|
|
|
//{ |
|
|
|
|
|
// SqliteHelper.GetInstance.EditSeasoning(new Model.DB.SeasoningTB() |
|
|
|
|
|
// { |
|
|
|
|
|
// Description = "SeasoningTB1111", |
|
|
|
|
|
// Loc = x.Loc, |
|
|
|
|
|
// Name = x.Name, |
|
|
|
|
|
// Id = x.Id |
|
|
|
|
|
// }); |
|
|
|
|
|
//}); |
|
|
|
|
|
|
|
|
|
|
|
//var Accessories1 = SqliteHelper.GetInstance.GetAccessories(); |
|
|
|
|
|
//var Ingredients1 = SqliteHelper.GetInstance.GetIngredients(); |
|
|
|
|
|
//var Seasoning1 = SqliteHelper.GetInstance.GetSeasoning(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|