48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
|
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();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|