123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <UserControl x:Class="OOO_WriteAndClear.MVP.Views.OrdersUserControl"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- 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"
- Loaded="OrdersUserControlLoaded">
- <UserControl.Resources>
-
- <Style x:Key="BackButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="Width" Value="35"/>
- <Setter Property="Height" Value="35"/>
- <Setter Property="Margin" Value="0 0 0 10"/>
- <Setter Property="VerticalAlignment" Value="Top"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Image Height="{TemplateBinding Height}"
- Width="{TemplateBinding Width}"
- Source="/Assets/Pictures/BackButton.png"/>
- </ControlTemplate>
- </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"
- Background="{Binding OrderBackGround}"
- 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">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Label Grid.Row="0"
- HorizontalAlignment="Center" VerticalAlignment="Center"
- Content="Заказы"
- FontSize="18" FontWeight="Bold"/>
- <Grid HorizontalAlignment="Right" VerticalAlignment="Top"
- Margin="0 0 10 0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- </Grid.RowDefinitions>
- <Image Grid.Column="0" Grid.RowSpan="2"
- Height="40" Width="40"
- VerticalAlignment="Top"
- Margin="0 0 10 0"
- Source="/Assets/Pictures/LoginFieldIcon.png"/>
- <TextBlock x:Name="DisplayingUserName"
- Grid.Column="1" Grid.Row="0"
- Text="Гость"
- Margin="0 0 0 5"/>
- <TextBlock x:Name="DisplayingUserRole"
- Grid.Column="1" Grid.Row="1"
- Foreground="Gray"/>
- </Grid>
- <Button Style="{DynamicResource BackButtonStyle}"
- HorizontalAlignment="Left" VerticalAlignment="Top"
- Click="Back_ButtonClick"/>
- <Grid Grid.Row="1" HorizontalAlignment="Stretch">
- <StackPanel Grid.Row="1"
- Margin="0 0 0 10"
- Orientation="Horizontal">
- <GroupBox Margin="0 0 10 0"
- Header="Фильтрация по суммарной скидке">
- <ComboBox x:Name="FilterComboBox"
- SelectionChanged="FilterChanged_SelectionChangedComboBox"/>
- </GroupBox>
- <GroupBox Header="Сортировка по цене">
- <ComboBox x:Name="SortComboBox"
- SelectionChanged="SortChanged_SelectionChangedComboBox"/>
- </GroupBox>
- </StackPanel>
- </Grid>
- <ListView x:Name="OrderListView"
- Grid.Row="2"
- HorizontalContentAlignment="Stretch"
- Style="{StaticResource OrdersListViewStyle}"
- d:ItemsSource="{d:SampleData ItemCount=5}"/>
- </Grid>
- </Border>
-
- </UserControl>
|