From 6e314ba49a484f853cabe8e571fbadf49157b684 Mon Sep 17 00:00:00 2001 From: lyw <刘耀文@DESKTOP-E1TI268> Date: Tue, 8 Oct 2024 16:43:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=A2=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=EF=BC=8C=E5=8F=8A=E4=BF=9D=E5=AD=98=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPASmartClient.ViewModel/FoodMenuViewModel.cs | 5 ++--- BPASmartClient/App.xaml.cs | 3 ++- BPASmartClient/Control/FoodMenuView.xaml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BPASmartClient.ViewModel/FoodMenuViewModel.cs b/BPASmartClient.ViewModel/FoodMenuViewModel.cs index 49525038..95c89733 100644 --- a/BPASmartClient.ViewModel/FoodMenuViewModel.cs +++ b/BPASmartClient.ViewModel/FoodMenuViewModel.cs @@ -45,9 +45,8 @@ namespace BPASmartClient.ViewModel { SearCh = new BPARelayCommand(() => { - int re = SearchDate.Day; history.Clear(); - if (re<=DateTime.Now.Day) + if ((DateTime.Now- SearchDate).TotalDays>0) { var res = Json.Data.historyOrderLists.Where(o => o.Date.Day == SearchDate.Day); if (res != null && res.ToList().Count > 0) @@ -61,7 +60,7 @@ namespace BPASmartClient.ViewModel } else { - NoodOrderCtrl.GetInstance.Show("超出当前日期,请重新选择时间!"); + NoodOrderCtrl.GetInstance.Show("超出当前日期!"); } }); } diff --git a/BPASmartClient/App.xaml.cs b/BPASmartClient/App.xaml.cs index aaec0825..3cff8159 100644 --- a/BPASmartClient/App.xaml.cs +++ b/BPASmartClient/App.xaml.cs @@ -155,9 +155,10 @@ namespace BPASmartClient { Json.Data.historyOrderLists.ToList().ForEach(o => { - if (DateTime.Now.Month- o.Date.Month>2) + if ((DateTime.Now- o.Date).TotalDays>60) { Json.Data.historyOrderLists.Remove(o); + Json.Save(); } }); } diff --git a/BPASmartClient/Control/FoodMenuView.xaml b/BPASmartClient/Control/FoodMenuView.xaml index 76df78a2..46f843e8 100644 --- a/BPASmartClient/Control/FoodMenuView.xaml +++ b/BPASmartClient/Control/FoodMenuView.xaml @@ -83,7 +83,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -160,7 +160,7 @@ - +