|
|
|
|
<Window x:Class="formula_manage.Windows.Stuff"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:local="clr-namespace:formula_manage.Windows"
|
|
|
|
|
xmlns:ConvertMoels="clr-namespace:formula_manage.ConvertMoels"
|
|
|
|
|
xmlns:viewmodel="clr-namespace:formula_manage.ViewModel"
|
|
|
|
|
mc:Ignorable="d" Loaded="Stuff_Loaded"
|
|
|
|
|
Title="Stuff" Height="720" Width="1200" MaxHeight="720" MaxWidth="1200" MinHeight="720" MinWidth="1200"
|
|
|
|
|
BorderBrush="White" Background="#FFE0E0E0">
|
|
|
|
|
<Window.Resources>
|
|
|
|
|
<!--引入转换器-->
|
|
|
|
|
<ConvertMoels:ColorSQLConvert x:Key="ColorSQLConvert"/>
|
|
|
|
|
<ConvertMoels:ProductTypeSQLConvert x:Key="ProductTypeSQLConvert"/>
|
|
|
|
|
<ConvertMoels:IonSQLConvert x:Key="IonSQLConvert"/>
|
|
|
|
|
</Window.Resources>
|
|
|
|
|
<Grid>
|
|
|
|
|
<!--原料表-->
|
|
|
|
|
<DataGrid x:Name="DataGridStuff" MouseDoubleClick="DataGridStuff_MouseDoubleClick" SelectionMode="Single" AlternationCount="2" IsReadOnly="True"
|
|
|
|
|
HorizontalAlignment="Left" Margin="15,15,0,150" d:ItemsSource="{d:SampleData ItemCount=999}" AutoGenerateColumns="False" MinColumnWidth="30"
|
|
|
|
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
|
|
|
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2"
|
|
|
|
|
CanUserResizeRows="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
|
|
|
|
|
CanUserResizeColumns="False" CanUserSortColumns="False" HeadersVisibility ="Column">
|
|
|
|
|
<DataGrid.RowStyle >
|
|
|
|
|
<Style TargetType="{x:Type DataGridRow}">
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
|
|
|
|
<Setter Property="Background" Value="#FFFFFFFF" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
|
|
|
|
<Setter Property="Background" Value="#FFF0F0F0" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="False">
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.RowStyle>
|
|
|
|
|
<DataGrid.CellStyle>
|
|
|
|
|
<Style TargetType="DataGridCell">
|
|
|
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
|
|
|
<Setter Property="MinWidth" Value="20"/>
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
<Trigger Property="IsSelected" Value="True">
|
|
|
|
|
<Setter Property="Background" Value="#FFC0C0C0"/>
|
|
|
|
|
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
|
|
|
|
|
<Setter Property="Foreground" Value="#000000"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.CellStyle>
|
|
|
|
|
<DataGrid.Columns>
|
|
|
|
|
<!--列信息绑定-->
|
|
|
|
|
<DataGridTemplateColumn Header=" 序号" Width="50" MinWidth="10" IsReadOnly="True">
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<TextBlock FontSize="15" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
<DataGridTextColumn Header="原料代码" Binding="{Binding ProductCode}" Width="130" FontSize="15" MaxWidth="130" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="原料名称" Binding="{Binding ProductName}" Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="原料类型" Width="80" FontSize="15" MaxWidth="80" MinWidth="70" CanUserReorder="False">
|
|
|
|
|
<!--事件名称:原料类型数字转文字显示,转换器ProductTypeSQLConvert-->
|
|
|
|
|
<DataGridTextColumn.ElementStyle>
|
|
|
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
|
|
|
<Setter Property="Text" Value="{Binding ProductType, Converter={StaticResource ProductTypeSQLConvert}}"/>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGridTextColumn.ElementStyle>
|
|
|
|
|
</DataGridTextColumn>
|
|
|
|
|
<DataGridTextColumn Header="离子类型" Width="80" FontSize="15" MaxWidth="500" MinWidth="50" CanUserReorder="False">
|
|
|
|
|
<!--事件名称:离子数字转显示,转换器IonSQLConvert-->
|
|
|
|
|
<DataGridTextColumn.ElementStyle>
|
|
|
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
|
|
|
<Setter Property="Text" Value="{Binding ProductIon_Type, Converter={StaticResource IonSQLConvert}}"/>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGridTextColumn.ElementStyle>
|
|
|
|
|
</DataGridTextColumn>
|
|
|
|
|
<DataGridTextColumn Header="色彩" Width="100" MaxWidth="500" MinWidth="50" CanUserReorder="False">
|
|
|
|
|
<!--事件名称:色彩数字转色彩显示,转换器ColorSQLConvert-->
|
|
|
|
|
<DataGridTextColumn.ElementStyle>
|
|
|
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
|
|
|
<Setter Property="Background" Value="{Binding Color, Converter={StaticResource ColorSQLConvert}}"/>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGridTextColumn.ElementStyle>
|
|
|
|
|
</DataGridTextColumn>
|
|
|
|
|
<DataGridTextColumn Header="浓度(%)" Binding="{Binding Concentration}" Width="70" FontSize="15" MaxWidth="200" MinWidth="20" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="比重(sg)" Binding="{Binding GRAVITY}" Width="70" FontSize="15" MaxWidth="200" MinWidth="20" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="价格(¥/kg)" Binding="{Binding Price}" Width="100" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="供应商" Binding="{Binding SUPPLIER}" Width="150" FontSize="15" MaxWidth="150" MinWidth="150" CanUserReorder="False"/>
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
<!--搜索类型-->
|
|
|
|
|
<RadioButton Content="染料" x:Name="Button_0" Click="Radiobutton" HorizontalAlignment="Left" Height="20" Margin="1095,265,0,0"
|
|
|
|
|
VerticalAlignment="Top" Width="100" BorderBrush="Black" Background="White" Grid.Column="1" FontSize="14" />
|
|
|
|
|
<RadioButton Content="助剂" x:Name="Button_1" Click="Radiobutton" HorizontalAlignment="Left" Height="20" Margin="1095,295,0,0"
|
|
|
|
|
VerticalAlignment="Top" Width="100" BorderBrush="Black" Background="White" Grid.Column="1" FontSize="14" />
|
|
|
|
|
<RadioButton Content="粉体助剂" x:Name="Button_2" Click="Radiobutton" HorizontalAlignment="Left" Height="20" Margin="1095,325,0,0"
|
|
|
|
|
VerticalAlignment="Top" Width="100" BorderBrush="Black" Background="White" Grid.Column="1" FontSize="14"/>
|
|
|
|
|
<RadioButton Content="液体染料" x:Name="Button_3" Click="Radiobutton" HorizontalAlignment="Left" Height="20" Margin="1095,355,0,0"
|
|
|
|
|
VerticalAlignment="Top" Width="100" BorderBrush="Black" Background="White" Grid.Column="1" FontSize="14" />
|
|
|
|
|
<RadioButton Content="全部原料" x:Name="Button_all" Click="Radiobutton" HorizontalAlignment="Left" Height="20" Margin="1095,385,0,0"
|
|
|
|
|
VerticalAlignment="Top" Width="100" BorderBrush="Black" Background="White" Grid.Column="1" IsChecked="True" FontSize="14" />
|
|
|
|
|
<!--原料代码-->
|
|
|
|
|
<TextBox x:Name="stuff_ProductCode" HorizontalAlignment="Left" Height="30" Margin="105,0,0,100" Text=""
|
|
|
|
|
VerticalAlignment="Bottom" Width="130" FontSize="22" 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="22" 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="755,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>
|
|
|
|
|
</ComboBox>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="670,0,0,100" TextWrapping="Wrap" Text="原料类型"
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" FontSize="20"/>
|
|
|
|
|
<!--离子类型-->
|
|
|
|
|
<ComboBox x:Name="Stuff_ion" HorizontalAlignment="Left" Height="30" Margin="755,0,0,50" 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>
|
|
|
|
|
<ComboBoxItem Content="阴离子"></ComboBoxItem>
|
|
|
|
|
<ComboBoxItem Content="非离子"></ComboBoxItem>
|
|
|
|
|
<ComboBoxItem Content="酞菁"></ComboBoxItem>
|
|
|
|
|
<ComboBoxItem Content="直接"></ComboBoxItem>
|
|
|
|
|
</ComboBox>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="670,0,0,50" TextWrapping="Wrap" Text="离子类型"
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" FontSize="20"/>
|
|
|
|
|
<!--色彩-->
|
|
|
|
|
<TextBox x:Name="stuff_Color" HorizontalAlignment="Left" Height="30" Margin="445,0,0,50"
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" MaxLines="1" IsReadOnly="True" Cursor="Arrow"
|
|
|
|
|
MouseDoubleClick="Stuff_Color_MouseDoubleClick"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="400,0,0,50" TextWrapping="Wrap" Text="色彩"
|
|
|
|
|
VerticalAlignment="Bottom" Width="50" FontSize="20"/>
|
|
|
|
|
<!--供应商-->
|
|
|
|
|
<TextBox x:Name="stuff_SUPPLIER" HorizontalAlignment="Left" Height="30" Margin="105,0,0,50" Text=""
|
|
|
|
|
VerticalAlignment="Bottom" Width="130" FontSize="22" MaxLines="1" MaxLength="25"/>
|
|
|
|
|
<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="22" MaxLines="1" MaxLength="25"
|
|
|
|
|
InputMethod.IsInputMethodEnabled="False"/>
|
|
|
|
|
<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="605,0,0,50" Text="100"
|
|
|
|
|
VerticalAlignment="Bottom" Width="50" FontSize="22" MaxLines="1" MaxLength="7"
|
|
|
|
|
InputMethod.IsInputMethodEnabled="False"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="560,0,0,50" TextWrapping="Wrap" Text="浓度"
|
|
|
|
|
VerticalAlignment="Bottom" Width="45" FontSize="20"/>
|
|
|
|
|
<!--比重-->
|
|
|
|
|
<TextBox x:Name="stuff_GRAVITY" HorizontalAlignment="Left" Height="30" Margin="605,0,0,100" Text="1"
|
|
|
|
|
VerticalAlignment="Bottom" Width="50" FontSize="22" MaxLines="1" MaxLength="4"
|
|
|
|
|
InputMethod.IsInputMethodEnabled="False"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="560,0,0,100" TextWrapping="Wrap" Text="比重"
|
|
|
|
|
VerticalAlignment="Bottom" Width="45" FontSize="20"/>
|
|
|
|
|
<!--存储按钮-->
|
|
|
|
|
<Button Content="存储" HorizontalAlignment="Left" Height="50" Margin="895,0,0,60"
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
|
|
|
|
|
Click="Button_Preservation">
|
|
|
|
|
</Button>
|
|
|
|
|
<!--删除按钮-->
|
|
|
|
|
<Button Content="删除" HorizontalAlignment="Left" Height="50" Margin="1035,0,0,60"
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
|
|
|
|
|
Click="Button_Delete">
|
|
|
|
|
</Button>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Window>
|