XiangTan_DM/DM_Weight/Converter/StockStatusConverter.cs

48 lines
1.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace DM_Weight.Converter
{
internal class StockStatusConverter : IValueConverter
{
//是否给交接柜补药已补药的则不可勾选未补药的可勾选以进行补药0未补1已补
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
int status = int.Parse(value.ToString());
if (parameter.ToString() == "EnableState")
{
if (status == 0)
{
return true;
}
else
{
return false;
}
}
if (parameter.ToString() == "TextState")
{
if (status == 0)
{
return "未取药";
}
else
{
return "已取药待入库";
}
}
return "";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}