统计页面增加订单详情页
This commit is contained in:
1 parent
545a0751c8
commit
b0ec6ef3ea
9 files changed
+484
-83
No files matched your search
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace _29WxOrderWpf.Converters
|
||||
{
|
||||
/// <summary>
|
||||
/// 金额转换:分 -> 元(除以 100)。
|
||||
/// 用于把后台返回的以“分”为单位的金额字段显示为“元”。
|
||||
/// </summary>
|
||||
public class FenToYuanConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
decimal fen;
|
||||
if (value is int intValue)
|
||||
fen = intValue;
|
||||
else if (value is long longValue)
|
||||
fen = longValue;
|
||||
else if (value is decimal decimalValue)
|
||||
fen = decimalValue;
|
||||
else if (value is double doubleValue)
|
||||
fen = (decimal)doubleValue;
|
||||
else
|
||||
return 0m;
|
||||
|
||||
return fen / 100m;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
// 单向绑定,反向转换不实现
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user