忱 沈 4 years ago
parent
commit
2a6b0dff00
  1. 34
      View/StuffView.xaml
  2. 34
      View/StuffView.xaml.cs

34
View/StuffView.xaml

@ -101,22 +101,26 @@
<RadioButton Content="助剂" x:Name="Button_1" GroupName="button" BindingGroup="{Binding Button_ProductType}" 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_2" GroupName="button" BindingGroup="{Binding Button_ProductType}" HorizontalAlignment="Left" Height="40" Margin="995,345,0,0" VerticalAlignment="Top" Width="100" FontSize="18" BorderBrush="{x:Null}" Background="{x:Null}" Grid.Column="1"/>
<RadioButton Content="全部原料" x:Name="Button_all" GroupName="button" BindingGroup="{Binding Button_ProductType}" 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"/>
<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" Grid.ColumnSpan="2"/>
<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"/>
<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="25" Grid.Column="1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="255,0,0,100" TextWrapping="Wrap" Text="原料名称" VerticalAlignment="Bottom" Width="100" FontSize="20" Grid.Column="1"/>
<ComboBox x:Name="stuff_ProductType" HorizontalAlignment="Left" Height="30" Margin="645,0,0,100" Text="" VerticalAlignment="Bottom" Width="100" FontSize="16" Grid.Column="1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="560,0,0,100" TextWrapping="Wrap" Text="原料类型" VerticalAlignment="Bottom" Width="100" FontSize="20" Grid.Column="1"/>
<TextBox x:Name="stuff_Color" HorizontalAlignment="Left" Height="30" Margin="465,0,0,50" Text="" VerticalAlignment="Bottom" Width="60" FontSize="16" MaxLines="1" MaxLength="25" Grid.Column="1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="420,0,0,50" TextWrapping="Wrap" Text="色彩" VerticalAlignment="Bottom" Width="50" FontSize="20" Grid.Column="1"/>
<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" Grid.ColumnSpan="2"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,50" TextWrapping="Wrap" Text="供应商" VerticalAlignment="Bottom" Width="100" FontSize="20"/>
<TextBox x:Name="stuff_Price" HorizontalAlignment="Left" Height="30" Margin="305,0,0,50" Text="" VerticalAlignment="Bottom" Width="100" FontSize="16" MaxLines="1" MaxLength="25" Grid.Column="1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="255,0,0,50" TextWrapping="Wrap" Text="价格" VerticalAlignment="Bottom" Width="100" FontSize="20" Grid.Column="1"/>
<TextBox x:Name="stuff_Concentration" HorizontalAlignment="Left" Height="30" Margin="585,0,0,50" Text="" VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25" Grid.Column="1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="540,0,0,50" TextWrapping="Wrap" Text="浓度" VerticalAlignment="Bottom" Width="50" FontSize="20" Grid.Column="1"/>
<TextBox x:Name="stuff_GRAVITY" HorizontalAlignment="Left" Height="30" Margin="695,0,0,50" Text="" VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25" Grid.Column="1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="650,0,0,50" TextWrapping="Wrap" Text="比重" VerticalAlignment="Bottom" Width="50" FontSize="20" Grid.Column="1"/>
<TextBox x:Name="stuff_ProductName" HorizontalAlignment="Left" Height="30" Margin="345,0,0,100" Text="" VerticalAlignment="Bottom" Width="200" FontSize="16" MaxLines="1" MaxLength="25"/>
<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>
</ComboBox>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="560,0,0,100" TextWrapping="Wrap" Text="原料类型" VerticalAlignment="Bottom" Width="100" FontSize="20"/>
<TextBox x:Name="stuff_Color" HorizontalAlignment="Left" Height="30" Margin="465,0,0,50" Text="" VerticalAlignment="Bottom" Width="60" FontSize="16" MaxLines="1" MaxLength="25"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="420,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"/>
<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="100" FontSize="16" MaxLines="1" MaxLength="25"/>
<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="" VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25"/>
<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="" VerticalAlignment="Bottom" Width="50" FontSize="16" MaxLines="1" MaxLength="25"/>
<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"/>
<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>

34
View/StuffView.xaml.cs

@ -41,22 +41,24 @@ namespace Audit.View
private void DataGridStuff_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
int rownum = this.DataGridStuff.SelectedIndex;//获取鼠标选中行并定义变量
string DataGridStuff_ProductCode = (DataGridStuff.Columns[1].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,
string DataGridStuff_ProductName = (DataGridStuff.Columns[2].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,
string DataGridStuff_Price = (DataGridStuff.Columns[3].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,
string DataGridStuff_ProductUnit = (DataGridStuff.Columns[4].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,
string DataGridStuff_ProductType = (DataGridStuff.Columns[5].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,
string DataGridStuff_Color = (DataGridStuff.Columns[6].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,
string DataGridStuff_Concentration = (DataGridStuff.Columns[7].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,
string DataGridStuff_GRAVITY = (DataGridStuff.Columns[8].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,
stuff_ProductCode.Text = DataGridStuff_ProductCode.ToString();
stuff_ProductName.Text = DataGridStuff_ProductName.ToString();
stuff_Price.Text = DataGridStuff_Price.ToString();
stuff_ProductUnit.Text = DataGridStuff_ProductUnit.ToString();
stuff_ProductType.Text= DataGridStuff_ProductType.ToString();
stuff_Color.Text = DataGridStuff_Color.ToString();
stuff_Concentration.Text = DataGridStuff_Concentration.ToString();
stuff_GRAVITY.Text = DataGridStuff_GRAVITY.ToString();
string DataGridStuff_ProductCode = (DataGridStuff.Columns[1].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,原料代码
string DataGridStuff_ProductName = (DataGridStuff.Columns[2].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第1列选中行单元格,原料名称
string DataGridStuff_Price = (DataGridStuff.Columns[3].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第2列选中行单元格,价格
string DataGridStuff_ProductUnit = (DataGridStuff.Columns[4].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第3列选中行单元格,供应商
string DataGridStuff_ProductType = (DataGridStuff.Columns[5].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第4列选中行单元格,类型
string DataGridStuff_Color = (DataGridStuff.Columns[6].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第5列选中行单元格,色彩
string DataGridStuff_Concentration = (DataGridStuff.Columns[7].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第6列选中行单元格,浓度
string DataGridStuff_GRAVITY = (DataGridStuff.Columns[8].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第7列选中行单元格,比重
stuff_ProductCode.Text = DataGridStuff_ProductCode.ToString();//填入原料代码
stuff_ProductName.Text = DataGridStuff_ProductName.ToString();//填入原料名称
stuff_Price.Text = DataGridStuff_Price.ToString();//填入价格
stuff_ProductUnit.Text = DataGridStuff_ProductUnit.ToString();//填入供应商
stuff_Color.Text = DataGridStuff_Color.ToString();//填入色彩
stuff_Concentration.Text = DataGridStuff_Concentration.ToString();//填入浓度
stuff_GRAVITY.Text = DataGridStuff_GRAVITY.ToString();//填入比重
if (DataGridStuff_ProductType.ToString() == "0") stuff_ProductType.Text = "染料";//判断类型1-染料。2-助剂。3-粉体助剂。冰填入
if (DataGridStuff_ProductType.ToString() == "1") stuff_ProductType.Text = "助剂";
if (DataGridStuff_ProductType.ToString() == "2") stuff_ProductType.Text = "粉体助剂";
}
}
}

Loading…
Cancel
Save