|
|
@ -8,13 +8,14 @@ |
|
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" |
|
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" |
|
|
mc:Ignorable="d" DataContext="{Binding Source={StaticResource Locator},Path=Stuff}" |
|
|
mc:Ignorable="d" DataContext="{Binding Source={StaticResource Locator},Path=Stuff}" |
|
|
d:DesignHeight="900" d:DesignWidth="1140" |
|
|
d:DesignHeight="900" d:DesignWidth="1140" |
|
|
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"> |
|
|
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:v="clr-namespace:System.Diagnostics.Tracing;assembly=mscorlib"> |
|
|
<UserControl.Resources> |
|
|
<UserControl.Resources> |
|
|
|
|
|
<!--引入转换器--> |
|
|
<ConvertMoels:ColorSQLConvert x:Key="ColorSQLConvert"/> |
|
|
<ConvertMoels:ColorSQLConvert x:Key="ColorSQLConvert"/> |
|
|
<ConvertMoels:ProductTypeSQLConvert x:Key="ProductTypeSQLConvert"/> |
|
|
<ConvertMoels:ProductTypeSQLConvert x:Key="ProductTypeSQLConvert"/> |
|
|
</UserControl.Resources> |
|
|
</UserControl.Resources> |
|
|
<Grid> |
|
|
<Grid> |
|
|
|
|
|
<!--布局--> |
|
|
<Grid.RowDefinitions> |
|
|
<Grid.RowDefinitions> |
|
|
<RowDefinition Height="30"/> |
|
|
<RowDefinition Height="30"/> |
|
|
<RowDefinition/> |
|
|
<RowDefinition/> |
|
|
@ -23,6 +24,7 @@ |
|
|
</Border> |
|
|
</Border> |
|
|
<Grid Grid.Row="0"/> |
|
|
<Grid Grid.Row="0"/> |
|
|
<Grid Grid.Row="1"> |
|
|
<Grid Grid.Row="1"> |
|
|
|
|
|
<!--原料表--> |
|
|
<DataGrid x:Name="DataGridStuff" MouseDoubleClick="DataGridStuff_MouseDoubleClick" ItemsSource="{Binding Product, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectionMode="Single" AlternationCount="2" IsReadOnly="True" HorizontalAlignment="Left" Margin="15,15,0,150" d:ItemsSource="{d:SampleData ItemCount=200}" AutoGenerateColumns="False" MinColumnWidth="30" HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC" BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False"> |
|
|
<DataGrid x:Name="DataGridStuff" MouseDoubleClick="DataGridStuff_MouseDoubleClick" ItemsSource="{Binding Product, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectionMode="Single" AlternationCount="2" IsReadOnly="True" HorizontalAlignment="Left" Margin="15,15,0,150" d:ItemsSource="{d:SampleData ItemCount=200}" AutoGenerateColumns="False" MinColumnWidth="30" HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC" BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False"> |
|
|
<DataGrid.RowStyle > |
|
|
<DataGrid.RowStyle > |
|
|
<Style TargetType="{x:Type DataGridRow}"> |
|
|
<Style TargetType="{x:Type DataGridRow}"> |
|
|
@ -52,12 +54,14 @@ |
|
|
</Style> |
|
|
</Style> |
|
|
</DataGrid.CellStyle> |
|
|
</DataGrid.CellStyle> |
|
|
<DataGrid.Columns> |
|
|
<DataGrid.Columns> |
|
|
|
|
|
<!--列信息绑定--> |
|
|
<DataGridTextColumn Header="序号" Width="50" FontSize="15" MaxWidth="50" MinWidth="20" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="序号" Width="50" FontSize="15" MaxWidth="50" MinWidth="20" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="原料代码" Width="130" FontSize="15" Binding="{Binding ProductCode}" MaxWidth="130" MinWidth="100" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="原料代码" Width="130" FontSize="15" Binding="{Binding ProductCode}" MaxWidth="130" MinWidth="100" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="原料名称" Width="200" FontSize="15" Binding="{Binding ProductName}" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="原料名称" Width="200" FontSize="15" Binding="{Binding ProductName}" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="价格(¥/kg)" Width="100" FontSize="15" Binding="{Binding Price}" MaxWidth="100" MinWidth="100" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="价格(¥/kg)" Width="100" FontSize="15" Binding="{Binding Price}" MaxWidth="100" MinWidth="100" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="供应商代码" Width="150" FontSize="15" Binding="{Binding ProductUnit}" MaxWidth="150" MinWidth="150" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="供应商代码" Width="150" FontSize="15" Binding="{Binding ProductUnit}" MaxWidth="150" MinWidth="150" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="原料类型" Width="80" FontSize="15" MaxWidth="80" MinWidth="70" CanUserReorder="False"> |
|
|
<DataGridTextColumn Header="原料类型" Width="80" FontSize="15" MaxWidth="80" MinWidth="70" CanUserReorder="False"> |
|
|
|
|
|
<!--事件名称:原料类型数字转文字显示,转换器ProductTypeSQLConvert--> |
|
|
<DataGridTextColumn.ElementStyle> |
|
|
<DataGridTextColumn.ElementStyle> |
|
|
<Style TargetType="{x:Type TextBlock}"> |
|
|
<Style TargetType="{x:Type TextBlock}"> |
|
|
<Setter Property="Text" Value="{Binding Path=ProductType,Converter={StaticResource ProductTypeSQLConvert}}"> |
|
|
<Setter Property="Text" Value="{Binding Path=ProductType,Converter={StaticResource ProductTypeSQLConvert}}"> |
|
|
@ -66,6 +70,7 @@ |
|
|
</DataGridTextColumn.ElementStyle> |
|
|
</DataGridTextColumn.ElementStyle> |
|
|
</DataGridTextColumn> |
|
|
</DataGridTextColumn> |
|
|
<DataGridTextColumn Header="色彩" Width="100" MaxWidth="500" MinWidth="50" CanUserReorder="False"> |
|
|
<DataGridTextColumn Header="色彩" Width="100" MaxWidth="500" MinWidth="50" CanUserReorder="False"> |
|
|
|
|
|
<!--事件名称:色彩数字转色彩显示,转换器ColorSQLConvert--> |
|
|
<DataGridTextColumn.ElementStyle> |
|
|
<DataGridTextColumn.ElementStyle> |
|
|
<Style TargetType="{x:Type TextBlock}"> |
|
|
<Style TargetType="{x:Type TextBlock}"> |
|
|
<Setter Property="Background" Value="{Binding Path=Color,Converter={StaticResource ColorSQLConvert}}"/> |
|
|
<Setter Property="Background" Value="{Binding Path=Color,Converter={StaticResource ColorSQLConvert}}"/> |
|
|
@ -76,32 +81,80 @@ |
|
|
<DataGridTextColumn Header="比重(sg)" Width="70" FontSize="15" Binding="{Binding GRAVITY}" MaxWidth="200" MinWidth="20" CanUserReorder="False"/> |
|
|
<DataGridTextColumn Header="比重(sg)" Width="70" FontSize="15" Binding="{Binding GRAVITY}" MaxWidth="200" MinWidth="20" CanUserReorder="False"/> |
|
|
</DataGrid.Columns> |
|
|
</DataGrid.Columns> |
|
|
</DataGrid> |
|
|
</DataGrid> |
|
|
<RadioButton Content="染料" x:Name="Button_0" GroupName="button" HorizontalAlignment="Left" Height="40" Margin="995,265,0,0" VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/> |
|
|
<!--搜索类型--> |
|
|
<RadioButton Content="助剂" x:Name="Button_1" GroupName="button" HorizontalAlignment="Left" Height="40" Margin="995,305,0,0" VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/> |
|
|
<RadioButton Content="染料" x:Name="Button_0" GroupName="button" HorizontalAlignment="Left" Height="40" Margin="995,265,0,0" |
|
|
<RadioButton Content="粉体助剂" x:Name="Button_2" GroupName="button" HorizontalAlignment="Left" Height="40" Margin="995,345,0,0" VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/> |
|
|
VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/> |
|
|
<RadioButton Content="全部原料" x:Name="Button_all" GroupName="button" HorizontalAlignment="Left" Height="40" Margin="995,385,0,0" VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1" IsChecked="True"/> |
|
|
<RadioButton Content="助剂" x:Name="Button_1" GroupName="button" HorizontalAlignment="Left" Height="40" Margin="995,305,0,0" |
|
|
<TextBox x:Name="stuff_ProductCode" HorizontalAlignment="Left" Height="30" Margin="105,0,0,100" Text="" VerticalAlignment="Bottom" Width="130" FontSize="16" MaxLines="1" MaxLength="25" InputMethod.IsInputMethodEnabled="False"/> |
|
|
VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/> |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,100" TextWrapping="Wrap" Text="原料代码" VerticalAlignment="Bottom" Width="100" FontSize="20"/> |
|
|
<RadioButton Content="粉体助剂" x:Name="Button_2" GroupName="button" HorizontalAlignment="Left" Height="40" Margin="995,345,0,0" |
|
|
<TextBox x:Name="stuff_ProductName" HorizontalAlignment="Left" Height="30" Margin="345,0,0,100" Text="" VerticalAlignment="Bottom" Width="200" FontSize="16" MaxLines="1" MaxLength="50"/> |
|
|
VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/> |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="255,0,0,100" TextWrapping="Wrap" Text="原料名称" VerticalAlignment="Bottom" Width="100" FontSize="20"/> |
|
|
<RadioButton Content="全部原料" x:Name="Button_all" GroupName="button" HorizontalAlignment="Left" Height="40" Margin="995,385,0,0" |
|
|
<ComboBox x:Name="stuff_ProductType" HorizontalAlignment="Left" Height="30" Margin="645,0,0,100" Text="" VerticalAlignment="Bottom" Width="100" FontSize="16" IsReadOnly="True" IsEditable="True"> |
|
|
VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1" IsChecked="True"/> |
|
|
|
|
|
<!--原料代码--> |
|
|
|
|
|
<TextBox x:Name="stuff_ProductCode" HorizontalAlignment="Left" Height="30" Margin="105,0,0,100" Text="" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="130" FontSize="16" MaxLines="1" MaxLength="25" |
|
|
|
|
|
InputMethod.IsInputMethodEnabled="False"/> |
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,100" TextWrapping="Wrap" Text="原料代码" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" FontSize="20"/> |
|
|
|
|
|
<!--原料名称--> |
|
|
|
|
|
<TextBox x:Name="stuff_ProductName" HorizontalAlignment="Left" Height="30" Margin="345,0,0,100" Text="" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="200" FontSize="16" MaxLines="1" MaxLength="50"/> |
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="255,0,0,100" TextWrapping="Wrap" Text="原料名称" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" FontSize="20"/> |
|
|
|
|
|
<!--原料类型--> |
|
|
|
|
|
<ComboBox x:Name="stuff_ProductType" HorizontalAlignment="Left" Height="30" Margin="645,0,0,100" Text="" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" FontSize="16" IsReadOnly="True" IsEditable="True"> |
|
|
<ComboBoxItem Content="染料"></ComboBoxItem> |
|
|
<ComboBoxItem Content="染料"></ComboBoxItem> |
|
|
<ComboBoxItem Content="助剂"></ComboBoxItem> |
|
|
<ComboBoxItem Content="助剂"></ComboBoxItem> |
|
|
<ComboBoxItem Content="粉体助剂"></ComboBoxItem> |
|
|
<ComboBoxItem Content="粉体助剂"></ComboBoxItem> |
|
|
</ComboBox> |
|
|
</ComboBox> |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="560,0,0,100" TextWrapping="Wrap" Text="原料类型" VerticalAlignment="Bottom" Width="100" FontSize="20"/> |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="560,0,0,100" TextWrapping="Wrap" Text="原料类型" |
|
|
<TextBox x:Name="stuff_Color" MouseDoubleClick="Stuff_Color_MouseDoubleClick" HorizontalAlignment="Left" Height="30" Margin="445,0,0,50" Text="" VerticalAlignment="Bottom" Width="80" MaxLines="1" IsReadOnly="True" Cursor="Arrow"/> |
|
|
VerticalAlignment="Bottom" Width="100" FontSize="20"/> |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="400,0,0,50" TextWrapping="Wrap" Text="色彩" VerticalAlignment="Bottom" Width="50" FontSize="20"/> |
|
|
<!--色彩--> |
|
|
<TextBox x:Name="stuff_ProductUnit" HorizontalAlignment="Left" Height="30" Margin="105,0,0,50" Text="" VerticalAlignment="Bottom" Width="130" FontSize="16" MaxLines="1" MaxLength="25" InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Limitnumber"/> |
|
|
<TextBox x:Name="stuff_Color" HorizontalAlignment="Left" Height="30" Margin="445,0,0,50" Text="" |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,50" TextWrapping="Wrap" Text="供应商" VerticalAlignment="Bottom" Width="80" FontSize="20"/> |
|
|
VerticalAlignment="Bottom" Width="80" MaxLines="1" IsReadOnly="True" Cursor="Arrow" |
|
|
<TextBox x:Name="stuff_Price" HorizontalAlignment="Left" Height="30" Margin="305,0,0,50" Text="" VerticalAlignment="Bottom" Width="80" FontSize="16" MaxLines="1" MaxLength="25" InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Limitnumber"/> |
|
|
MouseDoubleClick="Stuff_Color_MouseDoubleClick"/> |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="255,0,0,50" TextWrapping="Wrap" Text="价格" VerticalAlignment="Bottom" Width="45" FontSize="20"/> |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="400,0,0,50" TextWrapping="Wrap" Text="色彩" |
|
|
<TextBox x:Name="stuff_Concentration" HorizontalAlignment="Left" Height="30" Margin="585,0,0,50" Text="0" VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25" InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Limitnumber"/> |
|
|
VerticalAlignment="Bottom" Width="50" FontSize="20"/> |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="540,0,0,50" TextWrapping="Wrap" Text="浓度" VerticalAlignment="Bottom" Width="45" FontSize="20"/> |
|
|
<!--供应商--> |
|
|
<TextBox x:Name="stuff_GRAVITY" HorizontalAlignment="Left" Height="30" Margin="695,0,0,50" Text="1" VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25" InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Limitnumber"/> |
|
|
<TextBox x:Name="stuff_ProductUnit" HorizontalAlignment="Left" Height="30" Margin="105,0,0,50" Text="" |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="650,0,0,50" TextWrapping="Wrap" Text="比重" VerticalAlignment="Bottom" Width="45" FontSize="20"/> |
|
|
VerticalAlignment="Bottom" Width="130" FontSize="16" MaxLines="1" MaxLength="25" |
|
|
<Button Content="存储" HorizontalAlignment="Left" Height="65" Margin="795,0,0,60" VerticalAlignment="Bottom" Width="145" FontSize="40" BorderBrush="{x:Null}" Background="#FFCECECE" Click="Button_Preservation"/> |
|
|
InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Limitnumber"/> |
|
|
<Button Content="删除" HorizontalAlignment="Left" Height="65" Margin="975,0,0,60" VerticalAlignment="Bottom" Width="145" FontSize="40" BorderBrush="{x:Null}" Background="#FFCECECE" Click="Button_Delete"/> |
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,50" TextWrapping="Wrap" Text="供应商" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="80" FontSize="20"/> |
|
|
|
|
|
<!--价格--> |
|
|
|
|
|
<TextBox x:Name="stuff_Price" HorizontalAlignment="Left" Height="30" Margin="305,0,0,50" Text="" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="80" FontSize="16" MaxLines="1" MaxLength="25" |
|
|
|
|
|
InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Limitnumber"/> |
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="255,0,0,50" TextWrapping="Wrap" Text="价格" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="45" FontSize="20"/> |
|
|
|
|
|
<!--浓度--> |
|
|
|
|
|
<TextBox x:Name="stuff_Concentration" HorizontalAlignment="Left" Height="30" Margin="585,0,0,50" Text="0" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25" |
|
|
|
|
|
InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Limitnumber"/> |
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="540,0,0,50" TextWrapping="Wrap" Text="浓度" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="45" FontSize="20"/> |
|
|
|
|
|
<!--比重--> |
|
|
|
|
|
<TextBox x:Name="stuff_GRAVITY" HorizontalAlignment="Left" Height="30" Margin="695,0,0,50" Text="1" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25" |
|
|
|
|
|
InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Limitnumber"/> |
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="650,0,0,50" TextWrapping="Wrap" Text="比重" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="45" FontSize="20"/> |
|
|
|
|
|
<!--存储按钮--> |
|
|
|
|
|
<Button Content="存储" HorizontalAlignment="Left" Height="65" Margin="795,0,0,60" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="145" FontSize="40" BorderBrush="{x:Null}" Background="#FFCECECE" |
|
|
|
|
|
Click="Button_Preservation"> |
|
|
|
|
|
<i:Interaction.Triggers> |
|
|
|
|
|
<!--事件名称 EventName="Click"单机事件--> |
|
|
|
|
|
<i:EventTrigger EventName=""> |
|
|
|
|
|
|
|
|
|
|
|
</i:EventTrigger> |
|
|
|
|
|
</i:Interaction.Triggers> |
|
|
|
|
|
</Button> |
|
|
|
|
|
<!--删除按钮--> |
|
|
|
|
|
<Button Content="删除" HorizontalAlignment="Left" Height="65" Margin="975,0,0,60" |
|
|
|
|
|
VerticalAlignment="Bottom" Width="145" FontSize="40" BorderBrush="{x:Null}" Background="#FFCECECE" |
|
|
|
|
|
Click="Button_Delete"/> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</UserControl> |
|
|
</UserControl> |
|
|
|