|
|
|
|
<Window x:Class="formula_manage.Windows.RECIPE"
|
|
|
|
|
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="RECIPE_Loaded"
|
|
|
|
|
Title="RECIPE_SET" Height="720" Width="1100" MaxHeight="720" MaxWidth="1100" MinHeight="720" MinWidth="1100"
|
|
|
|
|
DataContext="{Binding Source={StaticResource Locator}, Path=Recipev}"
|
|
|
|
|
BorderBrush="White" Background="#FFE0E0E0">
|
|
|
|
|
<Window.Resources>
|
|
|
|
|
<ViewModel:RECIPEViewModel x:Key="RECIPEViewModel"/>
|
|
|
|
|
</Window.Resources>
|
|
|
|
|
<Grid>
|
|
|
|
|
<!--表-->
|
|
|
|
|
<DataGrid x:Name="DatagridRECIPE" MouseDoubleClick="RECIPE_MouseDoubleClick" SelectionMode="Single" AlternationCount="2" IsReadOnly="True"
|
|
|
|
|
Margin="15,0,15,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" VerticalAlignment="Bottom" Height="250">
|
|
|
|
|
<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>
|
|
|
|
|
<!--列信息绑定-->
|
|
|
|
|
<DataGridTextColumn Header="配方代码" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="配方名称" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="颜色名" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="颜色代码" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="客户代码" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="客户名称" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
|
|
|
|
|
<DataGridTextColumn Header="备注" Width="800" FontSize="15" MinWidth="80" CanUserReorder="False"/>
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
<!--代码-->
|
|
|
|
|
<TextBox x:Name="Code" HorizontalAlignment="Left" Height="30" Margin="65,0,0,100" Text=""
|
|
|
|
|
VerticalAlignment="Bottom" Width="120" 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="40" FontSize="20"/>
|
|
|
|
|
<!--名称-->
|
|
|
|
|
<TextBox x:Name="name" HorizontalAlignment="Left" Height="30" Margin="255,0,0,100" Text=""
|
|
|
|
|
VerticalAlignment="Bottom" Width="120" FontSize="22" MaxLines="1" MaxLength="25"
|
|
|
|
|
InputMethod.IsInputMethodEnabled="False"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="205,0,0,100" TextWrapping="Wrap" Text="名称"
|
|
|
|
|
VerticalAlignment="Bottom" Width="45" FontSize="20"/>
|
|
|
|
|
<!--备注-->
|
|
|
|
|
<TextBox x:Name="Remark" HorizontalAlignment="Left" Height="30" Margin="255,0,0,50"
|
|
|
|
|
VerticalAlignment="Bottom" Width="305" FontSize="22" MaxLines="1"/>
|
|
|
|
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="205,0,0,50" TextWrapping="Wrap" Text="备注"
|
|
|
|
|
VerticalAlignment="Bottom" Width="40" FontSize="20"/>
|
|
|
|
|
|
|
|
|
|
<!--存储按钮-->
|
|
|
|
|
<Button Content="存储" HorizontalAlignment="Left" Height="50" Margin="795,0,0,60"
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
|
|
|
|
|
Click="Button_Preservation">
|
|
|
|
|
</Button>
|
|
|
|
|
<!--删除按钮-->
|
|
|
|
|
<Button Content="删除" HorizontalAlignment="Left" Height="50" Margin="935,0,0,60"
|
|
|
|
|
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
|
|
|
|
|
Click="Button_Delete">
|
|
|
|
|
</Button>
|
|
|
|
|
<DataGrid x:Name="Grid_RRODUCT" AlternationCount="2" IsReadOnly="False"
|
|
|
|
|
Margin="15,15,15,405" d:ItemsSource="{d:SampleData ItemCount=99}" AutoGenerateColumns="False" MinColumnWidth="30"
|
|
|
|
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
|
|
|
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right"
|
|
|
|
|
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False"
|
|
|
|
|
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column"
|
|
|
|
|
Background="White" SelectionMode="Single" FontSize="15" >
|
|
|
|
|
<DataGrid.Resources>
|
|
|
|
|
<Style x:Key="CellStyle" TargetType="{x:Type DataGridCell}">
|
|
|
|
|
<Setter Property="Focusable" Value="False"/>
|
|
|
|
|
<Setter Property="Background" Value="#FFFFFFFF"/>
|
|
|
|
|
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
|
|
|
|
|
<Setter Property="Foreground" Value="#000000"/>
|
|
|
|
|
<Setter Property="DataContext" Value="{Binding Main, Source={StaticResource Locator}}"/>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.Resources>
|
|
|
|
|
<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="#FFFFFFFF" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="False"/>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.RowStyle>
|
|
|
|
|
<DataGrid.CellStyle>
|
|
|
|
|
<Style TargetType="{x:Type DataGridCell}">
|
|
|
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
|
|
|
<Setter Property="MinWidth" Value="20"/>
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
<Trigger Property="IsSelected" Value="True">
|
|
|
|
|
<Setter Property="Background" Value="#FFFFFFFF"/>
|
|
|
|
|
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
|
|
|
|
|
<Setter Property="Foreground" Value="#000000"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.CellStyle>
|
|
|
|
|
<DataGrid.Columns>
|
|
|
|
|
<!--列信息绑定-->
|
|
|
|
|
<DataGridTextColumn Header="序" Width="30" FontSize="15" MaxWidth="30" MinWidth="30" Binding="{Binding ID}" IsReadOnly="True" CellStyle="{StaticResource CellStyle}"/>
|
|
|
|
|
<DataGridTemplateColumn Header="原料代码" Width="200" MaxWidth="400" MinWidth="100" IsReadOnly="False">
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<ComboBox x:Name="CP_PRODUCT_CODE" BorderThickness="0,0,0,0"
|
|
|
|
|
ItemsSource="{Binding stuff_Product, Source={StaticResource RECIPEViewModel}}"
|
|
|
|
|
DisplayMemberPath="ProductCode"
|
|
|
|
|
Text="{Binding PRODUCT_CODE}" IsTextSearchEnabled="True" StaysOpenOnEdit="True"
|
|
|
|
|
BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True"
|
|
|
|
|
KeyDown="CP_PRODUCT_CODE_KeyUp"
|
|
|
|
|
DropDownClosed="CP_PRODUCT_CODE_DropDownClosed"/>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
<DataGridTemplateColumn Header="目标饱和度(%)" Width="200" MaxWidth="400" MinWidth="100" >
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<TextBox x:Name="CP_CONC" BorderThickness="0,0,0,0" Text="{Binding CONC}"
|
|
|
|
|
BorderBrush="{x:Null}" Background="{x:Null}"
|
|
|
|
|
KeyDown="CP_CONC_KeyUp"/>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
<DataGridTextColumn Header="计算单位" Width="80" MaxWidth="80" MinWidth="80" CellStyle="{StaticResource CellStyle}" Binding="{Binding SHIFT}"/>
|
|
|
|
|
<DataGridTemplateColumn Header="原料名称" Width="200" MaxWidth="400" MinWidth="100" CellStyle="{StaticResource CellStyle}">
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<ComboBox x:Name="CP_PRODUCT_NAME" BorderThickness="0,0,0,0"
|
|
|
|
|
ItemsSource="{Binding stuff_Product, Source={StaticResource RECIPEViewModel}}"
|
|
|
|
|
DisplayMemberPath="ProductName"
|
|
|
|
|
Text="{Binding PRODUCT_NAME}"
|
|
|
|
|
DropDownClosed="CP_PRODUCT_NAME_DropDownClosed"
|
|
|
|
|
BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True" IsReadOnly="True" Focusable="True" IsTabStop="False"/>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
<DataGridTextColumn Header="单位" Width="80" FontSize="15" MaxWidth="80" MinWidth="80" IsReadOnly="True" Binding="{Binding UNIT}" CellStyle="{StaticResource CellStyle}"/>
|
|
|
|
|
<DataGridTextColumn Header="备注" Width="600" FontSize="15" MinWidth="600" Binding="{Binding REMARK}" CellStyle="{StaticResource CellStyle}" IsReadOnly="False"/>
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Window>
|