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 @@ - +