using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Resources; using System; using System.Windows.Data; namespace Muchinfo.MTPClient.Infrastructure.Converters { public class DeliveryAuditStatusConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string result = string.Empty; if (value != null) { switch ((DeliveryStatus)value) { case DeliveryStatus.Noaudit: result = Client_Resource.Infrastructure_NoPending; break; case DeliveryStatus.Audit_ok: result = Client_Resource.Infrastructure_WaitingForDelivery; break; case DeliveryStatus.Audit_refuse: result = Client_Resource.Infrastructure_Refuse; break; case DeliveryStatus.Deliver: result = Client_Resource.Infrastructure_WaitingForReceive; break; case DeliveryStatus.Take: result = Client_Resource.Infrastructure_AlreadyReceive; break; case DeliveryStatus.Cancle: result = Client_Resource.Infrastructure_Cancel; break; case DeliveryStatus.Settle: result = Client_Resource.Infrastructure_Settlement; break; default: break; } } return result; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } public class Qy_DeliveryAuditStatusConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string result = string.Empty; if (value != null) { switch ((QY_DeliveryStatus)value) { case QY_DeliveryStatus.DELIVERY_QY_AUDIT_OK: result = Client_Resource.Infrastructure_CompleteDelivery; break; case QY_DeliveryStatus.DELIVERY_QY_CANCLE: result = Client_Resource.Infrastructure_Cancel; break; case QY_DeliveryStatus.DELIVERY_QY_EXCEPTION: result = Client_Resource.Infrastructure_SettlementException; break; case QY_DeliveryStatus.DELIVERY_QY_NOAUDIT: result = Client_Resource.Infrastructure_NoPending; break; case QY_DeliveryStatus.DELIVERY_QY_TAKE: result = Client_Resource.Infrastructure_ConfirmReceive; break; default: break; } } return result; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } public class Qy_DeliveryAuditStatusIsEnabledConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { bool bo = false; if (value != null) { switch ((QY_DeliveryStatus)value) { case QY_DeliveryStatus.DELIVERY_QY_NOAUDIT: bo = true; break; default: bo = false; break; } } return bo; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }