Browse Source

历史订单查询,及保存日期更改

煮面机(新)
lyw 2 months ago
parent
commit
6e314ba49a
3 changed files with 7 additions and 7 deletions
  1. +2
    -3
      BPASmartClient.ViewModel/FoodMenuViewModel.cs
  2. +2
    -1
      BPASmartClient/App.xaml.cs
  3. +3
    -3
      BPASmartClient/Control/FoodMenuView.xaml

+ 2
- 3
BPASmartClient.ViewModel/FoodMenuViewModel.cs View File

@@ -45,9 +45,8 @@ namespace BPASmartClient.ViewModel
{ {
SearCh = new BPARelayCommand(() => SearCh = new BPARelayCommand(() =>
{ {
int re = SearchDate.Day;
history.Clear(); history.Clear();
if (re<=DateTime.Now.Day)
if ((DateTime.Now- SearchDate).TotalDays>0)
{ {
var res = Json<NoodOrder>.Data.historyOrderLists.Where(o => o.Date.Day == SearchDate.Day); var res = Json<NoodOrder>.Data.historyOrderLists.Where(o => o.Date.Day == SearchDate.Day);
if (res != null && res.ToList().Count > 0) if (res != null && res.ToList().Count > 0)
@@ -61,7 +60,7 @@ namespace BPASmartClient.ViewModel
} }
else else
{ {
NoodOrderCtrl.GetInstance.Show("超出当前日期,请重新选择时间!");
NoodOrderCtrl.GetInstance.Show("超出当前日期!");
} }
}); });
} }


+ 2
- 1
BPASmartClient/App.xaml.cs View File

@@ -155,9 +155,10 @@ namespace BPASmartClient
{ {
Json<NoodOrder>.Data.historyOrderLists.ToList().ForEach(o => Json<NoodOrder>.Data.historyOrderLists.ToList().ForEach(o =>
{ {
if (DateTime.Now.Month- o.Date.Month>2)
if ((DateTime.Now- o.Date).TotalDays>60)
{ {
Json<NoodOrder>.Data.historyOrderLists.Remove(o); Json<NoodOrder>.Data.historyOrderLists.Remove(o);
Json<NoodOrder>.Save();
} }
}); });
} }


+ 3
- 3
BPASmartClient/Control/FoodMenuView.xaml View File

@@ -83,7 +83,7 @@
<ItemsControl Background="#D7D7D7" ItemsSource="{Binding orderStatusLists}"> <ItemsControl Background="#D7D7D7" ItemsSource="{Binding orderStatusLists}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Border CornerRadius="10" Height="60" Margin="0,10,0,0" Background="{Binding OrderStatus, Converter={StaticResource ColorConverter}}">
<Border CornerRadius="10" Height="60" Margin="0,10,0,0" BorderBrush="Black" BorderThickness="5" Background="{Binding OrderStatus, Converter={StaticResource ColorConverter}}">
<Grid > <Grid >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
@@ -122,7 +122,7 @@
<ItemsControl Background="#D7D7D7" ItemsSource="{Binding WaitTakeMeal,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"> <ItemsControl Background="#D7D7D7" ItemsSource="{Binding WaitTakeMeal,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Border CornerRadius="10" Height="60" Margin="0,10,0,0" Background="{Binding OrderStatus, Converter={StaticResource ColorConverter}}">
<Border CornerRadius="10" Height="60" Margin="0,10,0,0" BorderBrush="Black" BorderThickness="5" Background="{Binding OrderStatus, Converter={StaticResource ColorConverter}}">
<Grid > <Grid >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
@@ -160,7 +160,7 @@
<ItemsControl Background="#D7D7D7" ItemsSource="{Binding history,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"> <ItemsControl Background="#D7D7D7" ItemsSource="{Binding history,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Border CornerRadius="10" Height="60" Margin="0,10,0,0" Background="{Binding OrderStatus, Converter={StaticResource ColorConverter}}">
<Border CornerRadius="10" Height="60" Margin="0,10,0,0" BorderThickness="5" BorderBrush="Black" Background="{Binding OrderStatus, Converter={StaticResource ColorConverter}}">
<Grid > <Grid >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>


Loading…
Cancel
Save