Explorar el Código

消费终端

Lishi
xxe hace 2 años
padre
commit
d577ffa73b
Se han modificado 3 ficheros con 61 adiciones y 25 borrados
  1. +1
    -1
      HKCardOUT/Logic/Service/HKCore.cs
  2. +5
    -6
      HKCardOUT/ViewModels/RootViewModel.cs
  3. +55
    -18
      HKCardOUT/Views/RootView.xaml

+ 1
- 1
HKCardOUT/Logic/Service/HKCore.cs Ver fichero

@@ -42,7 +42,7 @@ namespace HKCardOUT.Logic.Service
return DbContext.Context.Queryable<SaleLog>()
.Where(t => t.CreateTime >= Begin)
.Where(t => t.CreateTime < End)
.OrderByDescending(t => t.CreateTime).ToPageList(0, 10);
.OrderByDescending(t => t.CreateTime).ToPageList(0, 100);
}
}
}

+ 5
- 6
HKCardOUT/ViewModels/RootViewModel.cs Ver fichero

@@ -21,12 +21,11 @@ namespace HKCardOUT.ViewModels

protected override void OnViewLoaded()
{
Result = new ObservableCollection<SaleLog>(this.Container.Get<HKCore>().PullDaySaleLog());
//ThreadManage.GetInstance().Start(() =>
//{
// Result = new ObservableCollection<SaleLog>(this.Container.Get<HKCore>().PullDaySaleLog());
// Thread.Sleep(3000);
//}, "消费记录查询");
ThreadManage.GetInstance().Start(() =>
{
Result = new ObservableCollection<SaleLog>(this.Container.Get<HKCore>().PullDaySaleLog());
Thread.Sleep(3000);
}, "消费记录查询");
}

#region 属性


+ 55
- 18
HKCardOUT/Views/RootView.xaml Ver fichero

@@ -11,32 +11,69 @@
ShowMaxButton="False"
ShowMinButton="False"
ShowTitle="True"
Topmost="True"
WindowStartupLocation="CenterScreen"
WindowState="Maximized"
mc:Ignorable="d">
<hc:Window.Resources>
<Style x:Key="SaleLogHeader" TargetType="DataGridColumnHeader">
<Setter Property="FontSize" Value="18" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="White" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="CenterAlignmentStyle" TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="15" />
<Setter Property="Background" Value="Transparent" />
</Style>
</hc:Window.Resources>
<hc:Window.Background>
<ImageBrush ImageSource="/HKResouces/背景.jpg" />
</hc:Window.Background>
<DataGrid
AutoGenerateColumns="False"
Background="Transparent"
ItemsSource="{Binding Result}">
<DataGridTextColumn
Width="120"
Binding="{Binding CardNo}"
Header="卡号" />
<DataGridTextColumn
Width="120"
Binding="{Binding Money}"
Header="金额" />
<DataGridTextColumn
Width="120"
Binding="{Binding Location}"
Header="档口" />
<DataGridTextColumn
Width="120"
Binding="{Binding CreateTime}"
Header="消费时间" />
IsReadOnly="True"
ItemsSource="{Binding Result}"
Style="{StaticResource DataGridBaseStyle}">
<DataGrid.RowStyle>
<Style BasedOn="{StaticResource DataGridRowStyle}" TargetType="DataGridRow">
<Setter Property="Background" Value="Transparent" />
<Style.Triggers>
<Trigger Property="UIElement.IsMouseOver" Value="true">
<Setter Property="Background" Value="Transparent" />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn
Width="230"
Binding="{Binding CardNo}"
ElementStyle="{StaticResource CenterAlignmentStyle}"
Header="卡号"
HeaderStyle="{StaticResource SaleLogHeader}" />
<DataGridTextColumn
Width="230"
Binding="{Binding Money}"
ElementStyle="{StaticResource CenterAlignmentStyle}"
Header="金额"
HeaderStyle="{StaticResource SaleLogHeader}" />
<DataGridTextColumn
Width="230"
Binding="{Binding Location}"
ElementStyle="{StaticResource CenterAlignmentStyle}"
Header="档口"
HeaderStyle="{StaticResource SaleLogHeader}" />
<DataGridTextColumn
Width="230"
Binding="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
ElementStyle="{StaticResource CenterAlignmentStyle}"
Header="消费时间"
HeaderStyle="{StaticResource SaleLogHeader}" />
</DataGrid.Columns>
</DataGrid>
</hc:Window>

Cargando…
Cancelar
Guardar