eDoneDeliveryOrderAppealToEnable.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 eDoneDeliveryOrderAppealToEnable : IValueConverter
  10. {
  11. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. //DeliveryStatus_ContractTime
  14. string[] resultValue = value.ToString().Split(',');
  15. var result = true;
  16. if (resultValue[0] != null)
  17. {
  18. switch ((eDeliveryStatus)int.Parse(resultValue[0].ToString()))
  19. {
  20. case eDeliveryStatus.DELIVERYSTATUS_PERFORMANCEFINISHED:
  21. if (resultValue[1] != null && DateTime.Parse(DateTime.Parse(resultValue[1].ToString()).ToShortDateString()) >= DateTime.Parse(ApplicationParameter.ServerTimeNow.ToShortDateString()))
  22. result = false;
  23. break;
  24. default:
  25. result = true;
  26. break;
  27. }
  28. }
  29. return result;
  30. }
  31. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  32. {
  33. throw new NotImplementedException();
  34. }
  35. }
  36. }