blob: 5797387689289c10732d568ae71529b171328018 (
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
63
64
65
66
67
68
69
70
71
72
73
74
|
using Gestor.Model.Common;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Gestor.Common.Converters
{
public class ComissaoConverterMulti : IMultiValueConverter
{
public ComissaoConverterMulti()
{
}
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
decimal? nullable;
decimal? nullable1;
if (values[0] == DependencyProperty.UnsetValue && values[1] == DependencyProperty.UnsetValue)
{
return null;
}
if (values[1] == DependencyProperty.UnsetValue)
{
return values[0];
}
object obj = values[0];
TipoRepasse tipoRepasse = (TipoRepasse)values[1];
string lower = parameter.ToString().ToLower();
if (lower == "tipovendedorcolumn")
{
if (tipoRepasse == TipoRepasse.CoCorretagem)
{
return "CO-CORRETAGEM";
}
return obj;
}
if (lower == "formapagamentocolumn" || lower == "incidenciacolumn")
{
if (tipoRepasse == TipoRepasse.CoCorretagem)
{
return "--";
}
return obj;
}
if (lower == "pagamentosvalorrepassecolumn" || lower == "repassevendedor")
{
return obj;
}
if (tipoRepasse == TipoRepasse.ValorFixo)
{
return "--";
}
decimal? nullable2 = (decimal?)obj;
decimal num = 100;
if (nullable2.HasValue)
{
nullable1 = new decimal?(nullable2.GetValueOrDefault() / num);
}
else
{
nullable = null;
nullable1 = nullable;
}
nullable = nullable1;
return nullable.GetValueOrDefault();
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
return null;
}
}
}
|