CostWindow.xaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <Window x:Class="mysql_connector2.Windows.CostWindow"
  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:mysql_connector2.Windows"
  7. mc:Ignorable="d"
  8. Title="CostWindow" Height="450" Width="800" Name="root">
  9. <Grid>
  10. <Grid.ColumnDefinitions>
  11. <ColumnDefinition Width="auto"/>
  12. <ColumnDefinition Width="*"/>
  13. <ColumnDefinition Width="auto"/>
  14. </Grid.ColumnDefinitions>
  15. <StackPanel
  16. Grid.Column="1"
  17. Margin="5">
  18. <Label Content="Артикул"/>
  19. <TextBox
  20. Text="{Binding currentProduct.ArticleNumber}"/>
  21. <Label Content="Наименование продукта"/>
  22. <TextBox Text="{Binding currentProduct.Title}"/>
  23. <ComboBox
  24. Name="ProductTypeComboBox"
  25. ItemsSource="{Binding productTypeList}"
  26. SelectedIndex="{Binding selectedProductIndex}"/>
  27. <Label Content="количество человек для производства"/>
  28. <TextBox
  29. AcceptsReturn="True"
  30. Text="{Binding currentProduct.ProductionPersonCount}"/>
  31. <Label Content="номер производственного цеха"/>
  32. <TextBox
  33. AcceptsReturn="True"
  34. Text="{Binding currentProduct.ProductionWorkshopNumber}"/>
  35. <Label Content="минимальная стоимость для агента"/>
  36. <TextBox
  37. AcceptsReturn="True"
  38. Text="{Binding currentProduct.MinCostForAgent}"/>
  39. <Label Content="Описание продукта"/>
  40. <TextBox
  41. AcceptsReturn="True"
  42. Height="50"
  43. Text="{Binding currentProduct.Description}"/>
  44. </StackPanel>
  45. <StackPanel Grid.Column="0" Orientation="Vertical" HorizontalAlignment="Right" Margin="0,5,5,5">
  46. <Image
  47. Name="CurrentProductImage"
  48. Width="200"
  49. Height="200"
  50. Source="{Binding currentProduct.ImageBitmap}" />
  51. <Button Height="20" Content="Сменить картинку" Click="ChangeImage_Click" />
  52. <Button Height="20" Content="Удалить" Click="DeleteProductButton_Click"
  53. Visibility="{Binding DeleteProductVisibly}"/>
  54. <Button Height="20" Content="Сохранить" Click="SaveButton_Click" />
  55. <Button Content="+" Click="AddMaterialButton_Click"/>
  56. <StackPanel Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal" Margin="2">
  57. <TextBlock Text="Поиск материалов:" Margin="10, 0, 5, 0" />
  58. <TextBox x:Name="SearchTextBox" Margin="0, 0,0,0" Width="105" TextChanged="SearchTextBox_TextChanged" />
  59. </StackPanel>
  60. <ListView
  61. x:Name="ProductMaterialsListView"
  62. ItemsSource="{Binding productMaterialList}"
  63. MouseDoubleClick="ListView_MouseDoubleClick"
  64. Grid.Row="5" Grid.Column="1" Margin="10">
  65. <ListView.ItemContainerStyle>
  66. <Style
  67. TargetType="ListViewItem"
  68. >
  69. <Setter
  70. Property="HorizontalContentAlignment"
  71. Value="Stretch" />
  72. </Style>
  73. </ListView.ItemContainerStyle>
  74. <ListView.ItemTemplate>
  75. <DataTemplate>
  76. <Grid >
  77. <Grid.ColumnDefinitions>
  78. <ColumnDefinition/>
  79. <ColumnDefinition Width="auto"/>
  80. <ColumnDefinition Width="auto"/>
  81. </Grid.ColumnDefinitions>
  82. <TextBlock
  83. Text="{Binding MaterialTitle}"/>
  84. <TextBlock
  85. Grid.Column="1"
  86. Margin="10,0"
  87. Text="{Binding Count}"/>
  88. <TextBlock
  89. x:Name="DeleteMaterialTextBlock"
  90. Grid.Column="2"
  91. Tag="{Binding Path=.}"
  92. Text="Туда его"
  93. MouseDown="DeleteMaterialTextBlock_MouseDown"/>
  94. </Grid>
  95. </DataTemplate>
  96. </ListView.ItemTemplate>
  97. </ListView>
  98. </StackPanel>
  99. </Grid>
  100. </Window>