eDoneDeliveryOrderStatusToVisibility.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Muchinfo.MTPClient.Data.Enums;
  2. using Muchinfo.MTPClient.Infrastructure.Utilities;
  3. using Muchinfo.MTPClient.Resources;
  4. using System;
  5. using System.Windows;
  6. using System.Windows.Data;
  7. namespace Muchinfo.MTPClient.Infrastructure.Converters
  8. {
  9. public class eDoneDeliveryOrderStatusToVisibility : IValueConverter
  10. {
  11. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. //DeliveryStatus_ContractTime_IsSellAccountId
  14. string[] resultValue = value.ToString().Split(',');
  15. var result = Visibility.Hidden;
  16. if (resultValue[0] != null)
  17. {
  18. switch ((eDeliveryStatus)int.Parse(resultValue[0].ToString()))
  19. {
  20. case eDeliveryStatus.DELIVERYSTATUS_TRADED:
  21. case eDeliveryStatus.DELIVERYSTATUS_PERFORMANCEFINISHED:
  22. if (resultValue[2].ToUpper() != "TRUE")//只有买方才出现确认货票按钮
  23. {
  24. if (resultValue[1] != null && DateTime.Parse(DateTime.Parse(resultValue[1].ToString()).ToShortDateString()) >= DateTime.Parse(ApplicationParameter.ServerTimeNow.ToShortDateString()))
  25. result = Visibility.Visible;
  26. }
  27. break;
  28. default:
  29. result = Visibility.Hidden;
  30. break;
  31. }
  32. }
  33. return result;
  34. }
  35. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  36. {
  37. //bool tt = false;true
  38. throw new NotImplementedException();
  39. }
  40. }
  41. }