diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 17:17:46 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 17:17:46 +0000 |
| commit | 0440c722a221b8068bbf388c1c0c51f0faff0451 (patch) | |
| tree | 169cbf90c50ff7961db82ecb606c50c2a45a1688 /Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs | |
| parent | 225aa1499e37faf9d38257caabbadc68d78b427e (diff) | |
| download | gestor-master.tar.gz gestor-master.zip | |
Diffstat (limited to 'Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs')
| -rw-r--r-- | Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs b/Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs new file mode 100644 index 0000000..2812699 --- /dev/null +++ b/Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs @@ -0,0 +1,62 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; +using Gestor.Model.Common; + +namespace Gestor.Common.Converters; + +public class ComissaoConverterMulti : IMultiValueConverter +{ + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + //IL_002b: Unknown result type (might be due to invalid IL or missing references) + //IL_0030: Unknown result type (might be due to invalid IL or missing references) + //IL_00d5: Unknown result type (might be due to invalid IL or missing references) + //IL_00d7: Invalid comparison between Unknown and I4 + //IL_00e1: Unknown result type (might be due to invalid IL or missing references) + //IL_00e3: Invalid comparison between Unknown and I4 + //IL_0084: Unknown result type (might be due to invalid IL or missing references) + //IL_0086: Invalid comparison between Unknown and I4 + if (values[0] == DependencyProperty.UnsetValue && values[1] == DependencyProperty.UnsetValue) + { + return null; + } + if (values[1] == DependencyProperty.UnsetValue) + { + return values[0]; + } + object obj = values[0]; + TipoRepasse val = (TipoRepasse)values[1]; + switch (parameter.ToString().ToLower()) + { + default: + if ((int)val == 1) + { + return "--"; + } + return ((decimal?)obj / (decimal?)100).GetValueOrDefault(); + case "tipovendedorcolumn": + if ((int)val == 3) + { + return "CO-CORRETAGEM"; + } + return obj; + case "formapagamentocolumn": + case "incidenciacolumn": + if ((int)val == 3) + { + return "--"; + } + return obj; + case "pagamentosvalorrepassecolumn": + case "repassevendedor": + return obj; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + return null; + } +} |