diff options
Diffstat (limited to 'Codemerx/Gestor.Application/Converters')
71 files changed, 3691 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Application/Converters/ActualHeightConverter.cs b/Codemerx/Gestor.Application/Converters/ActualHeightConverter.cs new file mode 100644 index 0000000..1d521c9 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ActualHeightConverter.cs @@ -0,0 +1,33 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ActualHeightConverter : MarkupExtension, IValueConverter
+ {
+ public ActualHeightConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return 0;
+ }
+ return (double)value - 20;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ArquivoDigitalVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/ArquivoDigitalVisibilityConverter.cs new file mode 100644 index 0000000..61b456a --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ArquivoDigitalVisibilityConverter.cs @@ -0,0 +1,30 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ArquivoDigitalVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public ArquivoDigitalVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (value == null ? Visibility.Collapsed : Visibility.Visible);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/AssinaturasVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/AssinaturasVisibilityConverter.cs new file mode 100644 index 0000000..b32db66 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/AssinaturasVisibilityConverter.cs @@ -0,0 +1,32 @@ +using Gestor.Model.Common;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class AssinaturasVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public AssinaturasVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (value == null || ((List<StatusDocumentoAssinado>)value).Count == 0 ? Visibility.Collapsed : Visibility.Visible);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/AssistenciaVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/AssistenciaVisibilityConverter.cs new file mode 100644 index 0000000..6268f3d --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/AssistenciaVisibilityConverter.cs @@ -0,0 +1,35 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class AssistenciaVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public AssistenciaVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return Visibility.Collapsed;
+ }
+ return ((TipoContatoSeguradora)value == 1 ? Visibility.Visible : Visibility.Collapsed);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/AtivoToColorConverter.cs b/Codemerx/Gestor.Application/Converters/AtivoToColorConverter.cs new file mode 100644 index 0000000..b258583 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/AtivoToColorConverter.cs @@ -0,0 +1,35 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class AtivoToColorConverter : MarkupExtension, IValueConverter
+ {
+ public AtivoToColorConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (((bool?)value).GetValueOrDefault(true))
+ {
+ return new SolidColorBrush(Colors.Red);
+ }
+ return new SolidColorBrush((Color)System.Windows.Application.Current.Resources["AggerBlue"]);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/AtivoToStringConverter.cs b/Codemerx/Gestor.Application/Converters/AtivoToStringConverter.cs new file mode 100644 index 0000000..f59b507 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/AtivoToStringConverter.cs @@ -0,0 +1,33 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class AtivoToStringConverter : MarkupExtension, IValueConverter
+ {
+ public AtivoToStringConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (!((bool?)value).GetValueOrDefault(true))
+ {
+ return "ATIVAR";
+ }
+ return "INATIVAR";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/BaixarVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/BaixarVisibilityConverter.cs new file mode 100644 index 0000000..7939567 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/BaixarVisibilityConverter.cs @@ -0,0 +1,41 @@ +using Gestor.Model.Common;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class BaixarVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public BaixarVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return Visibility.Collapsed;
+ }
+ return ((new List<StatusParcela>()
+ {
+ 1,
+ 13,
+ 10
+ }).Contains((StatusParcela)value) ? Visibility.Collapsed : Visibility.Visible);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/BoletosNotasConverter.cs b/Codemerx/Gestor.Application/Converters/BoletosNotasConverter.cs new file mode 100644 index 0000000..e1830a0 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/BoletosNotasConverter.cs @@ -0,0 +1,31 @@ +using Gestor.Application.Model.Ajuda;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class BoletosNotasConverter : MarkupExtension, IValueConverter
+ {
+ public BoletosNotasConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (string.IsNullOrEmpty(((Boleto)value).Nota) ? Visibility.Hidden : Visibility.Visible);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/BoolToGridHeightOneStarConverter.cs b/Codemerx/Gestor.Application/Converters/BoolToGridHeightOneStarConverter.cs new file mode 100644 index 0000000..636dc5e --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/BoolToGridHeightOneStarConverter.cs @@ -0,0 +1,40 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class BoolToGridHeightOneStarConverter : MarkupExtension, IValueConverter
+ {
+ public BoolToGridHeightOneStarConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ int num;
+ int num1 = 1;
+ if (parameter != null && int.TryParse(parameter.ToString(), out num))
+ {
+ num1 = num;
+ }
+ if (value != null && (bool)value && num1 == 1000)
+ {
+ return new GridLength(1, GridUnitType.Auto);
+ }
+ return (value == null || !(bool)value ? new GridLength(0) : new GridLength((double)num1, GridUnitType.Star));
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/CalculoIconConverter.cs b/Codemerx/Gestor.Application/Converters/CalculoIconConverter.cs new file mode 100644 index 0000000..e7bb148 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/CalculoIconConverter.cs @@ -0,0 +1,42 @@ +using Gestor.Model.Domain.Aggilizador;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class CalculoIconConverter : MarkupExtension, IValueConverter
+ {
+ public CalculoIconConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ Uri uri = new Uri("pack://application:,,,Gestor.Application;component/Assets/Images/CalculoIcon.png");
+ if (value == null)
+ {
+ return uri;
+ }
+ if (!((List<Calculo>)value).Any<Calculo>((Calculo x) => x.get_Status() == 2))
+ {
+ return new Uri("pack://application:,,,Gestor.Application;component/Assets/Images/CalculoIcon.png");
+ }
+ return new Uri("pack://application:,,,Gestor.Application;component/Assets/Images/CalculoIconOk.png");
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ColorStatusConverter.cs b/Codemerx/Gestor.Application/Converters/ColorStatusConverter.cs new file mode 100644 index 0000000..b7cc4f9 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ColorStatusConverter.cs @@ -0,0 +1,75 @@ +using Gestor.Model.Common;
+using Gestor.Model.Validation;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class ColorStatusConverter : IMultiValueConverter
+ {
+ public ColorStatusConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (values[2] != null && values[2] is bool && (bool)values[2])
+ {
+ return new SolidColorBrush(Colors.Red);
+ }
+ object obj = values[0];
+ if (obj == null)
+ {
+ return new SolidColorBrush(Colors.White);
+ }
+ if (!(obj is TipoSeguro))
+ {
+ return new SolidColorBrush(Colors.White);
+ }
+ switch ((TipoSeguro)values[0])
+ {
+ case 3:
+ {
+ return new SolidColorBrush(Colors.Red);
+ }
+ case 5:
+ {
+ return new SolidColorBrush(Colors.DarkBlue);
+ }
+ case 6:
+ {
+ return new SolidColorBrush(Colors.Gray);
+ }
+ case 7:
+ {
+ return new SolidColorBrush(Colors.DimGray);
+ }
+ default:
+ {
+ if (values[1] == null)
+ {
+ return new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ DateTime? nullable = (DateTime?)values[1];
+ DateTime dateTime = Funcoes.GetNetworkTime().Date.AddDays(-6);
+ if ((nullable.HasValue ? nullable.GetValueOrDefault() < dateTime : true))
+ {
+ return new SolidColorBrush(Colors.Goldenrod);
+ }
+ return new SolidColorBrush(Colors.Green);
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ContatoSeguradoraVisibiltyConverter.cs b/Codemerx/Gestor.Application/Converters/ContatoSeguradoraVisibiltyConverter.cs new file mode 100644 index 0000000..4bdffcf --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ContatoSeguradoraVisibiltyConverter.cs @@ -0,0 +1,35 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ContatoSeguradoraVisibiltyConverter : MarkupExtension, IValueConverter
+ {
+ public ContatoSeguradoraVisibiltyConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return Visibility.Visible;
+ }
+ return ((TipoContatoSeguradora)value == 1 ? Visibility.Collapsed : Visibility.Visible);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/DesconsiderarVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/DesconsiderarVisibilityConverter.cs new file mode 100644 index 0000000..8a3c13e --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/DesconsiderarVisibilityConverter.cs @@ -0,0 +1,43 @@ +using Gestor.Model.Common;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class DesconsiderarVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public DesconsiderarVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return Visibility.Collapsed;
+ }
+ return ((new List<StatusParcela>()
+ {
+ 8,
+ 6,
+ 1,
+ 13,
+ 10
+ }).Contains((StatusParcela)value) ? Visibility.Collapsed : Visibility.Visible);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/DiasPentendesConverter.cs b/Codemerx/Gestor.Application/Converters/DiasPentendesConverter.cs new file mode 100644 index 0000000..c684fe8 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/DiasPentendesConverter.cs @@ -0,0 +1,33 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class DiasPentendesConverter : MarkupExtension, IValueConverter
+ {
+ public DiasPentendesConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return "";
+ }
+ return string.Format("{0} DIAS", value);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/DocumentoEtiquetaConverter.cs b/Codemerx/Gestor.Application/Converters/DocumentoEtiquetaConverter.cs new file mode 100644 index 0000000..e1defd3 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/DocumentoEtiquetaConverter.cs @@ -0,0 +1,49 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class DocumentoEtiquetaConverter : IMultiValueConverter
+ {
+ public DocumentoEtiquetaConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ object obj;
+ object obj1;
+ try
+ {
+ if (values != null)
+ {
+ if ((TipoProtocoloEtiqueta)values[0] == 1)
+ {
+ obj1 = " - ";
+ }
+ else
+ {
+ obj1 = values[1];
+ }
+ obj = obj1;
+ }
+ else
+ {
+ obj = "";
+ }
+ }
+ catch
+ {
+ obj = "";
+ }
+ return obj;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/EmpresaNomeConverter.cs b/Codemerx/Gestor.Application/Converters/EmpresaNomeConverter.cs new file mode 100644 index 0000000..54ceb4c --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/EmpresaNomeConverter.cs @@ -0,0 +1,38 @@ +using Gestor.Application.Helpers;
+using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Generic;
+using System;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class EmpresaNomeConverter : MarkupExtension, IValueConverter
+ {
+ public EmpresaNomeConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null && (long)value != 0)
+ {
+ return Recursos.Empresas.First<Empresa>((Empresa x) => x.get_Id() == (long)value).get_Nome();
+ }
+ return Recursos.Empresas.First<Empresa>((Empresa x) => x.get_Id() == (long)1).get_Nome();
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/EnderecoConverter.cs b/Codemerx/Gestor.Application/Converters/EnderecoConverter.cs new file mode 100644 index 0000000..d31f10e --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/EnderecoConverter.cs @@ -0,0 +1,191 @@ +using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using System;
+using System.Collections.ObjectModel;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class EnderecoConverter : MarkupExtension, IValueConverter
+ {
+ public EnderecoConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ string str;
+ string str1;
+ string str2;
+ string str3;
+ string str4;
+ string str5;
+ string str6;
+ string str7;
+ string str8;
+ string str9;
+ string str10;
+ string str11;
+ if (value == null)
+ {
+ return "";
+ }
+ if (!(value is ObservableCollection<ClienteEndereco>))
+ {
+ return "";
+ }
+ ObservableCollection<ClienteEndereco> observableCollection = (ObservableCollection<ClienteEndereco>)value;
+ if (string.IsNullOrWhiteSpace(observableCollection[0].get_Complemento()))
+ {
+ string[] strArrays = new string[11];
+ string endereco = observableCollection[0].get_Endereco();
+ if (endereco != null)
+ {
+ str = endereco.Trim();
+ }
+ else
+ {
+ str = null;
+ }
+ strArrays[0] = str;
+ strArrays[1] = ", ";
+ string numero = observableCollection[0].get_Numero();
+ if (numero != null)
+ {
+ str1 = numero.Trim();
+ }
+ else
+ {
+ str1 = null;
+ }
+ strArrays[2] = str1;
+ strArrays[3] = ", ";
+ string bairro = observableCollection[0].get_Bairro();
+ if (bairro != null)
+ {
+ str2 = bairro.Trim();
+ }
+ else
+ {
+ str2 = null;
+ }
+ strArrays[4] = str2;
+ strArrays[5] = " - ";
+ string cidade = observableCollection[0].get_Cidade();
+ if (cidade != null)
+ {
+ str3 = cidade.Trim();
+ }
+ else
+ {
+ str3 = null;
+ }
+ strArrays[6] = str3;
+ strArrays[7] = "/";
+ string estado = observableCollection[0].get_Estado();
+ if (estado != null)
+ {
+ str4 = estado.Trim();
+ }
+ else
+ {
+ str4 = null;
+ }
+ strArrays[8] = str4;
+ strArrays[9] = " - ";
+ string cep = observableCollection[0].get_Cep();
+ if (cep != null)
+ {
+ str5 = cep.Trim();
+ }
+ else
+ {
+ str5 = null;
+ }
+ strArrays[10] = str5;
+ return string.Concat(strArrays);
+ }
+ string[] strArrays1 = new string[13];
+ string endereco1 = observableCollection[0].get_Endereco();
+ if (endereco1 != null)
+ {
+ str6 = endereco1.Trim();
+ }
+ else
+ {
+ str6 = null;
+ }
+ strArrays1[0] = str6;
+ strArrays1[1] = ", ";
+ string numero1 = observableCollection[0].get_Numero();
+ if (numero1 != null)
+ {
+ str7 = numero1.Trim();
+ }
+ else
+ {
+ str7 = null;
+ }
+ strArrays1[2] = str7;
+ strArrays1[3] = ", ";
+ strArrays1[4] = observableCollection[0].get_Complemento().Trim();
+ strArrays1[5] = ", ";
+ string bairro1 = observableCollection[0].get_Bairro();
+ if (bairro1 != null)
+ {
+ str8 = bairro1.Trim();
+ }
+ else
+ {
+ str8 = null;
+ }
+ strArrays1[6] = str8;
+ strArrays1[7] = " - ";
+ string cidade1 = observableCollection[0].get_Cidade();
+ if (cidade1 != null)
+ {
+ str9 = cidade1.Trim();
+ }
+ else
+ {
+ str9 = null;
+ }
+ strArrays1[8] = str9;
+ strArrays1[9] = "/";
+ string estado1 = observableCollection[0].get_Estado();
+ if (estado1 != null)
+ {
+ str10 = estado1.Trim();
+ }
+ else
+ {
+ str10 = null;
+ }
+ strArrays1[10] = str10;
+ strArrays1[11] = " - ";
+ string cep1 = observableCollection[0].get_Cep();
+ if (cep1 != null)
+ {
+ str11 = cep1.Trim();
+ }
+ else
+ {
+ str11 = null;
+ }
+ strArrays1[12] = str11;
+ return string.Concat(strArrays1);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/EnviadoColorConverter.cs b/Codemerx/Gestor.Application/Converters/EnviadoColorConverter.cs new file mode 100644 index 0000000..7e56ca0 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/EnviadoColorConverter.cs @@ -0,0 +1,69 @@ +using Gestor.Model.Common;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class EnviadoColorConverter : MarkupExtension, IValueConverter
+ {
+ public EnviadoColorConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null || !(value is List<StatusDocumentoAssinado>))
+ {
+ return new SolidColorBrush(Colors.IndianRed);
+ }
+ List<StatusDocumentoAssinado> statusDocumentoAssinados = (List<StatusDocumentoAssinado>)value;
+ int num = statusDocumentoAssinados.Count<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => {
+ if (x.get_Status() == 1)
+ {
+ return true;
+ }
+ return x.get_Status() == 4;
+ });
+ int num1 = statusDocumentoAssinados.Count<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 0);
+ int num2 = statusDocumentoAssinados.Count<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 2);
+ if (statusDocumentoAssinados.All<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 3))
+ {
+ return new SolidColorBrush(Colors.IndianRed);
+ }
+ if (num2 > 0)
+ {
+ return new SolidColorBrush(Colors.Red);
+ }
+ if (num > 0 && num1 == 0 && num2 == 0)
+ {
+ return new SolidColorBrush(Colors.ForestGreen);
+ }
+ if (num == 0 && num1 > 0 && num2 == 0)
+ {
+ return new SolidColorBrush((Color)System.Windows.Application.Current.Resources["AggerBlue"]);
+ }
+ if (num <= 0 || num1 <= 0 || num2 != 0)
+ {
+ return new SolidColorBrush(Colors.IndianRed);
+ }
+ return new SolidColorBrush((Color)System.Windows.Application.Current.Resources["AggerYellow100"]);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/EnviadoConverter.cs b/Codemerx/Gestor.Application/Converters/EnviadoConverter.cs new file mode 100644 index 0000000..9fe764f --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/EnviadoConverter.cs @@ -0,0 +1,39 @@ +using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class EnviadoConverter : IMultiValueConverter
+ {
+ public EnviadoConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (((IEnumerable<object>)values).Any<object>((object x) => x == null))
+ {
+ return Visibility.Collapsed;
+ }
+ if (values[0] is bool && (bool)values[0])
+ {
+ return Visibility.Collapsed;
+ }
+ if (values[1] is bool && (bool)values[1])
+ {
+ return Visibility.Visible;
+ }
+ return Visibility.Collapsed;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/EnviadoIconConverter.cs b/Codemerx/Gestor.Application/Converters/EnviadoIconConverter.cs new file mode 100644 index 0000000..a29e631 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/EnviadoIconConverter.cs @@ -0,0 +1,65 @@ +using ControlzEx;
+using Gestor.Model.Common;
+using MaterialDesignThemes.Wpf;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class EnviadoIconConverter : MarkupExtension, IValueConverter
+ {
+ public EnviadoIconConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ PackIcon packIcon = new PackIcon();
+ if (value == null || !(value is List<StatusDocumentoAssinado>))
+ {
+ packIcon.set_Kind(2689);
+ return packIcon;
+ }
+ List<StatusDocumentoAssinado> statusDocumentoAssinados = (List<StatusDocumentoAssinado>)value;
+ int num = statusDocumentoAssinados.Count<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 1);
+ int num1 = statusDocumentoAssinados.Count<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 0);
+ int num2 = statusDocumentoAssinados.Count<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 2);
+ if (statusDocumentoAssinados.All<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 3))
+ {
+ packIcon.set_Kind(2689);
+ }
+ if (num2 > 0)
+ {
+ packIcon.set_Kind(789);
+ }
+ if (num > 0 && num1 == 0 && num2 == 0)
+ {
+ packIcon.set_Kind(2685);
+ }
+ if (num == 0 && num1 > 0 && num2 == 0)
+ {
+ packIcon.set_Kind(2685);
+ }
+ if (num > 0 && num1 > 0 && num2 == 0)
+ {
+ packIcon.set_Kind(95);
+ }
+ return packIcon;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/EnviadoTooTipConverter.cs b/Codemerx/Gestor.Application/Converters/EnviadoTooTipConverter.cs new file mode 100644 index 0000000..e2f4b00 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/EnviadoTooTipConverter.cs @@ -0,0 +1,67 @@ +using Gestor.Model.Common;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class EnviadoTooTipConverter : MarkupExtension, IValueConverter
+ {
+ public EnviadoTooTipConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null || !(value is List<StatusDocumentoAssinado>))
+ {
+ return "";
+ }
+ List<StatusDocumentoAssinado> statusDocumentoAssinados = (List<StatusDocumentoAssinado>)value;
+ int num = statusDocumentoAssinados.Count<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => {
+ if (x.get_Status() == 1)
+ {
+ return true;
+ }
+ return x.get_Status() == 4;
+ });
+ int num1 = statusDocumentoAssinados.Count<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 0);
+ int num2 = statusDocumentoAssinados.Count<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 2);
+ if (statusDocumentoAssinados.All<StatusDocumentoAssinado>((StatusDocumentoAssinado x) => x.get_Status() == 3))
+ {
+ return "ASSINAR SELECIONADOS";
+ }
+ if (num2 > 0)
+ {
+ return "HÁ ASSINATURAS REJEITADAS PARA ESSE DOCUMENTO";
+ }
+ if (num > 0 && num1 == 0 && num2 == 0)
+ {
+ return "DOCUMENTO ASSINADO";
+ }
+ if (num == 0 && num1 > 0 && num2 == 0)
+ {
+ return "ASSINATURA PENDENTE";
+ }
+ if (num > 0 && num1 > 0 && num2 == 0)
+ {
+ return "CLIQUE PARA VERIFICAR O STATUS DAS ASSINATURAS";
+ }
+ return "ASSINAR DOCUMENTOS";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/EqualToCollapsedConverter.cs b/Codemerx/Gestor.Application/Converters/EqualToCollapsedConverter.cs new file mode 100644 index 0000000..a254e8c --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/EqualToCollapsedConverter.cs @@ -0,0 +1,47 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class EqualToCollapsedConverter : IMultiValueConverter
+ {
+ public EqualToCollapsedConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ Visibility visibility;
+ object obj = values[0];
+ if (obj is long)
+ {
+ long num = (long)obj;
+ obj = values[1];
+ if (!(obj is long))
+ {
+ visibility = Visibility.Visible;
+ return visibility;
+ }
+ if (num == (long)obj)
+ {
+ visibility = Visibility.Collapsed;
+ return visibility;
+ }
+ else
+ {
+ visibility = Visibility.Visible;
+ return visibility;
+ }
+ }
+ visibility = Visibility.Visible;
+ return visibility;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ExcluidoStringConverter.cs b/Codemerx/Gestor.Application/Converters/ExcluidoStringConverter.cs new file mode 100644 index 0000000..e02410e --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ExcluidoStringConverter.cs @@ -0,0 +1,33 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ExcluidoStringConverter : MarkupExtension, IValueConverter
+ {
+ public ExcluidoStringConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is bool && (bool)value)
+ {
+ return "EXCLUÍDO";
+ }
+ return "";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ExcluirVendedorLabelConverter.cs b/Codemerx/Gestor.Application/Converters/ExcluirVendedorLabelConverter.cs new file mode 100644 index 0000000..e665326 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ExcluirVendedorLabelConverter.cs @@ -0,0 +1,33 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ExcluirVendedorLabelConverter : MarkupExtension, IValueConverter
+ {
+ public ExcluirVendedorLabelConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (((DateTime?)value).HasValue)
+ {
+ return "EXCLUIR PAGAMENTO";
+ }
+ return "EXCLUIR VENDEDOR";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ExpanderHeaderConverter.cs b/Codemerx/Gestor.Application/Converters/ExpanderHeaderConverter.cs new file mode 100644 index 0000000..66c167b --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ExpanderHeaderConverter.cs @@ -0,0 +1,41 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ExpanderHeaderConverter : MarkupExtension, IValueConverter
+ {
+ public ExpanderHeaderConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return "";
+ }
+ if (!(value is bool))
+ {
+ return "";
+ }
+ if (!(bool)value)
+ {
+ return string.Format("MOSTRAR {0}", parameter);
+ }
+ return string.Format("OCULTAR {0}", parameter);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ExtensaoVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/ExtensaoVisibilityConverter.cs new file mode 100644 index 0000000..6114950 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ExtensaoVisibilityConverter.cs @@ -0,0 +1,57 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class ExtensaoVisibilityConverter : IMultiValueConverter
+ {
+ public ExtensaoVisibilityConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ object obj;
+ try
+ {
+ if (values[0] == null || values[1] == null)
+ {
+ obj = Visibility.Collapsed;
+ }
+ else if (values[0] == null || (long)values[0] <= (long)0)
+ {
+ obj = (values[1].ToString().ToLower() == ".pdf" ? Visibility.Visible : Visibility.Collapsed);
+ }
+ else
+ {
+ obj = Visibility.Collapsed;
+ }
+ }
+ catch (Exception exception)
+ {
+ obj = Visibility.Collapsed;
+ }
+ return obj;
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return Visibility.Collapsed;
+ }
+ if (value.ToString().ToLower() != ".pdf")
+ {
+ return Visibility.Collapsed;
+ }
+ return Visibility.Visible;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/FaturaVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/FaturaVisibilityConverter.cs new file mode 100644 index 0000000..7bf7182 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/FaturaVisibilityConverter.cs @@ -0,0 +1,31 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class FaturaVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public FaturaVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (value == null || (TipoRecebimento)value != 1 ? Visibility.Visible : Visibility.Collapsed);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/FilialStringConverter.cs b/Codemerx/Gestor.Application/Converters/FilialStringConverter.cs new file mode 100644 index 0000000..587602f --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/FilialStringConverter.cs @@ -0,0 +1,33 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class FilialStringConverter : MarkupExtension, IValueConverter
+ {
+ public FilialStringConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is long && (long)value == (long)1)
+ {
+ return "";
+ }
+ return string.Format("FILIAL {0}", value);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/IdVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/IdVisibilityConverter.cs new file mode 100644 index 0000000..5e30bb6 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/IdVisibilityConverter.cs @@ -0,0 +1,30 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class IdVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public IdVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (value == null || (long)value == 0 ? Visibility.Collapsed : Visibility.Visible);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/IncluirApoliceEnabledConverter.cs b/Codemerx/Gestor.Application/Converters/IncluirApoliceEnabledConverter.cs new file mode 100644 index 0000000..ca7628a --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/IncluirApoliceEnabledConverter.cs @@ -0,0 +1,37 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class IncluirApoliceEnabledConverter : IMultiValueConverter
+ {
+ public IncluirApoliceEnabledConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (values[0] == null || values[1] == null)
+ {
+ return false;
+ }
+ object obj = values[0];
+ if (obj is bool && !(bool)obj)
+ {
+ return false;
+ }
+ obj = values[1];
+ if (!(obj is bool))
+ {
+ return false;
+ }
+ return (bool)obj;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/IntToMedalConverter.cs b/Codemerx/Gestor.Application/Converters/IntToMedalConverter.cs new file mode 100644 index 0000000..f716c62 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/IntToMedalConverter.cs @@ -0,0 +1,55 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class IntToMedalConverter : MarkupExtension, IValueConverter
+ {
+ public IntToMedalConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null)
+ {
+ switch ((int)value)
+ {
+ case 1:
+ {
+ return new SolidColorBrush(Colors.SaddleBrown);
+ }
+ case 2:
+ {
+ return new SolidColorBrush(Colors.Silver);
+ }
+ case 3:
+ {
+ return new SolidColorBrush(Colors.Gold);
+ }
+ }
+ }
+ Color color = new Color()
+ {
+ A = 64,
+ R = 200,
+ G = 200,
+ B = 200
+ };
+ return new SolidColorBrush(color);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/IntToMedalTextConverter.cs b/Codemerx/Gestor.Application/Converters/IntToMedalTextConverter.cs new file mode 100644 index 0000000..71ef1a5 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/IntToMedalTextConverter.cs @@ -0,0 +1,47 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class IntToMedalTextConverter : MarkupExtension, IValueConverter
+ {
+ public IntToMedalTextConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null)
+ {
+ switch ((int)value)
+ {
+ case 1:
+ {
+ return "BRONZE";
+ }
+ case 2:
+ {
+ return "PRATA";
+ }
+ case 3:
+ {
+ return "OURO";
+ }
+ }
+ }
+ return "SEM QUALIFICAÇÃO";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/IntToVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/IntToVisibilityConverter.cs new file mode 100644 index 0000000..a09c136 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/IntToVisibilityConverter.cs @@ -0,0 +1,35 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class IntToVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public IntToVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ int num;
+ if (value != null && (!int.TryParse(value.ToString(), out num) || num != 0))
+ {
+ return Visibility.Visible;
+ }
+ return Visibility.Collapsed;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/InvertedBoolToGridHeightOneStarConverter.cs b/Codemerx/Gestor.Application/Converters/InvertedBoolToGridHeightOneStarConverter.cs new file mode 100644 index 0000000..66e7098 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/InvertedBoolToGridHeightOneStarConverter.cs @@ -0,0 +1,30 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class InvertedBoolToGridHeightOneStarConverter : MarkupExtension, IValueConverter
+ {
+ public InvertedBoolToGridHeightOneStarConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (value == null || (bool)value ? new GridLength(0) : new GridLength(1, GridUnitType.Star));
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/IsNamedObjectVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/IsNamedObjectVisibilityConverter.cs new file mode 100644 index 0000000..c5ef7b7 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/IsNamedObjectVisibilityConverter.cs @@ -0,0 +1,77 @@ +using Gestor.Model.Common;
+using Gestor.Model.Domain.Seguros;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class IsNamedObjectVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ private static int column;
+
+ private static TipoTela tela;
+
+ public IsNamedObjectVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ PermissaoUsuario permissaoUsuario = (PermissaoUsuario)value;
+ Visibility visibility = Visibility.Visible;
+ if (permissaoUsuario.get_Tela() != IsNamedObjectVisibilityConverter.tela)
+ {
+ IsNamedObjectVisibilityConverter.tela = permissaoUsuario.get_Tela();
+ IsNamedObjectVisibilityConverter.column = 1;
+ }
+ TipoTela tela = permissaoUsuario.get_Tela();
+ if (tela != 10)
+ {
+ if (tela - 12 > 1)
+ {
+ if (tela == 18)
+ {
+ if (IsNamedObjectVisibilityConverter.column == 3)
+ {
+ visibility = Visibility.Hidden;
+ }
+ IsNamedObjectVisibilityConverter.column++;
+ return visibility;
+ }
+ IsNamedObjectVisibilityConverter.column++;
+ return visibility;
+ }
+ else if (IsNamedObjectVisibilityConverter.column == 1 || IsNamedObjectVisibilityConverter.column == 3)
+ {
+ visibility = Visibility.Hidden;
+ IsNamedObjectVisibilityConverter.column++;
+ return visibility;
+ }
+ else
+ {
+ IsNamedObjectVisibilityConverter.column++;
+ return visibility;
+ }
+ }
+ if (IsNamedObjectVisibilityConverter.column == 3)
+ {
+ visibility = Visibility.Hidden;
+ }
+ IsNamedObjectVisibilityConverter.column++;
+ return visibility;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ManutencaoPagamentoGroupHeaderConverter.cs b/Codemerx/Gestor.Application/Converters/ManutencaoPagamentoGroupHeaderConverter.cs new file mode 100644 index 0000000..107633f --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ManutencaoPagamentoGroupHeaderConverter.cs @@ -0,0 +1,41 @@ +using Gestor.Model.Domain.Ferramentas;
+using System;
+using System.Globalization;
+using System.Reflection;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ManutencaoPagamentoGroupHeaderConverter : MarkupExtension, IValueConverter
+ {
+ public ManutencaoPagamentoGroupHeaderConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null || parameter == null)
+ {
+ return null;
+ }
+ if (!(parameter is string))
+ {
+ return null;
+ }
+ string str = parameter.ToString();
+ ManutencaoPagamentos manutencaoPagamento = (ManutencaoPagamentos)value;
+ return manutencaoPagamento.GetType().GetProperty(str).GetValue(manutencaoPagamento, null);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/MenosZeroVirgulaZeroUmConverter.cs b/Codemerx/Gestor.Application/Converters/MenosZeroVirgulaZeroUmConverter.cs new file mode 100644 index 0000000..f230613 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/MenosZeroVirgulaZeroUmConverter.cs @@ -0,0 +1,57 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class MenosZeroVirgulaZeroUmConverter : MarkupExtension, IValueConverter
+ {
+ public MenosZeroVirgulaZeroUmConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ decimal? nullable;
+ decimal? nullable1;
+ decimal? nullable2 = (decimal?)value;
+ decimal num = new decimal(1, 0, 0, false, 2);
+ 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 targetType, object parameter, CultureInfo culture)
+ {
+ decimal? nullable;
+ decimal? nullable1;
+ decimal? nullable2 = (decimal?)value;
+ decimal num = new decimal(1, 0, 0, false, 2);
+ if (nullable2.HasValue)
+ {
+ nullable1 = new decimal?(nullable2.GetValueOrDefault() + num);
+ }
+ else
+ {
+ nullable = null;
+ nullable1 = nullable;
+ }
+ nullable = nullable1;
+ return nullable.GetValueOrDefault();
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/MimeIconConverter.cs b/Codemerx/Gestor.Application/Converters/MimeIconConverter.cs new file mode 100644 index 0000000..a3f0efd --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/MimeIconConverter.cs @@ -0,0 +1,267 @@ +using ControlzEx;
+using MaterialDesignThemes.Wpf;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class MimeIconConverter : MarkupExtension, IValueConverter
+ {
+ public MimeIconConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ char chr;
+ PackIcon packIcon;
+ PackIcon packIcon1;
+ PackIcon packIcon2;
+ PackIcon packIcon3;
+ PackIcon packIcon4;
+ if (value == null)
+ {
+ PackIcon packIcon5 = new PackIcon();
+ packIcon5.set_Kind(1529);
+ return packIcon5;
+ }
+ string lower = value.ToString().ToLower();
+ if (lower != null)
+ {
+ int length = lower.Length;
+ if (length == 4)
+ {
+ chr = lower[2];
+ if (chr == 'a')
+ {
+ if (lower == ".rar")
+ {
+ packIcon1 = new PackIcon();
+ packIcon1.set_Kind(301);
+ return packIcon1;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ else
+ {
+ switch (chr)
+ {
+ case 'd':
+ {
+ if (lower == ".pdf")
+ {
+ PackIcon packIcon6 = new PackIcon();
+ packIcon6.set_Kind(1580);
+ return packIcon6;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'j':
+ case 'k':
+ {
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'i':
+ {
+ if (lower == ".zip")
+ {
+ break;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'l':
+ {
+ if (lower == ".xls")
+ {
+ packIcon2 = new PackIcon();
+ packIcon2.set_Kind(1563);
+ return packIcon2;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'm':
+ {
+ if (lower == ".bmp")
+ {
+ packIcon3 = new PackIcon();
+ packIcon3.set_Kind(2102);
+ return packIcon3;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'n':
+ {
+ if (lower == ".png")
+ {
+ packIcon3 = new PackIcon();
+ packIcon3.set_Kind(2102);
+ return packIcon3;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'o':
+ {
+ if (lower == ".doc")
+ {
+ packIcon4 = new PackIcon();
+ packIcon4.set_Kind(1605);
+ return packIcon4;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'p':
+ {
+ if (lower == ".jpg")
+ {
+ packIcon3 = new PackIcon();
+ packIcon3.set_Kind(2102);
+ return packIcon3;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ default:
+ {
+ if (chr == 'x')
+ {
+ if (lower == ".txt")
+ {
+ PackIcon packIcon7 = new PackIcon();
+ packIcon7.set_Kind(3399);
+ return packIcon7;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ else
+ {
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ }
+ }
+ }
+ packIcon1 = new PackIcon();
+ packIcon1.set_Kind(301);
+ return packIcon1;
+ }
+ else if (length == 5)
+ {
+ chr = lower[2];
+ switch (chr)
+ {
+ case 'l':
+ {
+ if (lower == ".xlsx")
+ {
+ packIcon2 = new PackIcon();
+ packIcon2.set_Kind(1563);
+ return packIcon2;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'm':
+ case 'n':
+ {
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'o':
+ {
+ if (lower == ".docx")
+ {
+ packIcon4 = new PackIcon();
+ packIcon4.set_Kind(1605);
+ return packIcon4;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ case 'p':
+ {
+ if (lower == ".jpge")
+ {
+ break;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ default:
+ {
+ if (chr == 's')
+ {
+ if (lower != ".json")
+ {
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ PackIcon packIcon8 = new PackIcon();
+ packIcon8.set_Kind(2156);
+ return packIcon8;
+ }
+ else
+ {
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ }
+ }
+ }
+ else
+ {
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+ packIcon3 = new PackIcon();
+ packIcon3.set_Kind(2102);
+ return packIcon3;
+ }
+ packIcon = new PackIcon();
+ packIcon.set_Kind(1529);
+ return packIcon;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ModeloExisteTooltipConverter.cs b/Codemerx/Gestor.Application/Converters/ModeloExisteTooltipConverter.cs new file mode 100644 index 0000000..01d12cb --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ModeloExisteTooltipConverter.cs @@ -0,0 +1,37 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ModeloExisteTooltipConverter : MarkupExtension, IValueConverter
+ {
+ public ModeloExisteTooltipConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return "NEM TODOS OS DOCUMENTOS SELECIONADOS\nPARA ENVIO POSSUEM AS VARIÁVEIS DESSE MODELO";
+ }
+ if (!(bool)value)
+ {
+ return "TODOS OS DOCUMENTOS SELECIONADOS PARA\nENVIO POSSUEM AS VARIÁVEIS DESSE MODELO";
+ }
+ return "NEM TODOS OS DOCUMENTOS SELECIONADOS\nPARA ENVIO POSSUEM AS VARIÁVEIS DESSE MODELO";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/MultiBoolReadOnly.cs b/Codemerx/Gestor.Application/Converters/MultiBoolReadOnly.cs new file mode 100644 index 0000000..3bd7f40 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/MultiBoolReadOnly.cs @@ -0,0 +1,35 @@ +using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class MultiBoolReadOnly : IMultiValueConverter
+ {
+ public MultiBoolReadOnly()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ object obj;
+ try
+ {
+ obj = !((IEnumerable<object>)values).All<object>((object value) => (bool)value);
+ }
+ catch
+ {
+ obj = false;
+ }
+ return obj;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/MultiBoolToVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/MultiBoolToVisibilityConverter.cs new file mode 100644 index 0000000..710de71 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/MultiBoolToVisibilityConverter.cs @@ -0,0 +1,36 @@ +using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class MultiBoolToVisibilityConverter : IMultiValueConverter
+ {
+ public MultiBoolToVisibilityConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ object obj;
+ try
+ {
+ obj = (((IEnumerable<object>)values).All<object>((object value) => (bool)value) ? Visibility.Visible : Visibility.Collapsed);
+ }
+ catch
+ {
+ obj = false;
+ }
+ return obj;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/MultiVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/MultiVisibilityConverter.cs new file mode 100644 index 0000000..1e5f09b --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/MultiVisibilityConverter.cs @@ -0,0 +1,36 @@ +using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class MultiVisibilityConverter : IMultiValueConverter
+ {
+ public MultiVisibilityConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ object obj;
+ try
+ {
+ obj = (((IEnumerable<object>)values).All<object>((object value) => (Visibility)value == Visibility.Visible) ? Visibility.Visible : Visibility.Collapsed);
+ }
+ catch
+ {
+ obj = false;
+ }
+ return obj;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/NullToFalseConverter.cs b/Codemerx/Gestor.Application/Converters/NullToFalseConverter.cs new file mode 100644 index 0000000..23186f6 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/NullToFalseConverter.cs @@ -0,0 +1,33 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class NullToFalseConverter : MarkupExtension, IValueConverter
+ {
+ public NullToFalseConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/NullToTrueConverter.cs b/Codemerx/Gestor.Application/Converters/NullToTrueConverter.cs new file mode 100644 index 0000000..c75c2d5 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/NullToTrueConverter.cs @@ -0,0 +1,37 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class NullToTrueConverter : MarkupExtension, IValueConverter
+ {
+ public NullToTrueConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return true;
+ }
+ return (bool)value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return true;
+ }
+ return (bool)value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/PackIconToImage.cs b/Codemerx/Gestor.Application/Converters/PackIconToImage.cs new file mode 100644 index 0000000..ffccc97 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/PackIconToImage.cs @@ -0,0 +1,41 @@ +using ControlzEx;
+using MaterialDesignThemes.Wpf;
+using System;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class PackIconToImage
+ {
+ public PackIconToImage()
+ {
+ }
+
+ public static ImageSource CreateImageSource(object value, Brush foregroundBrush, double penThickness)
+ {
+ PackIcon packIcon;
+ if (value.GetType() == typeof(PackIconKind))
+ {
+ packIcon = new PackIcon();
+ packIcon.set_Kind((PackIconKind)value);
+ }
+ else
+ {
+ packIcon = (PackIcon)value;
+ }
+ PackIcon packIcon1 = packIcon;
+ GeometryDrawing geometryDrawing = new GeometryDrawing()
+ {
+ Geometry = Geometry.Parse(packIcon1.get_Data()),
+ Brush = foregroundBrush,
+ Pen = new Pen(foregroundBrush, penThickness)
+ };
+ DrawingGroup drawingGroup = new DrawingGroup();
+ drawingGroup.Children.Add(geometryDrawing);
+ return new DrawingImage()
+ {
+ Drawing = drawingGroup
+ };
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/PackIconToImageConverter.cs b/Codemerx/Gestor.Application/Converters/PackIconToImageConverter.cs new file mode 100644 index 0000000..4ded51c --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/PackIconToImageConverter.cs @@ -0,0 +1,39 @@ +using System;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Windows.Data;
+using System.Windows.Markup;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class PackIconToImageConverter : MarkupExtension, IValueConverter
+ {
+ public System.Windows.Media.Brush Brush { get; set; } = Brushes.White;
+
+ public double Thickness { get; set; } = 0.25;
+
+ public PackIconToImageConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return null;
+ }
+ return PackIconToImage.CreateImageSource(value, this.Brush, this.Thickness);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/RamoToImageConverter.cs b/Codemerx/Gestor.Application/Converters/RamoToImageConverter.cs new file mode 100644 index 0000000..1fca8b2 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/RamoToImageConverter.cs @@ -0,0 +1,214 @@ +using MaterialDesignThemes.Wpf;
+using System;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class RamoToImageConverter : MarkupExtension, IValueConverter
+ {
+ public double Thickness { get; set; } = 0.25;
+
+ public RamoToImageConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return null;
+ }
+ long num = (long)value - (long)1;
+ if (num <= (long)61)
+ {
+ switch ((uint)num)
+ {
+ case 0:
+ case 2:
+ case 14:
+ case 17:
+ {
+ return (PackIconKind)2040;
+ }
+ case 1:
+ {
+ return (PackIconKind)1515;
+ }
+ case 4:
+ {
+ return (PackIconKind)794;
+ }
+ case 5:
+ case 8:
+ case 60:
+ {
+ return (PackIconKind)2010;
+ }
+ case 6:
+ case 9:
+ case 11:
+ case 52:
+ {
+ return (PackIconKind)33;
+ }
+ case 7:
+ case 15:
+ case 48:
+ {
+ return (PackIconKind)3514;
+ }
+ case 10:
+ case 31:
+ {
+ return (PackIconKind)25;
+ }
+ case 12:
+ case 22:
+ {
+ return (PackIconKind)77;
+ }
+ case 13:
+ {
+ return (PackIconKind)3;
+ }
+ case 16:
+ {
+ return (PackIconKind)3012;
+ }
+ case 18:
+ case 26:
+ case 28:
+ case 30:
+ case 40:
+ case 58:
+ {
+ return (PackIconKind)4;
+ }
+ case 19:
+ {
+ return (PackIconKind)3694;
+ }
+ case 20:
+ case 21:
+ case 41:
+ {
+ return (PackIconKind)859;
+ }
+ case 23:
+ {
+ return (PackIconKind)720;
+ }
+ case 24:
+ {
+ return (PackIconKind)844;
+ }
+ case 25:
+ {
+ return (PackIconKind)1528;
+ }
+ case 27:
+ case 55:
+ {
+ return (PackIconKind)3762;
+ }
+ case 29:
+ {
+ return (PackIconKind)2756;
+ }
+ case 32:
+ case 43:
+ case 53:
+ {
+ return (PackIconKind)3248;
+ }
+ case 33:
+ {
+ return (PackIconKind)2680;
+ }
+ case 34:
+ {
+ return (PackIconKind)1616;
+ }
+ case 35:
+ {
+ return (PackIconKind)41;
+ }
+ case 36:
+ {
+ return (PackIconKind)705;
+ }
+ case 37:
+ {
+ return (PackIconKind)920;
+ }
+ case 38:
+ {
+ return (PackIconKind)1462;
+ }
+ case 39:
+ {
+ return (PackIconKind)1013;
+ }
+ case 42:
+ {
+ return (PackIconKind)3372;
+ }
+ case 44:
+ {
+ return (PackIconKind)88;
+ }
+ case 45:
+ {
+ return (PackIconKind)3464;
+ }
+ case 46:
+ {
+ return (PackIconKind)3465;
+ }
+ case 47:
+ case 56:
+ {
+ return (PackIconKind)870;
+ }
+ case 50:
+ {
+ return (PackIconKind)3040;
+ }
+ case 51:
+ {
+ return (PackIconKind)2433;
+ }
+ case 54:
+ {
+ return (PackIconKind)2719;
+ }
+ case 57:
+ {
+ return (PackIconKind)1101;
+ }
+ case 61:
+ {
+ return (PackIconKind)450;
+ }
+ }
+ }
+ else
+ {
+ }
+ return (PackIconKind)196;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ResultadoToBoolConverter.cs b/Codemerx/Gestor.Application/Converters/ResultadoToBoolConverter.cs new file mode 100644 index 0000000..4f25d95 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ResultadoToBoolConverter.cs @@ -0,0 +1,35 @@ +using Gestor.Model.Domain.Common;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ResultadoToBoolConverter : MarkupExtension, IValueConverter
+ {
+ public ResultadoToBoolConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return false;
+ }
+ PesquisaAvancada pesquisaAvancada = (PesquisaAvancada)value;
+ return (pesquisaAvancada.get_IdCliente() != 0 || pesquisaAvancada.get_IdDocumento() != 0 || pesquisaAvancada.get_IdItem() != 0 || pesquisaAvancada.get_IdSinistro() != 0 || !string.IsNullOrWhiteSpace(pesquisaAvancada.get_Nome()) ? true : !string.IsNullOrWhiteSpace(pesquisaAvancada.get_Pesquisa()));
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/StatusComissaoAutomaticaTooltipConverter.cs b/Codemerx/Gestor.Application/Converters/StatusComissaoAutomaticaTooltipConverter.cs new file mode 100644 index 0000000..67b2207 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/StatusComissaoAutomaticaTooltipConverter.cs @@ -0,0 +1,115 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class StatusComissaoAutomaticaTooltipConverter : IValueConverter
+ {
+ public StatusComissaoAutomaticaTooltipConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (!(value is StatusParcela))
+ {
+ return null;
+ }
+ switch ((StatusParcela)value)
+ {
+ case 1:
+ {
+ return "";
+ }
+ case 2:
+ {
+ return "CLIENTE NÃO CADASTRADO NO SISTEMA OU DIVERGÊNCIA NO NÚMERO DA APÓLICE";
+ }
+ case 3:
+ {
+ return "O NÚMERO DA PARCELA NÃO FOI LOCALIZADO NO SISTEMA";
+ }
+ case 4:
+ {
+ return "OCORRE ANTES DE BAIXAR O EXTRATO, QUANDO O PERCENTUAL DE COMISSÃO CADASTRADO NA APÓLICE É DIFERENTE DO INFORMADO NO EXTRATO";
+ }
+ case 5:
+ {
+ return "A PARCELA JÁ FOI BAIXADA MANUALMENTE; O SISTEMA CONFERE A DATA DE RECEBIMENTO";
+ }
+ case 6:
+ {
+ return "O USUÁRIO OPTOU POR NÃO REALIZAR MANUTENÇÃO";
+ }
+ case 7:
+ {
+ return "É NECESSÁRIO FAZER MANUTENÇÃO NAS PARCELAS ANTERIORES";
+ }
+ case 8:
+ {
+ return "O SISTEMA DESCONSIDERA QUANDO NÃO EXISTE VALOR DE COMISSÃO NA PARCELA";
+ }
+ case 9:
+ {
+ return "NÃO HÁ MANUTENÇÃO PENDENTE, APENAS REALIZAR A BAIXA";
+ }
+ case 10:
+ {
+ return "OCORRE APÓS A BAIXA DO EXTRATO, MESMO HAVENDO DIFERENÇA NO PERCENTUAL DE COMISSÃO";
+ }
+ case 11:
+ {
+ return "APÓLICES COM NÚMEROS SIMILARES LOCALIZADAS NO SISTEMA";
+ }
+ case 12:
+ {
+ return "INDICA QUE O EXTRATO FOI BAIXADO MANUALMENTE NO SISTEMA";
+ }
+ case 13:
+ {
+ return "FOI NECESSÁRIO LOCALIZAR O CLIENTE OU DOCUMENTO POR MEIO DA CRÍTICA PARA REALIZAR A BAIXA DA PARCELA";
+ }
+ case 14:
+ {
+ return "";
+ }
+ case 15:
+ {
+ return "O NÚMERO DA FATURA NÃO FOI LOCALIZADO NO SISTEMA";
+ }
+ case 16:
+ {
+ return "O SISTEMA TENTARÁ REALIZAR A BAIXA POR APROXIMAÇÃO, ATRAVÉS DO N° DA APÓLICE";
+ }
+ case 17:
+ {
+ return "HÁ PARCELA NO EXTRATO SEM VÍNCULO; IRÁ SER CRIADA AUTOMATICAMENTE";
+ }
+ case 18:
+ {
+ return "";
+ }
+ case 19:
+ {
+ return "O CAMPO DE COMISSÃO ESTÁ EM BRANCO";
+ }
+ case 20:
+ {
+ return "A FATURA CRIADA POSSUI O CAMPO DE COMISSÃO EM BRANCO";
+ }
+ case 21:
+ {
+ return "INDICA QUE A PARCELA ESPECIAL CRIADA JÁ HAVIA SIDO BAIXADA ANTERIORMENTE";
+ }
+ }
+ return "";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return Binding.DoNothing;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/StatusIconConverter.cs b/Codemerx/Gestor.Application/Converters/StatusIconConverter.cs new file mode 100644 index 0000000..9717cea --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/StatusIconConverter.cs @@ -0,0 +1,80 @@ +using Gestor.Model.Common;
+using Gestor.Model.Validation;
+using MaterialDesignThemes.Wpf;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class StatusIconConverter : IMultiValueConverter
+ {
+ public StatusIconConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ PackIconKind packIconKind;
+ if (values[2] != null && values[2] is bool && (bool)values[2])
+ {
+ return (PackIconKind)1280;
+ }
+ object obj = values[0];
+ if (obj == null)
+ {
+ return (PackIconKind)1543;
+ }
+ if (!(obj is TipoSeguro))
+ {
+ return new SolidColorBrush(Colors.White);
+ }
+ switch ((TipoSeguro)values[0])
+ {
+ case 3:
+ {
+ return (PackIconKind)1058;
+ }
+ case 5:
+ {
+ return (PackIconKind)2901;
+ }
+ case 6:
+ {
+ return (PackIconKind)1554;
+ }
+ case 7:
+ {
+ return (PackIconKind)789;
+ }
+ default:
+ {
+ if (values[1] == null)
+ {
+ packIconKind = 1545;
+ return packIconKind;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ DateTime? nullable = (DateTime?)values[1];
+ DateTime dateTime = Funcoes.GetNetworkTime().Date.AddDays(-6);
+ if ((nullable.HasValue ? nullable.GetValueOrDefault() < dateTime : true))
+ {
+ packIconKind = 1044;
+ return packIconKind;
+ }
+ packIconKind = 1545;
+ return packIconKind;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/StatusPagamentoColorConverter.cs b/Codemerx/Gestor.Application/Converters/StatusPagamentoColorConverter.cs new file mode 100644 index 0000000..92ab9ba --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/StatusPagamentoColorConverter.cs @@ -0,0 +1,40 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class StatusPagamentoColorConverter : MarkupExtension, IValueConverter
+ {
+ public StatusPagamentoColorConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null || (StatusPagamento)value == null)
+ {
+ return new SolidColorBrush(Colors.Gray);
+ }
+ if ((StatusPagamento)value != 2)
+ {
+ return new SolidColorBrush(Colors.Red);
+ }
+ return new SolidColorBrush((Color)System.Windows.Application.Current.Resources["AggerBlue"]);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/StatusPagamentoVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/StatusPagamentoVisibilityConverter.cs new file mode 100644 index 0000000..7b17fdd --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/StatusPagamentoVisibilityConverter.cs @@ -0,0 +1,35 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class StatusPagamentoVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public StatusPagamentoVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return Visibility.Collapsed;
+ }
+ return ((StatusPagamento)value == null ? Visibility.Collapsed : Visibility.Visible);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/StringToFontWeightConverter.cs b/Codemerx/Gestor.Application/Converters/StringToFontWeightConverter.cs new file mode 100644 index 0000000..40ca721 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/StringToFontWeightConverter.cs @@ -0,0 +1,34 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class StringToFontWeightConverter : MarkupExtension, IValueConverter
+ {
+ public StringToFontWeightConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null && ((string)value).Contains("$"))
+ {
+ return FontWeights.Bold;
+ }
+ return FontWeights.SemiBold;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/StringToStringFontWeightCleanConverter.cs b/Codemerx/Gestor.Application/Converters/StringToStringFontWeightCleanConverter.cs new file mode 100644 index 0000000..c738ba9 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/StringToStringFontWeightCleanConverter.cs @@ -0,0 +1,33 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class StringToStringFontWeightCleanConverter : MarkupExtension, IValueConverter
+ {
+ public StringToStringFontWeightCleanConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null || !((string)value).Contains("$"))
+ {
+ return (string)value;
+ }
+ return ((string)value).Replace("$", "");
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/SubTipoEnableConverter.cs b/Codemerx/Gestor.Application/Converters/SubTipoEnableConverter.cs new file mode 100644 index 0000000..53d4698 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/SubTipoEnableConverter.cs @@ -0,0 +1,30 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class SubTipoEnableConverter : MarkupExtension, IValueConverter
+ {
+ public SubTipoEnableConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (value == null ? false : (SubTipo)value != 1);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TelaRelatorioConverter.cs b/Codemerx/Gestor.Application/Converters/TelaRelatorioConverter.cs new file mode 100644 index 0000000..0104b98 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TelaRelatorioConverter.cs @@ -0,0 +1,41 @@ +using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class TelaRelatorioConverter : IMultiValueConverter
+ {
+ public TelaRelatorioConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ object obj;
+ try
+ {
+ if (values != null)
+ {
+ obj = (values[0] == null ? ValidationHelper.GetDescription((Relatorio)values[1]) : ValidationHelper.GetDescription((TipoTela)values[0]));
+ }
+ else
+ {
+ obj = "";
+ }
+ }
+ catch
+ {
+ obj = "";
+ }
+ return obj;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TelefoneToVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/TelefoneToVisibilityConverter.cs new file mode 100644 index 0000000..5eeca33 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TelefoneToVisibilityConverter.cs @@ -0,0 +1,35 @@ +using System;
+using System.Globalization;
+using System.Text.RegularExpressions;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class TelefoneToVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public TelefoneToVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null || (string)value == "")
+ {
+ return Visibility.Visible;
+ }
+ return (Regex.Match((string)value, "^[0-9]{4} [0-9]{3} [0-9]{4}$").Success ? Visibility.Collapsed : Visibility.Visible);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TextInputToVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/TextInputToVisibilityConverter.cs new file mode 100644 index 0000000..820e24a --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TextInputToVisibilityConverter.cs @@ -0,0 +1,36 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class TextInputToVisibilityConverter : IMultiValueConverter
+ {
+ public TextInputToVisibilityConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (values[0] == null && values[1] is bool && (bool)values[1])
+ {
+ return Visibility.Collapsed;
+ }
+ if (values[0] is string && values[1] is bool)
+ {
+ bool flag = !string.IsNullOrEmpty((string)values[0]);
+ if ((bool)values[1] | flag)
+ {
+ return Visibility.Collapsed;
+ }
+ }
+ return Visibility.Visible;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TipoDependenteToVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/TipoDependenteToVisibilityConverter.cs new file mode 100644 index 0000000..3039f18 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TipoDependenteToVisibilityConverter.cs @@ -0,0 +1,35 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class TipoDependenteToVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public TipoDependenteToVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return Visibility.Collapsed;
+ }
+ return ((TipoTitular)value == 2 ? Visibility.Visible : Visibility.Collapsed);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TipoEmailVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/TipoEmailVisibilityConverter.cs new file mode 100644 index 0000000..b382d5e --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TipoEmailVisibilityConverter.cs @@ -0,0 +1,31 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class TipoEmailVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public TipoEmailVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (value == null || (TipoEmail)value == null ? Visibility.Visible : Visibility.Collapsed);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TipoRepasseGlobalFilterConverter.cs b/Codemerx/Gestor.Application/Converters/TipoRepasseGlobalFilterConverter.cs new file mode 100644 index 0000000..37e73c5 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TipoRepasseGlobalFilterConverter.cs @@ -0,0 +1,41 @@ +using Gestor.Application.Helpers;
+using Gestor.Model.Attributes;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Configuracoes;
+using System;
+using System.Globalization;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class TipoRepasseGlobalFilterConverter : IValueConverter
+ {
+ public TipoRepasseGlobalFilterConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ bool flag = Recursos.Configuracoes.Any<ConfiguracaoSistema>((ConfiguracaoSistema x) => x.get_Configuracao() == 56);
+ return Enum.GetValues(typeof(TipoRepasse)).Cast<TipoRepasse>().Where<TipoRepasse>((TipoRepasse tipo) => {
+ object obj;
+ FieldInfo field = typeof(TipoRepasse).GetField(tipo.ToString());
+ obj = (field != null ? field.GetCustomAttributes(typeof(TipoAttribute), false).FirstOrDefault<object>() : null);
+ TipoAttribute tipoAttribute = obj as TipoAttribute;
+ if ((tipoAttribute != null ? tipoAttribute.get_Tipo() : null) == "0")
+ {
+ return true;
+ }
+ return ((tipoAttribute != null ? tipoAttribute.get_Tipo() : null) == "1") & flag;
+ }).ToList<TipoRepasse>();
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TipoRepasseVendedorVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/TipoRepasseVendedorVisibilityConverter.cs new file mode 100644 index 0000000..fc9fc1c --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TipoRepasseVendedorVisibilityConverter.cs @@ -0,0 +1,152 @@ +using Gestor.Application.Helpers;
+using Gestor.Model.Domain.Configuracoes;
+using System;
+using System.Globalization;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class TipoRepasseVendedorVisibilityConverter : IMultiValueConverter
+ {
+ public TipoRepasseVendedorVisibilityConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ char chr;
+ object obj;
+ Visibility visibility;
+ if (parameter == null || values == null)
+ {
+ return Visibility.Collapsed;
+ }
+ string lower = parameter.ToString().ToLower();
+ if (values.Count<object>() != 0)
+ {
+ obj = values[0];
+ }
+ else
+ {
+ obj = false;
+ }
+ object obj1 = obj;
+ if (lower != null)
+ {
+ int length = lower.Length;
+ switch (length)
+ {
+ case 15:
+ {
+ chr = lower[0];
+ switch (chr)
+ {
+ case 'r':
+ {
+ if (lower == "repassevendedor")
+ {
+ visibility = (!(obj1 is bool) || !(bool)obj1 ? Visibility.Visible : Visibility.Collapsed);
+ return visibility;
+ }
+ return Visibility.Visible;
+ }
+ case 's':
+ case 'u':
+ {
+ return Visibility.Visible;
+ }
+ case 't':
+ {
+ if (lower == "tipovendedorbox")
+ {
+ visibility = (!(obj1 is bool) || !(bool)obj1 ? Visibility.Visible : Visibility.Collapsed);
+ return visibility;
+ }
+ return Visibility.Visible;
+ }
+ case 'v':
+ {
+ if (lower == "valorrepassebox")
+ {
+ visibility = (!(obj1 is bool) || !(bool)obj1 ? Visibility.Visible : Visibility.Collapsed);
+ return visibility;
+ }
+ return Visibility.Visible;
+ }
+ default:
+ {
+ return Visibility.Visible;
+ }
+ }
+ break;
+ }
+ case 16:
+ {
+ if (lower == "formarecebidabox")
+ {
+ break;
+ }
+ else
+ {
+ return Visibility.Visible;
+ }
+ }
+ case 17:
+ {
+ return Visibility.Visible;
+ }
+ case 18:
+ {
+ chr = lower[0];
+ if (chr == 'c')
+ {
+ if (lower == "cocorretagemtoogle")
+ {
+ return (Recursos.Configuracoes.Any<ConfiguracaoSistema>((ConfiguracaoSistema config) => config.get_Configuracao() == 56) ? Visibility.Visible : Visibility.Collapsed);
+ }
+ return Visibility.Visible;
+ }
+ else if (chr == 'f')
+ {
+ if (lower == "formaincidenciabox")
+ {
+ break;
+ }
+ return Visibility.Visible;
+ }
+ else
+ {
+ return Visibility.Visible;
+ }
+ }
+ default:
+ {
+ if (length == 25)
+ {
+ if (lower == "comissaorenovacaocombobox")
+ {
+ break;
+ }
+ return Visibility.Visible;
+ }
+ else
+ {
+ return Visibility.Visible;
+ }
+ }
+ }
+ visibility = (!(obj1 is bool) || !(bool)obj1 ? Visibility.Visible : Visibility.Collapsed);
+ return visibility;
+ }
+ return Visibility.Visible;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TipoRepasseVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/TipoRepasseVisibilityConverter.cs new file mode 100644 index 0000000..4df37ee --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TipoRepasseVisibilityConverter.cs @@ -0,0 +1,56 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class TipoRepasseVisibilityConverter : IMultiValueConverter
+ {
+ public TipoRepasseVisibilityConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (parameter == null || values == null)
+ {
+ return Visibility.Collapsed;
+ }
+ TipoRepasse tipoRepasse = (TipoRepasse)values[0];
+ FormaRepasse formaRepasse = (FormaRepasse)values[1];
+ string lower = parameter.ToString().ToLower();
+ if (lower == "incidenciabox")
+ {
+ return (tipoRepasse == 2 ? Visibility.Visible : Visibility.Collapsed);
+ }
+ if (lower == "basepagtobox")
+ {
+ return ((tipoRepasse != 1 || formaRepasse == 1) && formaRepasse != 2 && formaRepasse != 3 || tipoRepasse == 3 ? Visibility.Collapsed : Visibility.Visible);
+ }
+ if (lower == "formapagtobox")
+ {
+ return (tipoRepasse == 3 ? Visibility.Collapsed : Visibility.Visible);
+ }
+ if (lower == "valorbox")
+ {
+ return (tipoRepasse == 3 ? Visibility.Collapsed : Visibility.Visible);
+ }
+ if (lower == "renovacoesbox")
+ {
+ return (tipoRepasse == 3 ? Visibility.Collapsed : Visibility.Visible);
+ }
+ if (lower != "cocorretagembox")
+ {
+ return Visibility.Visible;
+ }
+ return (tipoRepasse == 3 ? Visibility.Visible : Visibility.Collapsed);
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TipoSinistroConverter.cs b/Codemerx/Gestor.Application/Converters/TipoSinistroConverter.cs new file mode 100644 index 0000000..c965cdc --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TipoSinistroConverter.cs @@ -0,0 +1,30 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class TipoSinistroConverter : MarkupExtension, IValueConverter
+ {
+ public TipoSinistroConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (value == null ? true : (TipoSinistro)value != 0);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TipoTelefoneVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/TipoTelefoneVisibilityConverter.cs new file mode 100644 index 0000000..795bec4 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TipoTelefoneVisibilityConverter.cs @@ -0,0 +1,35 @@ +using Gestor.Model.Common;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class TipoTelefoneVisibilityConverter : MarkupExtension, IValueConverter
+ {
+ public TipoTelefoneVisibilityConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null && ((TipoTelefone)value == 9 || (TipoTelefone)value == 3 || (TipoTelefone)value == 2 || (TipoTelefone)value == 5 || (TipoTelefone)value == 1))
+ {
+ return Visibility.Visible;
+ }
+ return Visibility.Collapsed;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TootipStatusConverter.cs b/Codemerx/Gestor.Application/Converters/TootipStatusConverter.cs new file mode 100644 index 0000000..63a9bba --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TootipStatusConverter.cs @@ -0,0 +1,75 @@ +using Gestor.Model.Common;
+using Gestor.Model.Validation;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class TootipStatusConverter : IMultiValueConverter
+ {
+ public TootipStatusConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (values[2] != null && values[2] is bool && (bool)values[2])
+ {
+ return "DOCUMENTO EXCLUÍDO";
+ }
+ object obj = values[0];
+ if (obj == null)
+ {
+ return "";
+ }
+ if (!(obj is TipoSeguro))
+ {
+ return new SolidColorBrush(Colors.White);
+ }
+ switch ((TipoSeguro)values[0])
+ {
+ case 3:
+ {
+ return "DOCUMENTO CANCELADO";
+ }
+ case 5:
+ {
+ return "DOCUMENTO RENOVADO";
+ }
+ case 6:
+ {
+ return "DOCUMENTO PERDIDO";
+ }
+ case 7:
+ {
+ return "DOCUMENTO RECUSADO";
+ }
+ default:
+ {
+ if (values[1] == null)
+ {
+ return "DOCUMENTO VIGENTE";
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ DateTime? nullable = (DateTime?)values[1];
+ DateTime dateTime = Funcoes.GetNetworkTime().Date.AddDays(-6);
+ if ((nullable.HasValue ? nullable.GetValueOrDefault() < dateTime : true))
+ {
+ return "DOCUMENTO VENCIDO";
+ }
+ return "DOCUMENTO VIGENTE";
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/TypeVisibilityConverter.cs b/Codemerx/Gestor.Application/Converters/TypeVisibilityConverter.cs new file mode 100644 index 0000000..5ba5b06 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/TypeVisibilityConverter.cs @@ -0,0 +1,33 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class TypeVisibilityConverter : IMultiValueConverter
+ {
+ public TypeVisibilityConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ object obj;
+ try
+ {
+ obj = (values[0] == null || values[1] == null ? Visibility.Collapsed : ((Type)values[0] == (Type)values[1] ? Visibility.Visible : Visibility.Collapsed));
+ }
+ catch (Exception exception)
+ {
+ obj = Visibility.Collapsed;
+ }
+ return obj;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/ValorTipoConverter.cs b/Codemerx/Gestor.Application/Converters/ValorTipoConverter.cs new file mode 100644 index 0000000..3566d8f --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ValorTipoConverter.cs @@ -0,0 +1,47 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class ValorTipoConverter : MarkupExtension, IMultiValueConverter
+ {
+ public ValorTipoConverter()
+ {
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+
+ object System.Windows.Data.IMultiValueConverter.Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (values == null || values[1] == null || values[0] == DependencyProperty.UnsetValue)
+ {
+ return null;
+ }
+ if (values[0] == null)
+ {
+ return values[1].ToString();
+ }
+ string str = values[0].ToString();
+ if (str == "VALOR")
+ {
+ return ((decimal)values[1]).ToString("c2");
+ }
+ if (str != "PERCENTUAL")
+ {
+ return values[1].ToString();
+ }
+ return ((decimal)values[1]).ToString("p2");
+ }
+
+ object[] System.Windows.Data.IMultiValueConverter.ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/VariavelExisteColorConverter.cs b/Codemerx/Gestor.Application/Converters/VariavelExisteColorConverter.cs new file mode 100644 index 0000000..8f7510c --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/VariavelExisteColorConverter.cs @@ -0,0 +1,38 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+using System.Windows.Media;
+
+namespace Gestor.Application.Converters
+{
+ public class VariavelExisteColorConverter : MarkupExtension, IValueConverter
+ {
+ public VariavelExisteColorConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return new SolidColorBrush(Colors.Red);
+ }
+ if (!(bool)value)
+ {
+ return new SolidColorBrush(Colors.Black);
+ }
+ return new SolidColorBrush(Colors.Red);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/VariavelExisteTooltipConverter.cs b/Codemerx/Gestor.Application/Converters/VariavelExisteTooltipConverter.cs new file mode 100644 index 0000000..e0328f2 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/VariavelExisteTooltipConverter.cs @@ -0,0 +1,37 @@ +using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters
+{
+ public class VariavelExisteTooltipConverter : MarkupExtension, IValueConverter
+ {
+ public VariavelExisteTooltipConverter()
+ {
+ }
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return "CAMPO FALTANDO EM, PELO MENOS, UM\nDOS DOCUMENTOS SELECIONADOS PARA ENVIO";
+ }
+ if (!(bool)value)
+ {
+ return "CAMPO PRESENTE EM TODOS\nOS DOCUMENTOS SELECIONADOS PARA ENVIO";
+ }
+ return "CAMPO FALTANDO EM, PELO MENOS, UM\nDOS DOCUMENTOS SELECIONADOS PARA ENVIO";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+ }
+}
\ No newline at end of file diff --git a/Codemerx/Gestor.Application/Converters/VerApoliceComissaoConverter.cs b/Codemerx/Gestor.Application/Converters/VerApoliceComissaoConverter.cs new file mode 100644 index 0000000..4048ab5 --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/VerApoliceComissaoConverter.cs @@ -0,0 +1,52 @@ +using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Gestor.Application.Converters
+{
+ public class VerApoliceComissaoConverter : IMultiValueConverter
+ {
+ public VerApoliceComissaoConverter()
+ {
+ }
+
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ object obj;
+ try
+ {
+ if (values[0] != null || values[1] != null)
+ {
+ long? nullable = (long?)values[0];
+ long num = (long)0;
+ if (nullable.GetValueOrDefault() == num & nullable.HasValue)
+ {
+ nullable = (long?)values[1];
+ num = (long)0;
+ if (nullable.GetValueOrDefault() == num & nullable.HasValue)
+ {
+ obj = Visibility.Collapsed;
+ return obj;
+ }
+ }
+ obj = Visibility.Visible;
+ }
+ else
+ {
+ obj = Visibility.Collapsed;
+ }
+ }
+ catch (Exception exception)
+ {
+ obj = Visibility.Collapsed;
+ }
+ return obj;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file |