summaryrefslogtreecommitdiff
path: root/Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs
blob: 28126990a0af4fd70dc87f0b538755e5d8a5d54c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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;
	}
}