@@ -31,6 +31,22 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
NotUseSmallDosing = GVL_SmallStation.GetInstance.NotUseSmallStation;
IsUseLocalRecipe = GVL_SmallStation.GetInstance.IsUseLocalRecipe;
IsUseWindSendDosing = GVL_SmallStation.GetInstance.IsUseWindSend;
var tempcoll = new ObservableCollection<RemoteRecipeData>();
foreach (var item in Json<LocalRecipeDataColl>.Data.SelectedRecipes)
{
if (!Json<LocalRecipeDataColl>.Data.Recipes.Any(p=>p.RecipeCode.Equals(item.RecipeCode)&&p.RecipeName.Equals(item.RecipeName)&&p.TrayCode==item.TrayCode))
{
tempcoll.Add(item);
}
}
foreach (var item in tempcoll)
{
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Remove(item);
}
Json<LocalRecipeDataColl>.Save();
tempcoll.Clear();
Recipes = Json<LocalRecipeDataColl>.Data.Recipes;
NewRecipe = new RelayCommand(() =>
@@ -48,6 +64,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
if (res != null)
{
Json<LocalRecipeDataColl>.Data.Recipes.Remove(res);
Json<LocalRecipeDataColl>.Save();
MessageNotify.GetInstance.ShowUserLog($"删除配方——{res.RecipeName}");
}
}
@@ -156,6 +173,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
//新增了配方之后应该默认显示出来。
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Add(newRemoteRecipedata);
Json<LocalRecipeDataColl>.Save();
MessageNotify.GetInstance.ShowUserLog("新增一条本地模拟配方。");
}
@@ -166,6 +184,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
Json<LocalRecipeDataColl>.Data.Recipes.Clear();
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Clear();
Json<LocalRecipeDataColl>.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"本地配方清空成功。");
MessageNotify.GetInstance.ShowUserLog("手动清除所有本地配方");
}