This commit is contained in:
sc committed 2024-08-16 23:06:41 +08:00
commit 51c2aae2e9
13 files changed
+281 -28

No files matched your search

+59
View File
@@ -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 DyeingComputer.ConvertMoels
{
/// <summary>
/// 原料类型数值转换器
/// 将类型数值转换为类型名称返回
/// </summary>
internal class ProductTypeSQLConvert : IValueConverter
{
/// <summary>
/// </summary>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string ProductType = System.Convert.ToString(value);
if (ProductType == "1")//类型0:染料,1:助剂,2:粉体助剂,3:液体染料,其它:未知
{
return "染料";
}
else
{
if (ProductType == "2")
{
return "助剂";
}
else
{
if (ProductType == "3")
{
return "粉体助剂";
}
else
{
if (ProductType == "4")
{
return "液体染料";
}
else
{
return "未知类型";
}
}
}
}
}
/// <summary>
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}
+42
View File
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace DyeingComputer.ConvertMoels
{
internal class StatenConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
{
return null;
}
else
{
string Staten = null;
string i = value.ToString();
if (i == "101") Staten = "准备就绪";
if (i == "102") Staten = "计量输送";
if (i == "201") Staten = "自动状态";
if (i == "202") Staten = "转入排队";
if (i == "203") Staten = "等待命令";
if (i == "301") Staten = "步骤完成";
if (i == "309") Staten = "输送异常";
return Staten;
}
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}