Files
6098/Cowain.Bake.BLL/Converter/PalletVirtualIdConverter.cs

34 lines
879 B
C#

using System;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
using Prism.Ioc;
namespace Cowain.Bake.BLL.Converter
{
public class PalletVirtualIdConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is int val)
{
var p = MyAppContainer.Current.Resolve<MemoryDataProvider>().GetPalletInfoByVirtualId(val);
if (null == p)
{
return "";
}
else
{
return p.PalletCode;
}
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return 0;
}
}
}