Merge branch 'master' of http://192.168.0.12:13000/sc/Audit_APP
This commit is contained in:
commit
b5c862069d
4 files changed
+76
-16
No files matched your search
@@ -143,6 +143,7 @@
|
|||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Compile Include="AuditData.cs" />
|
<Compile Include="AuditData.cs" />
|
||||||
<Compile Include="ConvertMoels\ColorSQLConvert.cs" />
|
<Compile Include="ConvertMoels\ColorSQLConvert.cs" />
|
||||||
|
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
||||||
<Compile Include="ViewModel\LogViewModel.cs" />
|
<Compile Include="ViewModel\LogViewModel.cs" />
|
||||||
<Compile Include="ViewModel\MainViewModel.cs" />
|
<Compile Include="ViewModel\MainViewModel.cs" />
|
||||||
<Compile Include="ViewModel\QueryViewModel.cs" />
|
<Compile Include="ViewModel\QueryViewModel.cs" />
|
||||||
|
|||||||
@@ -5,10 +5,8 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace Audit.ConvertMoels
|
namespace Audit.ConvertMoels
|
||||||
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// RGB色彩数值转换器
|
/// RGB色彩数值转换器
|
||||||
@@ -21,19 +19,19 @@ namespace Audit.ConvertMoels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value != null)
|
if (value != null)
|
||||||
{
|
{
|
||||||
string colorValue = string.Format("{0:X6}", (int)value);//十进制RGB数值转十六进制六位RGB并补0位例“C0C0C0”
|
string colorValue = string.Format("{0:X6}", (int)value);//十进制RGB数值转十六进制六位RGB并补0位例“C0C0C0”
|
||||||
//string StuffColor = "#FF" + colorValue;//RGB数值拼接为ARGB数值(正向)
|
//string StuffColor = "#FF" + colorValue;//RGB数值拼接为ARGB数值(正向)
|
||||||
string StuffColor_B = colorValue.Substring(0, 2);//获取蓝色参数
|
string StuffColor_B = colorValue.Substring(0, 2);//获取蓝色参数
|
||||||
string StuffColor_G = colorValue.Substring(2, 2);//获取绿色参数
|
string StuffColor_G = colorValue.Substring(2, 2);//获取绿色参数
|
||||||
string StuffColor_R = colorValue.Substring(4, 2);//获取红色参数
|
string StuffColor_R = colorValue.Substring(4, 2);//获取红色参数
|
||||||
string StuffColor = "#FF" + StuffColor_R + StuffColor_G + StuffColor_B;//RGB数值拼接为ARGB数值
|
string StuffColor = "#FF" + StuffColor_R + StuffColor_G + StuffColor_B;//RGB数值拼接为ARGB数值
|
||||||
return StuffColor;//返回RGB数值例“#FFC0C0C0”
|
return StuffColor;//返回RGB数值例“#FFC0C0C0”
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return "";//返回白色RGB数值
|
return "";//返回白色RGB数值
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Audit.ConvertMoels
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 原料类型数值转换器
|
||||||
|
/// 将类型数值转换为类型名称返回
|
||||||
|
/// </summary>
|
||||||
|
internal class ProductTypeSQLConvert : IValueConverter
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
if ((int)value == 0)
|
||||||
|
{
|
||||||
|
return "染料";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((int)value == 1)
|
||||||
|
{
|
||||||
|
return "助剂";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((int)value == 2)
|
||||||
|
{
|
||||||
|
return "粉体助剂";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((int)value == 3)
|
||||||
|
{
|
||||||
|
return "液体染料";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "未知类型";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// </summary>
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-1
@@ -11,6 +11,7 @@
|
|||||||
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro">
|
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Convert:ColorSQLConvert x:Key="ColorSQLConvert"/>
|
<Convert:ColorSQLConvert x:Key="ColorSQLConvert"/>
|
||||||
|
<Convert:ProductTypeSQLConvert x:Key="ProductTypeSQLConvert"/>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -55,7 +56,8 @@
|
|||||||
<DataGridTextColumn Header="原料名称" Width="200" FontSize="15" Binding="{Binding ProductName}" MaxWidth="300" MinWidth="200" CanUserReorder="False"/>
|
<DataGridTextColumn Header="原料名称" Width="200" FontSize="15" Binding="{Binding ProductName}" MaxWidth="300" MinWidth="200" CanUserReorder="False"/>
|
||||||
<DataGridTextColumn Header="价格" Width="100" FontSize="15" Binding="{Binding Price}" MaxWidth="200" MinWidth="100" CanUserReorder="False"/>
|
<DataGridTextColumn Header="价格" Width="100" FontSize="15" Binding="{Binding Price}" MaxWidth="200" MinWidth="100" CanUserReorder="False"/>
|
||||||
<DataGridTextColumn Header="供应商" Width="150" FontSize="15" Binding="{Binding ProductUnit}" MaxWidth="250" MinWidth="150" CanUserReorder="False"/>
|
<DataGridTextColumn Header="供应商" Width="150" FontSize="15" Binding="{Binding ProductUnit}" MaxWidth="250" MinWidth="150" CanUserReorder="False"/>
|
||||||
<DataGridTextColumn Header="原料类型" Width="80" FontSize="15" Binding="{Binding ProductType}" MaxWidth="200" MinWidth="70" CanUserReorder="False"/>
|
<DataGridTextColumn Header="原料类型" Width="80" FontSize="15" Binding="{Binding ProductType}" MaxWidth="200" MinWidth="70" CanUserReorder="False">
|
||||||
|
</DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="色彩" Width="100" MaxWidth="500" Binding="{Binding Color}" MinWidth="50" CanUserReorder="False">
|
<DataGridTextColumn Header="色彩" Width="100" MaxWidth="500" Binding="{Binding Color}" MinWidth="50" CanUserReorder="False">
|
||||||
<DataGridTextColumn.ElementStyle>
|
<DataGridTextColumn.ElementStyle>
|
||||||
<Style TargetType="{x:Type TextBlock}">
|
<Style TargetType="{x:Type TextBlock}">
|
||||||
|
|||||||
Reference in new issue
Block a user