|
@@ -4,9 +4,11 @@
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
xmlns:local="clr-namespace:OOO_WriteAndClear.MVP.Views"
|
|
|
+ xmlns:db_models="clr-namespace:OOO_WriteAndClear.DBModels"
|
|
|
mc:Ignorable="d" d:Background="White"
|
|
|
d:DesignHeight="450" d:DesignWidth="800"
|
|
|
- FontFamily="Comic Sans MS">
|
|
|
+ FontFamily="Comic Sans MS"
|
|
|
+ Loaded="OrdersUserControlLoaded">
|
|
|
|
|
|
<UserControl.Resources>
|
|
|
|
|
@@ -25,7 +27,110 @@
|
|
|
</Setter.Value>
|
|
|
</Setter>
|
|
|
</Style>
|
|
|
-
|
|
|
+
|
|
|
+ <Style x:Key="OrdersListViewStyle" TargetType="{x:Type ListView}">
|
|
|
+
|
|
|
+ <Setter Property="BorderThickness" Value="0"/>
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
|
+
|
|
|
+ <Setter Property="ItemTemplate">
|
|
|
+ <Setter.Value>
|
|
|
+ <DataTemplate DataType="db_models:Order">
|
|
|
+ <Border Padding="10"
|
|
|
+ BorderThickness="1" BorderBrush="Black"
|
|
|
+ CornerRadius="10">
|
|
|
+ <Grid HorizontalAlignment="Stretch">
|
|
|
+
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="1*"/>
|
|
|
+ <ColumnDefinition Width="1*"/>
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="auto"/>
|
|
|
+ <RowDefinition/>
|
|
|
+ <RowDefinition Height="auto"/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <TextBlock Grid.ColumnSpan="2"
|
|
|
+ HorizontalAlignment="Center" VerticalAlignment="Top"
|
|
|
+ Text="{Binding OrderId, StringFormat=Номер заказа №{0}}" />
|
|
|
+
|
|
|
+ <StackPanel Grid.Row="1" Grid.Column="0"
|
|
|
+ Margin="0 5 0 0"
|
|
|
+ Orientation="Vertical">
|
|
|
+
|
|
|
+ <TextBlock Text="{Binding OrderCustomer, StringFormat=Заказчик: {0}, TargetNullValue=NA}"/>
|
|
|
+
|
|
|
+ <TextBlock Text="{Binding OrderStatus.OrderStatusName, StringFormat=Статус: {0}}"/>
|
|
|
+
|
|
|
+ <TextBlock Text="{Binding OrderCreateDate, StringFormat=Дата создания: {0}}"/>
|
|
|
+
|
|
|
+ <TextBlock Text="{Binding OrderDeliveryDate, StringFormat=Дата готовности: {0}}"/>
|
|
|
+
|
|
|
+ <TextBlock Text="{Binding OrderPickupPoint.PickupPointAdress, StringFormat=Адресс пункта выдачи: {0}}"
|
|
|
+ TextWrapping="Wrap"/>
|
|
|
+
|
|
|
+ <TextBlock Text="{Binding OrderCostWithoutDiscount, StringFormat=Цена без скидки {0:f2} руб.}"/>
|
|
|
+
|
|
|
+ <TextBlock Text="{Binding OrderReceiveCode, StringFormat=Код получения заказа: {0}}"/>
|
|
|
+
|
|
|
+ </StackPanel>
|
|
|
+
|
|
|
+ <Border Grid.Column="1" Grid.Row="1"
|
|
|
+ Margin="0 5 0 0">
|
|
|
+ <DataGrid
|
|
|
+ ItemsSource="{Binding OrderProducts}"
|
|
|
+ IsReadOnly="True"
|
|
|
+ AutoGenerateColumns="False"
|
|
|
+ Background="White"
|
|
|
+ CanUserResizeColumns="False">
|
|
|
+
|
|
|
+ <DataGrid.Columns>
|
|
|
+
|
|
|
+ <DataGridTextColumn Header="Количество"
|
|
|
+ CanUserSort="False"
|
|
|
+ Binding="{Binding ProductAmount}"/>
|
|
|
+
|
|
|
+ <DataGridTextColumn Header="Артикул"
|
|
|
+ CanUserSort="False"
|
|
|
+ Binding="{Binding ProductArticleNumber}"/>
|
|
|
+
|
|
|
+ <DataGridTextColumn Header="Продукт"
|
|
|
+ CanUserSort="False"
|
|
|
+ Binding="{Binding ProductArticleNumberNavigation.ProductName}"/>
|
|
|
+
|
|
|
+ <DataGridTextColumn Header="Цена без скидки"
|
|
|
+ CanUserSort="False"
|
|
|
+ Binding="{Binding PriceWithoutDiscount, StringFormat={}{0:f2} руб.}"/>
|
|
|
+
|
|
|
+ <DataGridTextColumn Header="Цена со скидкой"
|
|
|
+ CanUserSort="False"
|
|
|
+ Binding="{Binding Price, StringFormat={}{0:f2} руб.}"/>
|
|
|
+
|
|
|
+ </DataGrid.Columns>
|
|
|
+
|
|
|
+ </DataGrid>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="2" Grid.ColumnSpan="2"
|
|
|
+ HorizontalAlignment="Center"
|
|
|
+ Margin="0 5 0 0"
|
|
|
+ Text="{Binding OrderCost, StringFormat=Итог: {0:f2} руб.}"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="2" Grid.ColumnSpan="2"
|
|
|
+ HorizontalAlignment="Right"
|
|
|
+ Margin="0 5 0 0"
|
|
|
+ Text="{Binding OrderDiscountPercent, StringFormat=Суммарная скидка: {0:p2}}"/>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+ </Border>
|
|
|
+ </DataTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+
|
|
|
+ </Style>
|
|
|
+
|
|
|
</UserControl.Resources>
|
|
|
|
|
|
<Border Padding="10">
|
|
@@ -84,20 +189,22 @@
|
|
|
|
|
|
<GroupBox Margin="0 0 10 0"
|
|
|
Header="Фильтрация по суммарной скидке">
|
|
|
- <ComboBox x:Name="FilterComboBox"
|
|
|
- />
|
|
|
+ <ComboBox x:Name="FilterComboBox"/>
|
|
|
</GroupBox>
|
|
|
|
|
|
<GroupBox Header="Сортировка по цене">
|
|
|
- <ComboBox x:Name="SortComboBox"
|
|
|
- />
|
|
|
+ <ComboBox x:Name="SortComboBox"/>
|
|
|
</GroupBox>
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
- <ListView Grid.Row="2"/>
|
|
|
+ <ListView x:Name="OrderListView"
|
|
|
+ Grid.Row="2"
|
|
|
+ HorizontalContentAlignment="Stretch"
|
|
|
+ Style="{StaticResource OrdersListViewStyle}"
|
|
|
+ d:ItemsSource="{d:SampleData ItemCount=5}"/>
|
|
|
|
|
|
</Grid>
|
|
|
</Border>
|