OrderReceiptWindow.xaml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <Window x:Class="OOO_WriteAndClear.MVP.Views.OrderReceipt"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:OOO_WriteAndClear.MVP.Views"
  7. mc:Ignorable="d" Icon="../../Assets/Pictures/icon.ico"
  8. Title="Пиши-стирай | Талон заказа" Height="450" Width="1200"
  9. MinWidth="1200" MinHeight="450"
  10. FontFamily="Comic Sans MS">
  11. <Window.Resources>
  12. <Style x:Key="OrdersListViewStyle" TargetType="{x:Type ListView}">
  13. <Setter Property="BorderThickness" Value="0"/>
  14. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  15. <Setter Property="ItemTemplate">
  16. <Setter.Value>
  17. <DataTemplate DataType="db_models:Order">
  18. <Border Padding="10"
  19. BorderBrush="Black"
  20. CornerRadius="10">
  21. <Grid HorizontalAlignment="Stretch">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="1*"/>
  24. <ColumnDefinition Width="1*"/>
  25. </Grid.ColumnDefinitions>
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="auto"/>
  28. <RowDefinition/>
  29. <RowDefinition Height="auto"/>
  30. </Grid.RowDefinitions>
  31. <TextBlock Grid.ColumnSpan="2"
  32. HorizontalAlignment="Center" VerticalAlignment="Top"
  33. Text="{Binding OrderId, StringFormat=Номер заказа №{0}}" />
  34. <StackPanel Grid.Row="1" Grid.Column="0"
  35. Margin="0 5 0 0"
  36. Orientation="Vertical">
  37. <TextBlock Text="{Binding OrderCustomer, StringFormat=Заказчик: {0}, TargetNullValue=NA}"/>
  38. <TextBlock Text="{Binding OrderCreateDate, StringFormat=Дата создания: {0}}"/>
  39. <TextBlock Text="{Binding OrderDeliveryDate, StringFormat=Дата готовности: {0}}"/>
  40. <TextBlock Text="{Binding OrderPickupPoint.PickupPointAdress, StringFormat=Адресс пункта выдачи: {0}}"
  41. TextWrapping="Wrap"/>
  42. <TextBlock Text="{Binding OrderCostWithoutDiscount, StringFormat=Цена без скидки {0:f2} руб.}"/>
  43. <TextBlock Text="{Binding OrderReceiveCode, StringFormat=Код получения заказа: {0}}"/>
  44. </StackPanel>
  45. <Border Grid.Column="1" Grid.Row="1"
  46. Margin="0 5 0 0">
  47. <DataGrid
  48. ItemsSource="{Binding OrderProducts}"
  49. IsReadOnly="True"
  50. AutoGenerateColumns="False"
  51. Background="White"
  52. CanUserResizeColumns="False">
  53. <DataGrid.Columns>
  54. <DataGridTextColumn Header="Количество"
  55. CanUserSort="False"
  56. Binding="{Binding ProductAmount}"/>
  57. <DataGridTextColumn Header="Артикул"
  58. CanUserSort="False"
  59. Binding="{Binding ProductArticleNumber}"/>
  60. <DataGridTextColumn Header="Продукт"
  61. CanUserSort="False"
  62. Binding="{Binding ProductArticleNumberNavigation.ProductName}"/>
  63. <DataGridTextColumn Header="Цена без скидки"
  64. CanUserSort="False"
  65. Binding="{Binding PriceWithoutDiscount, StringFormat={}{0:f2} руб.}"/>
  66. <DataGridTextColumn Header="Цена со скидкой"
  67. CanUserSort="False"
  68. Binding="{Binding Price, StringFormat={}{0:f2} руб.}"/>
  69. </DataGrid.Columns>
  70. </DataGrid>
  71. </Border>
  72. <TextBlock Grid.Row="2" Grid.ColumnSpan="2"
  73. HorizontalAlignment="Center"
  74. Margin="0 5 0 0"
  75. Text="{Binding OrderCost, StringFormat=Итог: {0:f2} руб.}"/>
  76. <TextBlock Grid.Row="2" Grid.ColumnSpan="2"
  77. HorizontalAlignment="Right"
  78. Margin="0 5 0 0"
  79. Text="{Binding OrderDiscountPercent, StringFormat=Суммарная скидка: {0:p2}}"/>
  80. </Grid>
  81. </Border>
  82. </DataTemplate>
  83. </Setter.Value>
  84. </Setter>
  85. </Style>
  86. </Window.Resources>
  87. <Grid>
  88. <Grid.RowDefinitions>
  89. <RowDefinition Height="auto"/>
  90. <RowDefinition/>
  91. </Grid.RowDefinitions>
  92. <Label Grid.Row="0"
  93. HorizontalAlignment="Center"
  94. FontSize="18" FontWeight="Bold"
  95. Content="Талон заказа"/>
  96. <ListView x:Name="ConfirmedOrder"
  97. Grid.Row="1"
  98. Style="{StaticResource OrdersListViewStyle}"
  99. d:ItemsSource="{d:SampleData ItemCount=5}"/>
  100. </Grid>
  101. </Window>