DeliveryAuditStatusConverter.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. using Muchinfo.MTPClient.Data.Enums;
  2. using Muchinfo.MTPClient.Resources;
  3. using System;
  4. using System.Windows.Data;
  5. namespace Muchinfo.MTPClient.Infrastructure.Converters
  6. {
  7. public class DeliveryAuditStatusConverter : IValueConverter
  8. {
  9. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  10. {
  11. string result = string.Empty;
  12. if (value != null)
  13. {
  14. switch ((DeliveryStatus)value)
  15. {
  16. case DeliveryStatus.Noaudit:
  17. result = Client_Resource.Infrastructure_NoPending;
  18. break;
  19. case DeliveryStatus.Audit_ok:
  20. result = Client_Resource.Infrastructure_WaitingForDelivery;
  21. break;
  22. case DeliveryStatus.Audit_refuse:
  23. result = Client_Resource.Infrastructure_Refuse;
  24. break;
  25. case DeliveryStatus.Deliver:
  26. result = Client_Resource.Infrastructure_WaitingForReceive;
  27. break;
  28. case DeliveryStatus.Take:
  29. result = Client_Resource.Infrastructure_AlreadyReceive;
  30. break;
  31. case DeliveryStatus.Cancle:
  32. result = Client_Resource.Infrastructure_Cancel;
  33. break;
  34. case DeliveryStatus.Settle:
  35. result = Client_Resource.Infrastructure_Settlement;
  36. break;
  37. default:
  38. break;
  39. }
  40. }
  41. return result;
  42. }
  43. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  44. {
  45. throw new NotImplementedException();
  46. }
  47. }
  48. public class Qy_DeliveryAuditStatusConverter : IValueConverter
  49. {
  50. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  51. {
  52. string result = string.Empty;
  53. if (value != null)
  54. {
  55. switch ((QY_DeliveryStatus)value)
  56. {
  57. case QY_DeliveryStatus.DELIVERY_QY_AUDIT_OK:
  58. result = Client_Resource.Infrastructure_CompleteDelivery;
  59. break;
  60. case QY_DeliveryStatus.DELIVERY_QY_CANCLE:
  61. result = Client_Resource.Infrastructure_Cancel;
  62. break;
  63. case QY_DeliveryStatus.DELIVERY_QY_EXCEPTION:
  64. result = Client_Resource.Infrastructure_SettlementException;
  65. break;
  66. case QY_DeliveryStatus.DELIVERY_QY_NOAUDIT:
  67. result = Client_Resource.Infrastructure_NoPending;
  68. break;
  69. case QY_DeliveryStatus.DELIVERY_QY_TAKE:
  70. result = Client_Resource.Infrastructure_ConfirmReceive;
  71. break;
  72. default:
  73. break;
  74. }
  75. }
  76. return result;
  77. }
  78. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  79. {
  80. throw new NotImplementedException();
  81. }
  82. }
  83. public class Qy_DeliveryAuditStatusIsEnabledConverter : IValueConverter
  84. {
  85. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  86. {
  87. bool bo = false;
  88. if (value != null)
  89. {
  90. switch ((QY_DeliveryStatus)value)
  91. {
  92. case QY_DeliveryStatus.DELIVERY_QY_NOAUDIT:
  93. bo = true;
  94. break;
  95. default:
  96. bo = false;
  97. break;
  98. }
  99. }
  100. return bo;
  101. }
  102. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  103. {
  104. throw new NotImplementedException();
  105. }
  106. }
  107. }