| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows.Data;
- namespace Muchinfo.MTPClient.Infrastructure.Converters
- {
- public class NumToButtonIsEnabledConvert : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- //pValue_hValue_countNum//pValue确认票给付,hValue确认货给付,countNum交割单号数量
- string[] result = value.ToString().Split(',');
- if (result.Count() > 2)
- {
- if (result[2] != null && result[1] != null && result[0] != null)
- {
- //pValue_hValue默认不填写的情况
- if (int.Parse(result[0].ToString()) == 0 && int.Parse(result[1].ToString()) == 0)
- {
- if (int.Parse(result[0].ToString()) == 2)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- else
- {
- #region 默认填写的情况判断
- if ((int.Parse(result[0].ToString()) == 100 || int.Parse(result[1].ToString()) == 100) && int.Parse(result[2].ToString()) == 1)
- {
- return false;
- }
- else if ((int.Parse(result[0].ToString()) != 100 && int.Parse(result[1].ToString()) != 100) && int.Parse(result[2].ToString()) == 2)
- {
- return false;
- }
- else
- {
- return true;
- }
- #endregion
- }
-
- }
- }
- return false;
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|