Sfoglia il codice sorgente

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

煮面机(新)
lyw 2 mesi fa
parent
commit
6e314ba49a
3 ha cambiato i file con 7 aggiunte e 7 eliminazioni
  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 Vedi File

@@ -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<NoodOrder>.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("超出当前日期!");
}
});
}


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

@@ -155,9 +155,10 @@ namespace BPASmartClient
{
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>.Save();
}
});
}


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

@@ -83,7 +83,7 @@
<ItemsControl Background="#D7D7D7" ItemsSource="{Binding orderStatusLists}">
<ItemsControl.ItemTemplate>
<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.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@@ -122,7 +122,7 @@
<ItemsControl Background="#D7D7D7" ItemsSource="{Binding WaitTakeMeal,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
<ItemsControl.ItemTemplate>
<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.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@@ -160,7 +160,7 @@
<ItemsControl Background="#D7D7D7" ItemsSource="{Binding history,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
<ItemsControl.ItemTemplate>
<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.ColumnDefinitions>
<ColumnDefinition Width="*"/>


Caricamento…
Annulla
Salva