From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:38:18 -0300 Subject: chore: location --- .../ApolicePendenteConverter.cs | 33 - .../ArquivoDigitalToolTipConverter.cs | 38 - .../AtivoConverterColor.cs | 35 - .../AtivoVisibilityConverter.cs | 38 - .../Gestor.Common.Converters/BoolToEyeConverter.cs | 37 - .../BoolToYesNoConverter.cs | 33 - .../ComissaoColorConverter.cs | 39 - .../Gestor.Common.Converters/ComissaoConverter.cs | 43 - .../ComissaoConverterMulti.cs | 74 -- .../ComparativoColorConverter.cs | 71 -- .../ComparativoConverter.cs | 55 -- .../ComparativoPercentualToolTipConverter.cs | 33 - .../ComparativoToolTipConverter.cs | 24 - .../EnumDescriptionConverter.cs | 34 - .../ExpanderHeaderConverter.cs | 33 - .../IdToVisibilityConverter.cs | 30 - .../InativoVisibilityConverter.cs | 38 - .../InvertedBooleanConverter.cs | 29 - .../InvertedBooleanToVisibilityConverter.cs | 30 - .../InvertedVisibilityConverter.cs | 30 - .../IsInsertedBoolConverter.cs | 29 - .../IsNotNullBoolConverter.cs | 29 - .../Gestor.Common.Converters/MesConverter.cs | 39 - .../MultiBoolAndConverter.cs | 35 - .../NegativoColorConverter.cs | 38 - .../NullVisibilityConverter.cs | 30 - .../NullVisibilityInvertedConverter.cs | 30 - .../ObjectToStringConverter.cs | 56 -- .../ObjectVisibilityConverter.cs | 31 - ...agamentoVendedorCorretoraVisibilityConverter.cs | 28 - .../ParcelaVisibilityConverter.cs | 31 - .../Gestor.Common.Converters/PendenciaConverter.cs | 35 - .../PendenciaVisibilityConverter.cs | 35 - .../RamoAutoVisibilityConverter.cs | 50 -- .../RecebidoColorConverter.cs | 32 - .../SaldoWeightConverter.cs | 30 - .../SinalColorConverter.cs | 35 - .../StatusExtratoColorConverter.cs | 65 -- .../StatusParcelaVisibilityConverter.cs | 42 - .../StatusTarefaVisibilityConverter.cs | 43 - .../StringNullOrEmptyToVisibilityConverter.cs | 30 - .../TarefaBackgroundColorConverter.cs | 54 -- .../TemTarefaVisibilityConverter.cs | 32 - .../TipoCriticaConverter.cs | 40 - .../TipoSinistroConverter.cs | 43 - .../TipoTelefoneVisibilityConverter.cs | 39 - .../TotalizacaoExpanderConverter.cs | 33 - .../Gestor.Common.Converters/ValorTipoConverter.cs | 47 - .../ZeroToEmptyConverter.cs | 41 - .../ZeroToVisibilityConverter.cs | 30 - .../ZeroToVisibilityInvertedConverter.cs | 30 - .../ZeroToVisibilityValorConverter.cs | 31 - .../Gestor.Common.Exceptions/AbortException.cs | 11 - .../Gestor.Common.Exceptions/BaseException.cs | 15 - .../Gestor.Common.Exceptions/ForbiddenException.cs | 15 - .../Gestor.Common.Exceptions/MailingException.cs | 15 - .../PermissionException.cs | 15 - .../UnauthorizedException.cs | 15 - .../ValidationException.cs | 15 - .../Gestor.Common.Helpers/DataBaseParameters.cs | 14 - .../Gestor.Common.Helpers/DefaultAttribute.cs | 19 - .../Gestor.Common.Helpers/EncryptionHelper.cs | 106 --- .../EnumBindingSourceExtension.cs | 59 -- Gestor.Common/Gestor.Common.Helpers/EnumHelper.cs | 166 ---- .../Gestor.Common.Helpers/FindVisualChild.cs | 32 - .../Gestor.Common.Helpers/FindVisualChildren.cs | 38 - Gestor.Common/Gestor.Common.Helpers/Functions.cs | 110 --- .../Gestor.Common.Helpers/HiddenAttribute.cs | 12 - Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs | 25 - .../Gestor.Common.Helpers/OrderAttribute.cs | 20 - .../ScrollAnimationBehavior.cs | 124 --- Gestor.Common/Gestor.Common.Security/Token.cs | 148 --- .../Gestor.Common.Validation/SemValicao.cs | 18 - .../Gestor.Common.Validation/ValidacaoAno.cs | 27 - .../ValidacaoAnoObrigatorio.cs | 31 - .../ValidacaoCeiObrigatorio.cs | 31 - .../Gestor.Common.Validation/ValidacaoCep.cs | 27 - .../ValidacaoCepObrigatorio.cs | 31 - .../Gestor.Common.Validation/ValidacaoChassi.cs | 27 - .../ValidacaoChassiObrigatorio.cs | 31 - .../Gestor.Common.Validation/ValidacaoData.cs | 27 - .../ValidacaoDataFutura.cs | 27 - .../Gestor.Common.Validation/ValidacaoDataMaior.cs | 38 - .../ValidacaoDataObrigatoria.cs | 31 - .../ValidacaoDataPassada.cs | 27 - .../ValidacaoDataPassadaObrigatoria.cs | 31 - .../Gestor.Common.Validation/ValidacaoDocumento.cs | 27 - .../ValidacaoDocumentoObrigatorio.cs | 31 - .../Gestor.Common.Validation/ValidacaoDouble.cs | 27 - .../Gestor.Common.Validation/ValidacaoEmail.cs | 27 - .../ValidacaoEmailObrigatorio.cs | 31 - .../Gestor.Common.Validation/ValidacaoEstado.cs | 27 - .../ValidacaoEstadoObrigatorio.cs | 31 - .../ValidacaoFipeObrigatorio.cs | 31 - .../Gestor.Common.Validation/ValidacaoInt.cs | 27 - .../ValidacaoIntObrigatorio.cs | 31 - .../Gestor.Common.Validation/ValidacaoLong.cs | 27 - .../ValidacaoLongObrigatorio.cs | 31 - .../ValidacaoObrigatorio.cs | 27 - .../Gestor.Common.Validation/ValidacaoOrgao.cs | 27 - .../Gestor.Common.Validation/ValidacaoPlaca.cs | 27 - .../ValidacaoPlacaObrigatorio.cs | 31 - .../Gestor.Common.Validation/ValidacaoPrefixo.cs | 27 - .../ValidacaoPrefixoObrigatorio.cs | 31 - .../ValidacaoRneObrigatorio.cs | 31 - .../Gestor.Common.Validation/ValidacaoTelefone.cs | 27 - .../ValidacaoTelefoneObrigatorio.cs | 31 - .../ValidacaoValorDiferenteZero.cs | 31 - .../ValidacaoValorMaiorQueZero.cs | 31 - .../Gestor.Common.Validation/ValidationHelper.cs | 992 --------------------- Gestor.Common/Gestor.Common.csproj | 490 ---------- Gestor.Common/Gestor.Common.sln | 21 - .../Gestor.CommonReferences/Gestor.Model.dll | Bin 833808 -> 0 bytes Gestor.Common/Properties/AssemblyInfo.cs | 20 - 114 files changed, 5540 deletions(-) delete mode 100644 Gestor.Common/Gestor.Common.Converters/ApolicePendenteConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ArquivoDigitalToolTipConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/AtivoConverterColor.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/AtivoVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/BoolToEyeConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/BoolToYesNoConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ComissaoColorConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ComissaoConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ComparativoColorConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ComparativoConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ComparativoPercentualToolTipConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ComparativoToolTipConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/EnumDescriptionConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ExpanderHeaderConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/IdToVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/InativoVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/InvertedBooleanConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/InvertedBooleanToVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/InvertedVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/IsInsertedBoolConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/IsNotNullBoolConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/MesConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/MultiBoolAndConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/NegativoColorConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/NullVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/NullVisibilityInvertedConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ObjectToStringConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ObjectVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/PagamentoVendedorCorretoraVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ParcelaVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/PendenciaConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/PendenciaVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/RamoAutoVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/RecebidoColorConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/SaldoWeightConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/SinalColorConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/StatusParcelaVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/StatusTarefaVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/StringNullOrEmptyToVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/TarefaBackgroundColorConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/TemTarefaVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/TipoSinistroConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/TipoTelefoneVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/TotalizacaoExpanderConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ValorTipoConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ZeroToEmptyConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityInvertedConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityValorConverter.cs delete mode 100644 Gestor.Common/Gestor.Common.Exceptions/AbortException.cs delete mode 100644 Gestor.Common/Gestor.Common.Exceptions/BaseException.cs delete mode 100644 Gestor.Common/Gestor.Common.Exceptions/ForbiddenException.cs delete mode 100644 Gestor.Common/Gestor.Common.Exceptions/MailingException.cs delete mode 100644 Gestor.Common/Gestor.Common.Exceptions/PermissionException.cs delete mode 100644 Gestor.Common/Gestor.Common.Exceptions/UnauthorizedException.cs delete mode 100644 Gestor.Common/Gestor.Common.Exceptions/ValidationException.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/DataBaseParameters.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/DefaultAttribute.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/EncryptionHelper.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/EnumBindingSourceExtension.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/EnumHelper.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/FindVisualChild.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/FindVisualChildren.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/Functions.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/HiddenAttribute.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/OrderAttribute.cs delete mode 100644 Gestor.Common/Gestor.Common.Helpers/ScrollAnimationBehavior.cs delete mode 100644 Gestor.Common/Gestor.Common.Security/Token.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/SemValicao.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoAno.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoAnoObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoCeiObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoCep.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoCepObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoChassi.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoChassiObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoData.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoDataFutura.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoDataMaior.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoDataObrigatoria.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoDataPassada.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoDataPassadaObrigatoria.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoDocumento.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoDocumentoObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoDouble.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoEmail.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoEmailObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoEstado.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoEstadoObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoFipeObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoInt.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoIntObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoLongObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoOrgao.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoPlaca.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoPlacaObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoPrefixo.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoPrefixoObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoRneObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoTelefone.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoTelefoneObrigatorio.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoValorDiferenteZero.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs delete mode 100644 Gestor.Common/Gestor.Common.Validation/ValidationHelper.cs delete mode 100644 Gestor.Common/Gestor.Common.csproj delete mode 100644 Gestor.Common/Gestor.Common.sln delete mode 100644 Gestor.Common/Gestor.CommonReferences/Gestor.Model.dll delete mode 100644 Gestor.Common/Properties/AssemblyInfo.cs (limited to 'Gestor.Common') diff --git a/Gestor.Common/Gestor.Common.Converters/ApolicePendenteConverter.cs b/Gestor.Common/Gestor.Common.Converters/ApolicePendenteConverter.cs deleted file mode 100644 index ae3003e..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ApolicePendenteConverter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ApolicePendenteConverter : MarkupExtension, IValueConverter - { - public ApolicePendenteConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value != null && !string.IsNullOrEmpty((string)value)) - { - return value; - } - return "PENDENTE DE EMISSÃO"; - } - - 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/Gestor.Common/Gestor.Common.Converters/ArquivoDigitalToolTipConverter.cs b/Gestor.Common/Gestor.Common.Converters/ArquivoDigitalToolTipConverter.cs deleted file mode 100644 index 3c9e6dc..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ArquivoDigitalToolTipConverter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Gestor.Model.Domain.Common; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ArquivoDigitalToolTipConverter : MarkupExtension, IValueConverter - { - public ArquivoDigitalToolTipConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null || ((List)value).Count == 0) - { - return ""; - } - return string.Join(Environment.NewLine, - from v in (List)value - select v.Descricao); - } - - 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/Gestor.Common/Gestor.Common.Converters/AtivoConverterColor.cs b/Gestor.Common/Gestor.Common.Converters/AtivoConverterColor.cs deleted file mode 100644 index cc99edf..0000000 --- a/Gestor.Common/Gestor.Common.Converters/AtivoConverterColor.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; -using System.Windows.Media; - -namespace Gestor.Common.Converters -{ - public class AtivoConverterColor : MarkupExtension, IValueConverter - { - public AtivoConverterColor() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null || !(bool)value) - { - return new SolidColorBrush(Colors.Red); - } - return new SolidColorBrush((Color)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/Gestor.Common/Gestor.Common.Converters/AtivoVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/AtivoVisibilityConverter.cs deleted file mode 100644 index d8ffe3f..0000000 --- a/Gestor.Common/Gestor.Common.Converters/AtivoVisibilityConverter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class AtivoVisibilityConverter : IMultiValueConverter - { - public AtivoVisibilityConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - object obj = values[0]; - if (obj is bool && (bool)obj) - { - return Visibility.Collapsed; - } - if (values[1] == null) - { - return Visibility.Visible; - } - obj = values[1]; - if (obj is long && (long)obj > (long)0) - { - 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/Gestor.Common/Gestor.Common.Converters/BoolToEyeConverter.cs b/Gestor.Common/Gestor.Common.Converters/BoolToEyeConverter.cs deleted file mode 100644 index 062b96b..0000000 --- a/Gestor.Common/Gestor.Common.Converters/BoolToEyeConverter.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class BoolToEyeConverter : MarkupExtension, IValueConverter - { - public BoolToEyeConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - { - return "Eye"; - } - if (!(bool)value) - { - return "Eye"; - } - return "EyeOff"; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || string.IsNullOrEmpty(value.ToString()) ? 0 : int.Parse(value.ToString())); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/BoolToYesNoConverter.cs b/Gestor.Common/Gestor.Common.Converters/BoolToYesNoConverter.cs deleted file mode 100644 index 529a9e7..0000000 --- a/Gestor.Common/Gestor.Common.Converters/BoolToYesNoConverter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class BoolToYesNoConverter : MarkupExtension, IValueConverter - { - public BoolToYesNoConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value != null && (bool)value) - { - return "SIM"; - } - return "NÃO"; - } - - 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/Gestor.Common/Gestor.Common.Converters/ComissaoColorConverter.cs b/Gestor.Common/Gestor.Common.Converters/ComissaoColorConverter.cs deleted file mode 100644 index 88df822..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ComissaoColorConverter.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; -using System.Windows.Media; - -namespace Gestor.Common.Converters -{ - public class ComissaoColorConverter : MarkupExtension, IValueConverter - { - public ComissaoColorConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - { - return new SolidColorBrush(Colors.Red); - } - if ((int)Math.Round(double.Parse(value.ToString())) >= 0 && (int)Math.Round(double.Parse(value.ToString())) != 0) - { - return new SolidColorBrush(Colors.Red); - } - return new SolidColorBrush((Color)Application.Current.Resources["AggerBlue"]); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || string.IsNullOrEmpty(value.ToString()) ? 0 : int.Parse(value.ToString())); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/ComissaoConverter.cs b/Gestor.Common/Gestor.Common.Converters/ComissaoConverter.cs deleted file mode 100644 index d66a902..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ComissaoConverter.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ComissaoConverter : MarkupExtension, IValueConverter - { - public ComissaoConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - decimal? nullable; - decimal? nullable1; - decimal? nullable2 = (decimal?)value; - decimal num = 100; - if (nullable2.HasValue) - { - nullable1 = new decimal?(nullable2.GetValueOrDefault() / num); - } - else - { - nullable = null; - nullable1 = nullable; - } - nullable = nullable1; - return nullable.GetValueOrDefault(); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return null; - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs b/Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs deleted file mode 100644 index 5797387..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ComissaoConverterMulti.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Gestor.Model.Common; -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class ComissaoConverterMulti : IMultiValueConverter - { - public ComissaoConverterMulti() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - decimal? nullable; - decimal? nullable1; - if (values[0] == DependencyProperty.UnsetValue && values[1] == DependencyProperty.UnsetValue) - { - return null; - } - if (values[1] == DependencyProperty.UnsetValue) - { - return values[0]; - } - object obj = values[0]; - TipoRepasse tipoRepasse = (TipoRepasse)values[1]; - string lower = parameter.ToString().ToLower(); - if (lower == "tipovendedorcolumn") - { - if (tipoRepasse == TipoRepasse.CoCorretagem) - { - return "CO-CORRETAGEM"; - } - return obj; - } - if (lower == "formapagamentocolumn" || lower == "incidenciacolumn") - { - if (tipoRepasse == TipoRepasse.CoCorretagem) - { - return "--"; - } - return obj; - } - if (lower == "pagamentosvalorrepassecolumn" || lower == "repassevendedor") - { - return obj; - } - if (tipoRepasse == TipoRepasse.ValorFixo) - { - return "--"; - } - decimal? nullable2 = (decimal?)obj; - decimal num = 100; - if (nullable2.HasValue) - { - nullable1 = new decimal?(nullable2.GetValueOrDefault() / num); - } - else - { - nullable = null; - nullable1 = nullable; - } - nullable = nullable1; - return nullable.GetValueOrDefault(); - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - return null; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/ComparativoColorConverter.cs b/Gestor.Common/Gestor.Common.Converters/ComparativoColorConverter.cs deleted file mode 100644 index 700be13..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ComparativoColorConverter.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Media; - -namespace Gestor.Common.Converters -{ - public class ComparativoColorConverter : IMultiValueConverter - { - public ComparativoColorConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - decimal num; - decimal num1; - object darkGoldenrod; - try - { - if (values[0] == null) - { - darkGoldenrod = 0; - } - else if (values[1] != null) - { - num = (!(values[0] is int) ? ((decimal?)values[0]).GetValueOrDefault() : (int)values[0]); - num1 = (!(values[1] is int) ? ((decimal?)values[1]).GetValueOrDefault() : (int)values[1]); - if (num == decimal.Zero && num1 == decimal.Zero) - { - darkGoldenrod = Brushes.DarkGoldenrod; - } - else if (num == decimal.Zero && num1 > decimal.Zero) - { - darkGoldenrod = Brushes.Red; - } - else if (num1 == decimal.Zero && num > decimal.Zero) - { - darkGoldenrod = Brushes.Green; - } - else if (num == decimal.Zero && num1 < decimal.Zero) - { - darkGoldenrod = Brushes.Green; - } - else if (!(num1 == decimal.Zero) || !(num < decimal.Zero)) - { - darkGoldenrod = (((num / num1) - decimal.One) > decimal.Zero ? Brushes.Green : Brushes.Red); - } - else - { - darkGoldenrod = Brushes.Red; - } - } - else - { - darkGoldenrod = 0; - } - } - catch (Exception exception) - { - darkGoldenrod = Brushes.Black; - } - return darkGoldenrod; - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - return null; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/ComparativoConverter.cs b/Gestor.Common/Gestor.Common.Converters/ComparativoConverter.cs deleted file mode 100644 index fb7ee01..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ComparativoConverter.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class ComparativoConverter : IMultiValueConverter - { - public ComparativoConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - decimal num; - decimal num1; - if (values[0] == null) - { - return 0; - } - if (values[1] == null) - { - return 0; - } - num = (!(values[0] is int) ? ((decimal?)values[0]).GetValueOrDefault() : (int)values[0]); - num1 = (!(values[1] is int) ? ((decimal?)values[1]).GetValueOrDefault() : (int)values[1]); - if (num == decimal.Zero && num1 == decimal.Zero) - { - return 0; - } - if (num == decimal.Zero && num1 > decimal.Zero) - { - return -1; - } - if (num1 == decimal.Zero && num > decimal.Zero) - { - return 1; - } - if (num == decimal.Zero && num1 < decimal.Zero) - { - return 1; - } - if (num1 == decimal.Zero && num < decimal.Zero) - { - return -1; - } - return (num - num1) / (num1 > decimal.Zero ? num1 : -num1); - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - return null; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/ComparativoPercentualToolTipConverter.cs b/Gestor.Common/Gestor.Common.Converters/ComparativoPercentualToolTipConverter.cs deleted file mode 100644 index a978ec0..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ComparativoPercentualToolTipConverter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class ComparativoPercentualToolTipConverter : IMultiValueConverter - { - public ComparativoPercentualToolTipConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - object obj; - try - { - decimal num = (decimal)values[1] * new decimal(100); - obj = string.Format("VALOR EM {0}: {1}%", values[0], num); - } - catch (Exception exception) - { - 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/Gestor.Common/Gestor.Common.Converters/ComparativoToolTipConverter.cs b/Gestor.Common/Gestor.Common.Converters/ComparativoToolTipConverter.cs deleted file mode 100644 index c10c19a..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ComparativoToolTipConverter.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class ComparativoToolTipConverter : IMultiValueConverter - { - public ComparativoToolTipConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - string str = (!(values[0] is int) ? "R$" : ""); - return string.Format("VALOR EM {0}: {1} {2}", values[0], str, values[1]); - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - return null; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/EnumDescriptionConverter.cs b/Gestor.Common/Gestor.Common.Converters/EnumDescriptionConverter.cs deleted file mode 100644 index 64de689..0000000 --- a/Gestor.Common/Gestor.Common.Converters/EnumDescriptionConverter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Gestor.Common.Validation; -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class EnumDescriptionConverter : MarkupExtension, IValueConverter - { - public EnumDescriptionConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (!(value is Enum)) - { - return ""; - } - return ((Enum)value).GetDescription(); - } - - 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/Gestor.Common/Gestor.Common.Converters/ExpanderHeaderConverter.cs b/Gestor.Common/Gestor.Common.Converters/ExpanderHeaderConverter.cs deleted file mode 100644 index 8e65056..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ExpanderHeaderConverter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ExpanderHeaderConverter : MarkupExtension, IValueConverter - { - public ExpanderHeaderConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value != null && (bool)value) - { - return "MENOS INFORMAÇÕES"; - } - return "MAIS INFORMAÇÕES"; - } - - 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/Gestor.Common/Gestor.Common.Converters/IdToVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/IdToVisibilityConverter.cs deleted file mode 100644 index ff9f6a3..0000000 --- a/Gestor.Common/Gestor.Common.Converters/IdToVisibilityConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class IdToVisibilityConverter : MarkupExtension, IValueConverter - { - public IdToVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || (int)Math.Round(double.Parse(value.ToString())) == 0 ? Visibility.Visible : Visibility.Collapsed); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || string.IsNullOrEmpty(value.ToString()) ? 0 : int.Parse(value.ToString())); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/InativoVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/InativoVisibilityConverter.cs deleted file mode 100644 index 4969d70..0000000 --- a/Gestor.Common/Gestor.Common.Converters/InativoVisibilityConverter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class InativoVisibilityConverter : IMultiValueConverter - { - public InativoVisibilityConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - object obj = values[0]; - if (obj is bool && (bool)obj) - { - return Visibility.Visible; - } - if (values[1] == null) - { - return Visibility.Collapsed; - } - obj = values[1]; - if (obj is long && (long)obj > (long)0) - { - return Visibility.Visible; - } - return Visibility.Collapsed; - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - return null; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/InvertedBooleanConverter.cs b/Gestor.Common/Gestor.Common.Converters/InvertedBooleanConverter.cs deleted file mode 100644 index a0c0284..0000000 --- a/Gestor.Common/Gestor.Common.Converters/InvertedBooleanConverter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class InvertedBooleanConverter : MarkupExtension, IValueConverter - { - public InvertedBooleanConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null ? false : !(bool)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/Gestor.Common/Gestor.Common.Converters/InvertedBooleanToVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/InvertedBooleanToVisibilityConverter.cs deleted file mode 100644 index 9170c1e..0000000 --- a/Gestor.Common/Gestor.Common.Converters/InvertedBooleanToVisibilityConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class InvertedBooleanToVisibilityConverter : MarkupExtension, IValueConverter - { - public InvertedBooleanToVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || !(bool)value ? 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/Gestor.Common/Gestor.Common.Converters/InvertedVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/InvertedVisibilityConverter.cs deleted file mode 100644 index 34067d0..0000000 --- a/Gestor.Common/Gestor.Common.Converters/InvertedVisibilityConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class InvertedVisibilityConverter : MarkupExtension, IValueConverter - { - public InvertedVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || (Visibility)value != Visibility.Visible ? 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/Gestor.Common/Gestor.Common.Converters/IsInsertedBoolConverter.cs b/Gestor.Common/Gestor.Common.Converters/IsInsertedBoolConverter.cs deleted file mode 100644 index 341ff5e..0000000 --- a/Gestor.Common/Gestor.Common.Converters/IsInsertedBoolConverter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class IsInsertedBoolConverter : MarkupExtension, IValueConverter - { - public IsInsertedBoolConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null ? false : (long)value != (long)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/Gestor.Common/Gestor.Common.Converters/IsNotNullBoolConverter.cs b/Gestor.Common/Gestor.Common.Converters/IsNotNullBoolConverter.cs deleted file mode 100644 index afd3293..0000000 --- a/Gestor.Common/Gestor.Common.Converters/IsNotNullBoolConverter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class IsNotNullBoolConverter : MarkupExtension, IValueConverter - { - public IsNotNullBoolConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return value != 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/Gestor.Common/Gestor.Common.Converters/MesConverter.cs b/Gestor.Common/Gestor.Common.Converters/MesConverter.cs deleted file mode 100644 index 825d4b9..0000000 --- a/Gestor.Common/Gestor.Common.Converters/MesConverter.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Gestor.Common.Validation; -using Gestor.Model.Common; -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class MesConverter : MarkupExtension, IValueConverter - { - public MesConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - { - return ""; - } - if (!(value is Mes)) - { - return ""; - } - return (Mes)value.GetDescription(); - } - - 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/Gestor.Common/Gestor.Common.Converters/MultiBoolAndConverter.cs b/Gestor.Common/Gestor.Common.Converters/MultiBoolAndConverter.cs deleted file mode 100644 index e59ded6..0000000 --- a/Gestor.Common/Gestor.Common.Converters/MultiBoolAndConverter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class MultiBoolAndConverter : IMultiValueConverter - { - public MultiBoolAndConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - object obj; - try - { - obj = ((IEnumerable)values).All((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/Gestor.Common/Gestor.Common.Converters/NegativoColorConverter.cs b/Gestor.Common/Gestor.Common.Converters/NegativoColorConverter.cs deleted file mode 100644 index 4d0ca3a..0000000 --- a/Gestor.Common/Gestor.Common.Converters/NegativoColorConverter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; -using System.Windows.Media; - -namespace Gestor.Common.Converters -{ - public class NegativoColorConverter : MarkupExtension, IValueConverter - { - public NegativoColorConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null || string.IsNullOrEmpty(value.ToString())) - { - return new SolidColorBrush(Colors.Black); - } - if (!value.ToString().Contains("-")) - { - 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/Gestor.Common/Gestor.Common.Converters/NullVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/NullVisibilityConverter.cs deleted file mode 100644 index 25b4679..0000000 --- a/Gestor.Common/Gestor.Common.Converters/NullVisibilityConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class NullVisibilityConverter : MarkupExtension, IValueConverter - { - public NullVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (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/Gestor.Common/Gestor.Common.Converters/NullVisibilityInvertedConverter.cs b/Gestor.Common/Gestor.Common.Converters/NullVisibilityInvertedConverter.cs deleted file mode 100644 index 5e26f34..0000000 --- a/Gestor.Common/Gestor.Common.Converters/NullVisibilityInvertedConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class NullVisibilityInvertedConverter : MarkupExtension, IValueConverter - { - public NullVisibilityInvertedConverter() - { - } - - 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/Gestor.Common/Gestor.Common.Converters/ObjectToStringConverter.cs b/Gestor.Common/Gestor.Common.Converters/ObjectToStringConverter.cs deleted file mode 100644 index 5d36295..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ObjectToStringConverter.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.ComponentModel; -using System.Globalization; -using System.Linq; -using System.Reflection; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class ObjectToStringConverter : IValueConverter - { - public readonly static ObjectToStringConverter Instance; - - static ObjectToStringConverter() - { - ObjectToStringConverter.Instance = new ObjectToStringConverter(); - } - - public ObjectToStringConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - Enum @enum = value as Enum; - if (@enum == null) - { - if (value is DateTime) - { - return ((DateTime)value).ToShortDateString(); - } - if (value == null) - { - return null; - } - return value.ToString(); - } - MemberInfo[] member = @enum.GetType().GetMember(@enum.ToString()); - if (member.Length == 0) - { - return @enum.ToString(); - } - object[] customAttributes = member[0].GetCustomAttributes(typeof(DescriptionAttribute), false); - if (!customAttributes.Any()) - { - return @enum.ToString().Trim(); - } - return ((DescriptionAttribute)customAttributes.ElementAt(0)).Description.Trim(); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return null; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/ObjectVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/ObjectVisibilityConverter.cs deleted file mode 100644 index c17787e..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ObjectVisibilityConverter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Gestor.Model.Common; -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ObjectVisibilityConverter : MarkupExtension, IValueConverter - { - public ObjectVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || (TipoTelefone)value != TipoTelefone.Gratuita && (TipoTelefone)value != TipoTelefone.TarifaUnica ? 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/Gestor.Common/Gestor.Common.Converters/PagamentoVendedorCorretoraVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/PagamentoVendedorCorretoraVisibilityConverter.cs deleted file mode 100644 index 421b4e7..0000000 --- a/Gestor.Common/Gestor.Common.Converters/PagamentoVendedorCorretoraVisibilityConverter.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class PagamentoVendedorCorretoraVisibilityConverter : IMultiValueConverter - { - public PagamentoVendedorCorretoraVisibilityConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - if (values[1] is bool && values[0] == null && (bool)values[1]) - { - 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/Gestor.Common/Gestor.Common.Converters/ParcelaVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/ParcelaVisibilityConverter.cs deleted file mode 100644 index 7bbfdaa..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ParcelaVisibilityConverter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Gestor.Model.Common; -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ParcelaVisibilityConverter : MarkupExtension, IValueConverter - { - public ParcelaVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || (TipoRecebimento)value != TipoRecebimento.Fatura ? 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/Gestor.Common/Gestor.Common.Converters/PendenciaConverter.cs b/Gestor.Common/Gestor.Common.Converters/PendenciaConverter.cs deleted file mode 100644 index b2ab4e6..0000000 --- a/Gestor.Common/Gestor.Common.Converters/PendenciaConverter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Gestor.Common.Helpers; -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class PendenciaConverter : MarkupExtension, IValueConverter - { - public PendenciaConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - { - return ""; - } - TimeSpan date = Functions.GetNetworkTime().Date - ((DateTime)value).Date; - return string.Format("{0:N0} DIAS", date.TotalDays); - } - - 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/Gestor.Common/Gestor.Common.Converters/PendenciaVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/PendenciaVisibilityConverter.cs deleted file mode 100644 index c05b93f..0000000 --- a/Gestor.Common/Gestor.Common.Converters/PendenciaVisibilityConverter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Gestor.Common.Helpers; -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class PendenciaVisibilityConverter : MarkupExtension, IValueConverter - { - public PendenciaVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - { - return ""; - } - return (Functions.GetNetworkTime().Date < (DateTime)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/Gestor.Common/Gestor.Common.Converters/RamoAutoVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/RamoAutoVisibilityConverter.cs deleted file mode 100644 index 353da3c..0000000 --- a/Gestor.Common/Gestor.Common.Converters/RamoAutoVisibilityConverter.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Gestor.Model.Domain.Generic; -using Gestor.Model.Domain.Seguros; -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class RamoAutoVisibilityConverter : MarkupExtension, IValueConverter - { - public RamoAutoVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - bool ramo; - Documento documento = (Documento)value; - if (documento != null) - { - Controle controle = documento.Controle; - if (controle != null) - { - ramo = controle.Ramo; - } - else - { - ramo = false; - } - } - else - { - ramo = false; - } - return (!ramo || ((Documento)value).Controle.Ramo.Id != (long)5 && ((Documento)value).Controle.Ramo.Id != (long)2 ? 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/Gestor.Common/Gestor.Common.Converters/RecebidoColorConverter.cs b/Gestor.Common/Gestor.Common.Converters/RecebidoColorConverter.cs deleted file mode 100644 index e068a77..0000000 --- a/Gestor.Common/Gestor.Common.Converters/RecebidoColorConverter.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Media; - -namespace Gestor.Common.Converters -{ - public class RecebidoColorConverter : IMultiValueConverter - { - public RecebidoColorConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - if (values[1] != null) - { - return new SolidColorBrush(Colors.Green); - } - if ((DateTime)values[0] >= DateTime.Today) - { - return new SolidColorBrush(Colors.Black); - } - return new SolidColorBrush(Colors.Red); - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - return null; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/SaldoWeightConverter.cs b/Gestor.Common/Gestor.Common.Converters/SaldoWeightConverter.cs deleted file mode 100644 index 78482d3..0000000 --- a/Gestor.Common/Gestor.Common.Converters/SaldoWeightConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class SaldoWeightConverter : MarkupExtension, IValueConverter - { - public SaldoWeightConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || (bool)value ? FontWeights.Bold : FontWeights.Regular); - } - - 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/Gestor.Common/Gestor.Common.Converters/SinalColorConverter.cs b/Gestor.Common/Gestor.Common.Converters/SinalColorConverter.cs deleted file mode 100644 index 895a11e..0000000 --- a/Gestor.Common/Gestor.Common.Converters/SinalColorConverter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Gestor.Model.Common; -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; -using System.Windows.Media; - -namespace Gestor.Common.Converters -{ - public class SinalColorConverter : MarkupExtension, IValueConverter - { - public SinalColorConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value != null && (Sinal)value == Sinal.Debito) - { - return new SolidColorBrush(Colors.Red); - } - return new SolidColorBrush(Colors.Black); - } - - 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/Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs b/Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs deleted file mode 100644 index d6e2fba..0000000 --- a/Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs +++ /dev/null @@ -1,65 +0,0 @@ -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.Common.Converters -{ - public class StatusExtratoColorConverter : MarkupExtension, IValueConverter - { - public StatusExtratoColorConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - { - return new SolidColorBrush(Colors.Black); - } - switch ((StatusParcela)value) - { - case StatusParcela.Baixada: - case StatusParcela.BaixadaAnteriormente: - case StatusParcela.BaixadaDiferencaPercentual: - case StatusParcela.BaixadaManualmente: - case StatusParcela.ParcelaEspecialBaixadaAnteriormente: - { - return new SolidColorBrush(Colors.Green); - } - case StatusParcela.DocumentoNaoEncontrado: - case StatusParcela.ParcelaNaoEncontrada: - case StatusParcela.DesconsideradaUsuario: - case StatusParcela.ParcelaAnteriorNaoBaixada: - { - return new SolidColorBrush(Colors.Red); - } - case StatusParcela.DesconsideradaSistema: - { - return new SolidColorBrush(Colors.Gray); - } - case StatusParcela.ApoliceDuplicada: - { - return new SolidColorBrush((Color)Application.Current.Resources["AggerYellow100"]); - } - default: - { - return new SolidColorBrush(Colors.Black); - } - } - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || string.IsNullOrEmpty(value.ToString()) ? 0 : int.Parse(value.ToString())); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/StatusParcelaVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/StatusParcelaVisibilityConverter.cs deleted file mode 100644 index 41efabb..0000000 --- a/Gestor.Common/Gestor.Common.Converters/StatusParcelaVisibilityConverter.cs +++ /dev/null @@ -1,42 +0,0 @@ -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.Common.Converters -{ - public class StatusParcelaVisibilityConverter : MarkupExtension, IValueConverter - { - public StatusParcelaVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - { - return Visibility.Collapsed; - } - return ((new List() - { - StatusParcela.Baixada, - StatusParcela.BaixadaDiferencaPercentual, - StatusParcela.BaixadaManualmente, - StatusParcela.BaixadaCritica - }).Contains((StatusParcela)value) ? 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/Gestor.Common/Gestor.Common.Converters/StatusTarefaVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/StatusTarefaVisibilityConverter.cs deleted file mode 100644 index 4a6184c..0000000 --- a/Gestor.Common/Gestor.Common.Converters/StatusTarefaVisibilityConverter.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Gestor.Model.Common; -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class StatusTarefaVisibilityConverter : MarkupExtension, IValueConverter - { - public StatusTarefaVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - bool flag = false; - Visibility visibility; - bool flag1 = (parameter == null ? false : bool.TryParse(parameter.ToString(), out flag)) & flag; - Visibility visibility1 = (value == null || (StatusTarefa)value == StatusTarefa.Realizado ? Visibility.Visible : Visibility.Collapsed); - if (flag1) - { - visibility = (visibility1 == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible); - } - else - { - visibility = visibility1; - } - 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/Gestor.Common/Gestor.Common.Converters/StringNullOrEmptyToVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/StringNullOrEmptyToVisibilityConverter.cs deleted file mode 100644 index 8903884..0000000 --- a/Gestor.Common/Gestor.Common.Converters/StringNullOrEmptyToVisibilityConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class StringNullOrEmptyToVisibilityConverter : MarkupExtension, IValueConverter - { - public StringNullOrEmptyToVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (string.IsNullOrEmpty(value as string) ? 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/Gestor.Common/Gestor.Common.Converters/TarefaBackgroundColorConverter.cs b/Gestor.Common/Gestor.Common.Converters/TarefaBackgroundColorConverter.cs deleted file mode 100644 index afe3120..0000000 --- a/Gestor.Common/Gestor.Common.Converters/TarefaBackgroundColorConverter.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Gestor.Common.Helpers; -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; -using System.Windows.Media; - -namespace Gestor.Common.Converters -{ - public class TarefaBackgroundColorConverter : MarkupExtension, IValueConverter - { - public TarefaBackgroundColorConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value != null && !((DateTime)value < Functions.GetNetworkTime())) - { - return new SolidColorBrush(Colors.Black); - } - return new SolidColorBrush(this.ConvertStringToColor("#fc636b")); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return null; - } - - public Color ConvertStringToColor(string hex) - { - hex = hex.Replace("#", ""); - byte num = 255; - byte num1 = 255; - byte num2 = 255; - byte num3 = 255; - int num4 = 0; - if (hex.Length == 8) - { - num = byte.Parse(hex.Substring(0, 2), NumberStyles.HexNumber); - num4 = 2; - } - num1 = byte.Parse(hex.Substring(num4, 2), NumberStyles.HexNumber); - num2 = byte.Parse(hex.Substring(num4 + 2, 2), NumberStyles.HexNumber); - num3 = byte.Parse(hex.Substring(num4 + 4, 2), NumberStyles.HexNumber); - return Color.FromArgb(num, num1, num2, num3); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/TemTarefaVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/TemTarefaVisibilityConverter.cs deleted file mode 100644 index 9b565f3..0000000 --- a/Gestor.Common/Gestor.Common.Converters/TemTarefaVisibilityConverter.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Gestor.Model.Domain.Ferramentas; -using System; -using System.Collections.ObjectModel; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class TemTarefaVisibilityConverter : MarkupExtension, IValueConverter - { - public TemTarefaVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || ((ObservableCollection)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/Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs b/Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs deleted file mode 100644 index c88e9c7..0000000 --- a/Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class TipoCriticaConverter : IMultiValueConverter - { - public TipoCriticaConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - object obj; - try - { - string str = (string)values[0]; - if (str == "0") - { - obj = (string)values[1]; - } - else - { - obj = (str == "1" ? (string)values[2] : ""); - } - } - catch (Exception exception) - { - 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/Gestor.Common/Gestor.Common.Converters/TipoSinistroConverter.cs b/Gestor.Common/Gestor.Common.Converters/TipoSinistroConverter.cs deleted file mode 100644 index 4455982..0000000 --- a/Gestor.Common/Gestor.Common.Converters/TipoSinistroConverter.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Gestor.Model.Common; -using System; -using System.Globalization; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class TipoSinistroConverter : IMultiValueConverter - { - public TipoSinistroConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - object obj = values[0]; - if (obj as TipoSinistro == TipoSinistro.Cliente) - { - return ""; - } - if ((TipoSinistro)obj == TipoSinistro.Cliente) - { - return "CLIENTE"; - } - obj = values[1]; - if (obj == null) - { - return "TERCEIRO"; - } - string str = obj as string; - if (str == null) - { - return ""; - } - return string.Concat("TERCEIRO Nº ", str); - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - return null; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/TipoTelefoneVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/TipoTelefoneVisibilityConverter.cs deleted file mode 100644 index 37a212e..0000000 --- a/Gestor.Common/Gestor.Common.Converters/TipoTelefoneVisibilityConverter.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Gestor.Model.Common; -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; - -namespace Gestor.Common.Converters -{ - public class TipoTelefoneVisibilityConverter : IMultiValueConverter - { - public TipoTelefoneVisibilityConverter() - { - } - - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - if (values[0] == null) - { - return Visibility.Collapsed; - } - object obj = values[0]; - if (obj is TipoTelefone && (TipoTelefone)obj != TipoTelefone.Celular) - { - return Visibility.Collapsed; - } - obj = values[1]; - if (obj is bool && (bool)obj) - { - 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/Gestor.Common/Gestor.Common.Converters/TotalizacaoExpanderConverter.cs b/Gestor.Common/Gestor.Common.Converters/TotalizacaoExpanderConverter.cs deleted file mode 100644 index 701e944..0000000 --- a/Gestor.Common/Gestor.Common.Converters/TotalizacaoExpanderConverter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class TotalizacaoExpanderConverter : MarkupExtension, IValueConverter - { - public TotalizacaoExpanderConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value != null && (bool)value) - { - return "ESCONDER TOTALIZAÇÃO"; - } - return "MOSTRAR TOTALIZAÇÃO"; - } - - 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/Gestor.Common/Gestor.Common.Converters/ValorTipoConverter.cs b/Gestor.Common/Gestor.Common.Converters/ValorTipoConverter.cs deleted file mode 100644 index 1e100a0..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ValorTipoConverter.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.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/Gestor.Common/Gestor.Common.Converters/ZeroToEmptyConverter.cs b/Gestor.Common/Gestor.Common.Converters/ZeroToEmptyConverter.cs deleted file mode 100644 index bcedd65..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ZeroToEmptyConverter.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ZeroToEmptyConverter : MarkupExtension, IValueConverter - { - public ZeroToEmptyConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - { - return ""; - } - if (value is string) - { - return value; - } - if (Math.Abs(Convert.ToDouble(value)) < 0.01) - { - return ""; - } - return value.ToString(); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || string.IsNullOrEmpty(value.ToString()) ? 0 : int.Parse(value.ToString())); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityConverter.cs deleted file mode 100644 index 6422f0b..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ZeroToVisibilityConverter : MarkupExtension, IValueConverter - { - public ZeroToVisibilityConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || (int)Math.Round(double.Parse(value.ToString())) == 0 ? Visibility.Collapsed : Visibility.Visible); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || string.IsNullOrEmpty(value.ToString()) ? 0 : int.Parse(value.ToString())); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityInvertedConverter.cs b/Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityInvertedConverter.cs deleted file mode 100644 index 356332b..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityInvertedConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ZeroToVisibilityInvertedConverter : MarkupExtension, IValueConverter - { - public ZeroToVisibilityInvertedConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || (int)Math.Round(double.Parse(value.ToString())) == 0 ? Visibility.Visible : Visibility.Collapsed); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || string.IsNullOrEmpty(value.ToString()) ? 0 : int.Parse(value.ToString())); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityValorConverter.cs b/Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityValorConverter.cs deleted file mode 100644 index ac8afa4..0000000 --- a/Gestor.Common/Gestor.Common.Converters/ZeroToVisibilityValorConverter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows; -using System.Windows.Data; -using System.Windows.Markup; - -namespace Gestor.Common.Converters -{ - public class ZeroToVisibilityValorConverter : MarkupExtension, IValueConverter - { - public ZeroToVisibilityValorConverter() - { - } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - decimal num; - return (value == null || !decimal.TryParse(value.ToString(), out num) && decimal.Parse(value.ToString()) <= decimal.Zero ? Visibility.Collapsed : Visibility.Visible); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return (value == null || string.IsNullOrEmpty(value.ToString()) ? 0 : int.Parse(value.ToString())); - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - return this; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Exceptions/AbortException.cs b/Gestor.Common/Gestor.Common.Exceptions/AbortException.cs deleted file mode 100644 index 6fc2511..0000000 --- a/Gestor.Common/Gestor.Common.Exceptions/AbortException.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace Gestor.Common.Exceptions -{ - public class AbortException : Exception - { - public AbortException() : base(string.Empty) - { - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Exceptions/BaseException.cs b/Gestor.Common/Gestor.Common.Exceptions/BaseException.cs deleted file mode 100644 index 6078b23..0000000 --- a/Gestor.Common/Gestor.Common.Exceptions/BaseException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Gestor.Common.Exceptions -{ - public class BaseException : Exception - { - public BaseException(string message) : base(message) - { - } - - public BaseException() : base(string.Empty) - { - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Exceptions/ForbiddenException.cs b/Gestor.Common/Gestor.Common.Exceptions/ForbiddenException.cs deleted file mode 100644 index a608b24..0000000 --- a/Gestor.Common/Gestor.Common.Exceptions/ForbiddenException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Gestor.Common.Exceptions -{ - public class ForbiddenException : Exception - { - public ForbiddenException(string message) : base(message) - { - } - - public ForbiddenException() : base(string.Empty) - { - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Exceptions/MailingException.cs b/Gestor.Common/Gestor.Common.Exceptions/MailingException.cs deleted file mode 100644 index 9fd65a5..0000000 --- a/Gestor.Common/Gestor.Common.Exceptions/MailingException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Gestor.Common.Exceptions -{ - public class MailingException : BaseException - { - public MailingException(string message) : base(message) - { - } - - public MailingException() : base(string.Empty) - { - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Exceptions/PermissionException.cs b/Gestor.Common/Gestor.Common.Exceptions/PermissionException.cs deleted file mode 100644 index f80f0dc..0000000 --- a/Gestor.Common/Gestor.Common.Exceptions/PermissionException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Gestor.Common.Exceptions -{ - public class PermissionException : Exception - { - public PermissionException() - { - } - - public PermissionException(string message) : base(message) - { - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Exceptions/UnauthorizedException.cs b/Gestor.Common/Gestor.Common.Exceptions/UnauthorizedException.cs deleted file mode 100644 index 7e95254..0000000 --- a/Gestor.Common/Gestor.Common.Exceptions/UnauthorizedException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Gestor.Common.Exceptions -{ - public class UnauthorizedException : Exception - { - public UnauthorizedException(string message) : base(message) - { - } - - public UnauthorizedException() : base(string.Empty) - { - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Exceptions/ValidationException.cs b/Gestor.Common/Gestor.Common.Exceptions/ValidationException.cs deleted file mode 100644 index b2a3bca..0000000 --- a/Gestor.Common/Gestor.Common.Exceptions/ValidationException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Gestor.Common.Exceptions -{ - public class ValidationException : Exception - { - public ValidationException(string message) : base(message) - { - } - - public ValidationException() : base(string.Empty) - { - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/DataBaseParameters.cs b/Gestor.Common/Gestor.Common.Helpers/DataBaseParameters.cs deleted file mode 100644 index 03ccc65..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/DataBaseParameters.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Runtime.CompilerServices; - -namespace Gestor.Common.Helpers -{ - public static class DataBaseParameters - { - public static bool NovoGestor - { - get; - set; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/DefaultAttribute.cs b/Gestor.Common/Gestor.Common.Helpers/DefaultAttribute.cs deleted file mode 100644 index b79d623..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/DefaultAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Runtime.CompilerServices; - -namespace Gestor.Common.Helpers -{ - public class DefaultAttribute : Attribute - { - public bool DefaultProperty - { - get; - private set; - } - - public DefaultAttribute(bool defaultProperty) - { - this.DefaultProperty = defaultProperty; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/EncryptionHelper.cs b/Gestor.Common/Gestor.Common.Helpers/EncryptionHelper.cs deleted file mode 100644 index b2102d2..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/EncryptionHelper.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.IO; -using System.Runtime.CompilerServices; -using System.Security.Cryptography; -using System.Text; - -namespace Gestor.Common.Helpers -{ - public static class EncryptionHelper - { - private readonly static byte[] Salt; - - private readonly static string EncryptionKey; - - static EncryptionHelper() - { - EncryptionHelper.Salt = new byte[] { 38, 220, 255, 0, 173, 237, 122, 238, 197, 254, 7, 175, 77, 8, 34, 60 }; - EncryptionHelper.EncryptionKey = string.Format("aGG3r{0}#w3BDz$", 1012); - } - - public static string Decrypt(this string cipher) - { - string str; - if (string.IsNullOrEmpty(cipher)) - { - return null; - } - try - { - byte[] numArray = Convert.FromBase64String(cipher); - if ((int)numArray.Length >= 16) - { - byte[] numArray1 = numArray.DecryptBytes(); - str = (numArray1 == null ? cipher : Encoding.UTF8.GetString(numArray1)); - } - else - { - str = cipher; - } - } - catch (Exception exception) - { - str = cipher; - } - return str; - } - - public static byte[] DecryptBytes(this byte[] plainTextBytes) - { - byte[] array; - try - { - using (Rfc2898DeriveBytes rfc2898DeriveByte = new Rfc2898DeriveBytes(EncryptionHelper.EncryptionKey, EncryptionHelper.Salt)) - { - using (Rijndael bytes = Rijndael.Create()) - { - bytes.Key = rfc2898DeriveByte.GetBytes(32); - bytes.IV = rfc2898DeriveByte.GetBytes(16); - using (MemoryStream memoryStream = new MemoryStream()) - { - using (CryptoStream cryptoStream = new CryptoStream(memoryStream, bytes.CreateDecryptor(), CryptoStreamMode.Write)) - { - cryptoStream.Write(plainTextBytes, 0, (int)plainTextBytes.Length); - cryptoStream.FlushFinalBlock(); - array = memoryStream.ToArray(); - } - } - } - } - } - catch (Exception exception) - { - array = null; - } - return array; - } - - public static string Encrypt(this string plain) - { - return Convert.ToBase64String(Encoding.UTF8.GetBytes(plain).EncryptBytes()); - } - - public static byte[] EncryptBytes(this byte[] plainTextBytes) - { - byte[] array; - using (Rfc2898DeriveBytes rfc2898DeriveByte = new Rfc2898DeriveBytes(EncryptionHelper.EncryptionKey, EncryptionHelper.Salt)) - { - using (Rijndael bytes = Rijndael.Create()) - { - bytes.Key = rfc2898DeriveByte.GetBytes(32); - bytes.IV = rfc2898DeriveByte.GetBytes(16); - using (MemoryStream memoryStream = new MemoryStream()) - { - using (CryptoStream cryptoStream = new CryptoStream(memoryStream, bytes.CreateEncryptor(), CryptoStreamMode.Write)) - { - cryptoStream.Write(plainTextBytes, 0, (int)plainTextBytes.Length); - cryptoStream.FlushFinalBlock(); - array = memoryStream.ToArray(); - } - } - } - } - return array; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/EnumBindingSourceExtension.cs b/Gestor.Common/Gestor.Common.Helpers/EnumBindingSourceExtension.cs deleted file mode 100644 index 7ce699e..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/EnumBindingSourceExtension.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Windows.Markup; - -namespace Gestor.Common.Helpers -{ - public class EnumBindingSourceExtension : MarkupExtension - { - private Type _enumType; - - public Type EnumType - { - get - { - return this._enumType; - } - set - { - if (value == this._enumType) - { - return; - } - if (null != value) - { - if (!(Nullable.GetUnderlyingType(value) ?? value).IsEnum) - { - throw new ArgumentException("Type must be for an Enum."); - } - } - this._enumType = value; - } - } - - public EnumBindingSourceExtension() - { - } - - public EnumBindingSourceExtension(Type enumType) - { - this.EnumType = enumType; - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - if (null == this._enumType) - { - throw new InvalidOperationException("The EnumType must be specified."); - } - Type underlyingType = Nullable.GetUnderlyingType(this._enumType) ?? this._enumType; - Array values = Enum.GetValues(underlyingType); - if (underlyingType == this._enumType) - { - return values; - } - Array arrays = Array.CreateInstance(underlyingType, values.Length + 1); - values.CopyTo(arrays, 1); - return arrays; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/EnumHelper.cs b/Gestor.Common/Gestor.Common.Helpers/EnumHelper.cs deleted file mode 100644 index 33529b8..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/EnumHelper.cs +++ /dev/null @@ -1,166 +0,0 @@ -using Gestor.Model.Attributes; -using System; -using System.ComponentModel; -using System.Reflection; -using System.Runtime.CompilerServices; - -namespace Gestor.Common.Helpers -{ - public static class EnumHelper - { - public static T2 GetAttribute(this T enumValue) - where T2 : class - { - T2 customAttribute; - string name = Enum.GetName(enumValue.GetType(), enumValue); - try - { - customAttribute = (T2)(Attribute.GetCustomAttribute(enumValue.GetType().GetField(name), typeof(T2)) as T2); - } - catch (Exception exception) - { - customAttribute = default(T2); - } - return customAttribute; - } - - public static bool? GetDefault(this T enumValue) - { - object customAttribute; - string name = Enum.GetName(enumValue.GetType(), enumValue); - FieldInfo field = enumValue.GetType().GetField(name); - if (field == null) - { - customAttribute = null; - } - else - { - customAttribute = Attribute.GetCustomAttribute(field, typeof(DefaultAttribute)) as DefaultAttribute; - } - if (customAttribute != null) - { - return new bool?(((DefaultAttribute)customAttribute).DefaultProperty); - } - return null; - } - - public static string GetDescription(this T enumValue) - { - object customAttribute; - string name = Enum.GetName(enumValue.GetType(), enumValue); - if (name == null) - { - return null; - } - FieldInfo field = enumValue.GetType().GetField(name); - if (field == null) - { - customAttribute = null; - } - else - { - customAttribute = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) as DescriptionAttribute; - } - if (customAttribute != null) - { - return ((DescriptionAttribute)customAttribute).Description; - } - return null; - } - - public static bool GetHidden(this T enumValue) - { - object customAttribute; - string name = Enum.GetName(enumValue.GetType(), enumValue); - FieldInfo field = enumValue.GetType().GetField(name); - if (field == null) - { - customAttribute = null; - } - else - { - customAttribute = Attribute.GetCustomAttribute(field, typeof(HiddenAttribute)) as HiddenAttribute; - } - return customAttribute != null; - } - - public static string GetOldValue(this T enumValue) - { - OldValueAttribute attribute = enumValue.GetAttribute(); - if (attribute != null) - { - return attribute.OldValue; - } - return null; - } - - public static string GetOldValue2(this T enumValue) - { - OldValue2Attribute attribute = enumValue.GetAttribute(); - if (attribute != null) - { - return attribute.OldValue2; - } - return null; - } - - public static int? GetOrder(this T enumValue) - { - object customAttribute; - string name = Enum.GetName(enumValue.GetType(), enumValue); - FieldInfo field = enumValue.GetType().GetField(name); - if (field == null) - { - customAttribute = null; - } - else - { - customAttribute = Attribute.GetCustomAttribute(field, typeof(OrderAttribute)) as OrderAttribute; - } - if (customAttribute != null) - { - return new int?(((OrderAttribute)customAttribute).OrderProperty); - } - return null; - } - - public static T ToEnumByOldValue(this string oldValue) - { - Type type = typeof(T); - Type type1 = typeof(OldValueAttribute); - FieldInfo[] fields = type.GetFields(); - for (int i = 0; i < (int)fields.Length; i++) - { - FieldInfo fieldInfo = fields[i]; - OldValueAttribute customAttribute = Attribute.GetCustomAttribute(fieldInfo, type1) as OldValueAttribute; - if (customAttribute != null && customAttribute.OldValue == oldValue) - { - return (T)fieldInfo.GetValue(null); - } - } - return default(T); - } - - public static T ToEnumByOldValue2(this string oldValue) - { - Type type = typeof(T); - Type type1 = typeof(OldValue2Attribute); - FieldInfo[] fields = type.GetFields(); - for (int i = 0; i < (int)fields.Length; i++) - { - FieldInfo fieldInfo = fields[i]; - OldValue2Attribute customAttribute = Attribute.GetCustomAttribute(fieldInfo, type1) as OldValue2Attribute; - if (customAttribute != null && customAttribute.OldValue2 == oldValue) - { - return (T)fieldInfo.GetValue(null); - } - } - return default(T); - } - - public static string Value(this T enumValue) - { - return Convert.ToInt32(enumValue).ToString(); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/FindVisualChild.cs b/Gestor.Common/Gestor.Common.Helpers/FindVisualChild.cs deleted file mode 100644 index 4cabf7c..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/FindVisualChild.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Media; - -namespace Gestor.Common.Helpers -{ - public class FindVisualChild - { - public FindVisualChild() - { - } - - public static childItem Find(DependencyObject obj) - where childItem : DependencyObject - { - for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++) - { - DependencyObject child = VisualTreeHelper.GetChild(obj, i); - if (child != null && child is childItem) - { - return (childItem)child; - } - childItem _childItem = FindVisualChild.Find(child); - if (_childItem != null) - { - return _childItem; - } - } - return default(childItem); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/FindVisualChildren.cs b/Gestor.Common/Gestor.Common.Helpers/FindVisualChildren.cs deleted file mode 100644 index 9b7f11d..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/FindVisualChildren.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Windows; -using System.Windows.Media; - -namespace Gestor.Common.Helpers -{ - public class FindVisualChildren - { - public FindVisualChildren() - { - } - - public static IEnumerable Find(DependencyObject depObj) - where T : DependencyObject - { - if (depObj != null) - { - for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++) - { - DependencyObject dependencyObject = VisualTreeHelper.GetChild(depObj, i); - if (dependencyObject != null && dependencyObject is T) - { - yield return (T)dependencyObject; - } - foreach (T t in FindVisualChildren.Find(dependencyObject)) - { - yield return t; - } - dependencyObject = null; - } - } - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/Functions.cs b/Gestor.Common/Gestor.Common.Helpers/Functions.cs deleted file mode 100644 index 25ffadf..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/Functions.cs +++ /dev/null @@ -1,110 +0,0 @@ -using Gestor.Common.Validation; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Runtime.CompilerServices; - -namespace Gestor.Common.Helpers -{ - public class Functions - { - public static System.Diagnostics.Stopwatch Stopwatch; - - public static DateTime? StartTime; - - public Functions() - { - } - - public static int Compare(string original, string modified) - { - if (original == null) - { - original = ""; - } - if (modified == null) - { - modified = ""; - } - string str = original.ToLongNullable().ToString(); - if (!string.IsNullOrWhiteSpace(str)) - { - original = str; - } - str = modified.ToLongNullable().ToString(); - if (!string.IsNullOrWhiteSpace(str)) - { - modified = str; - } - int length = original.Length; - int num = modified.Length; - int[,] numArray = new int[length + 1, num + 1]; - for (int i = 0; i <= length; i++) - { - numArray[i, 0] = i; - } - for (int j = 0; j <= num; j++) - { - numArray[0, j] = j; - } - for (int k = 1; k <= length; k++) - { - for (int l = 1; l <= num; l++) - { - int num1 = modified[l - 1] != original[k - 1]; - numArray[k, l] = (new int[] { numArray[k - 1, l] + 1, numArray[k, l - 1] + 1, numArray[k - 1, l - 1] + num1 }).Min(); - if (k > 1 && l > 1 && original[k - 1] == modified[l - 2] && original[k - 2] == modified[l - 1]) - { - numArray[k, l] = Math.Min(numArray[k, l], numArray[k - 2, l - 2] + num1); - } - } - } - return numArray[length, num]; - } - - public static DateTime GetNetworkTime() - { - DateTime value; - try - { - if (!Functions.StartTime.HasValue) - { - byte[] numArray = new byte[48]; - numArray[0] = 27; - IPEndPoint pEndPoint = new IPEndPoint(((IEnumerable)Dns.GetHostEntry("time.google.com").AddressList).First((IPAddress a) => a.AddressFamily == AddressFamily.InterNetwork), 123); - using (Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) - { - socket.Connect(pEndPoint); - socket.ReceiveTimeout = 3000; - socket.Send(numArray); - socket.Receive(numArray); - socket.Close(); - } - ulong num = (ulong)numArray[40] << 24 | (ulong)numArray[41] << 16 | (ulong)numArray[42] << 8 | (ulong)numArray[43]; - ulong num1 = (ulong)numArray[44] << 24 | (ulong)numArray[45] << 16 | (ulong)numArray[46] << 8 | (ulong)numArray[47]; - ulong num2 = num * (long)1000 + num1 * (long)1000 / 4294967296L; - DateTime dateTime = new DateTime(1900, 1, 1); - dateTime = dateTime.AddMilliseconds((double)num2); - Functions.StartTime = new DateTime?(dateTime.ToLocalTime()); - Functions.Stopwatch = System.Diagnostics.Stopwatch.StartNew(); - value = Functions.StartTime.Value; - } - else - { - value = Functions.StartTime.Value; - value = value.AddMilliseconds((double)Functions.Stopwatch.ElapsedMilliseconds); - } - } - catch (Exception exception) - { - Functions.StartTime = new DateTime?(DateTime.Now); - Functions.Stopwatch = System.Diagnostics.Stopwatch.StartNew(); - value = Functions.StartTime.Value; - } - return value; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/HiddenAttribute.cs b/Gestor.Common/Gestor.Common.Helpers/HiddenAttribute.cs deleted file mode 100644 index 236be6f..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/HiddenAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Gestor.Common.Helpers -{ - [AttributeUsage(AttributeTargets.All)] - public class HiddenAttribute : Attribute - { - public HiddenAttribute() - { - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs b/Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs deleted file mode 100644 index 26b53e3..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Http; -using System.Runtime.CompilerServices; - -namespace Gestor.Common.Helpers -{ - public static class HttpHelper - { - public static HttpRequestMessage CreateRequest(this Uri requestUri, HttpMethod httpMethod, Version httpVersion = null) - { - HttpRequestMessage httpRequestMessage = new HttpRequestMessage(); - httpRequestMessage.set_Version(httpVersion ?? HttpVersion.Version11); - httpRequestMessage.set_RequestUri(requestUri); - httpRequestMessage.set_Method(httpMethod); - return httpRequestMessage; - } - - public static FormUrlEncodedContent Encode(this List> keyValuePairs) - { - return new FormUrlEncodedContent(keyValuePairs); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/OrderAttribute.cs b/Gestor.Common/Gestor.Common.Helpers/OrderAttribute.cs deleted file mode 100644 index 58dba77..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/OrderAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Runtime.CompilerServices; - -namespace Gestor.Common.Helpers -{ - [AttributeUsage(AttributeTargets.All)] - public class OrderAttribute : Attribute - { - public int OrderProperty - { - get; - private set; - } - - public OrderAttribute(int orderProperty) - { - this.OrderProperty = orderProperty; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Helpers/ScrollAnimationBehavior.cs b/Gestor.Common/Gestor.Common.Helpers/ScrollAnimationBehavior.cs deleted file mode 100644 index 6332e15..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/ScrollAnimationBehavior.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; -using System.Windows.Media.Animation; - -namespace Gestor.Common.Helpers -{ - public static class ScrollAnimationBehavior - { - public static DependencyProperty VerticalOffsetProperty; - - public static DependencyProperty TimeDurationProperty; - - public static DependencyProperty PointsToScrollProperty; - - public static DependencyProperty IsEnabledProperty; - - private static double _currentToValue; - - private static Storyboard _storyboard; - - static ScrollAnimationBehavior() - { - ScrollAnimationBehavior.VerticalOffsetProperty = DependencyProperty.RegisterAttached("VerticalOffset", typeof(double), typeof(ScrollAnimationBehavior), new UIPropertyMetadata((object)0, new PropertyChangedCallback(ScrollAnimationBehavior.OnVerticalOffsetChanged))); - ScrollAnimationBehavior.TimeDurationProperty = DependencyProperty.RegisterAttached("TimeDuration", typeof(TimeSpan), typeof(ScrollAnimationBehavior), new PropertyMetadata((object)(new TimeSpan(0, 0, 0, 0, 0)))); - ScrollAnimationBehavior.PointsToScrollProperty = DependencyProperty.RegisterAttached("PointsToScroll", typeof(double), typeof(ScrollAnimationBehavior), new PropertyMetadata((object)0)); - ScrollAnimationBehavior.IsEnabledProperty = DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(ScrollAnimationBehavior), new UIPropertyMetadata(false, new PropertyChangedCallback(ScrollAnimationBehavior.OnIsEnabledChanged))); - } - - private static void AnimateScroll(ScrollViewer scrollViewer) - { - DoubleAnimationUsingKeyFrames doubleAnimationUsingKeyFrame = new DoubleAnimationUsingKeyFrames() - { - Duration = new Duration(ScrollAnimationBehavior.GetTimeDuration(scrollViewer)) - }; - doubleAnimationUsingKeyFrame.KeyFrames.Add(new EasingDoubleKeyFrame(scrollViewer.VerticalOffset, KeyTime.FromPercent(0))); - doubleAnimationUsingKeyFrame.KeyFrames.Add(new EasingDoubleKeyFrame(ScrollAnimationBehavior._currentToValue, KeyTime.FromPercent(1), new SineEase() - { - EasingMode = EasingMode.EaseOut - })); - ScrollAnimationBehavior._storyboard = new Storyboard(); - ScrollAnimationBehavior._storyboard.Children.Add(doubleAnimationUsingKeyFrame); - Storyboard.SetTarget(doubleAnimationUsingKeyFrame, scrollViewer); - Storyboard.SetTargetProperty(doubleAnimationUsingKeyFrame, new PropertyPath(ScrollAnimationBehavior.VerticalOffsetProperty)); - ScrollAnimationBehavior._storyboard.Begin(); - } - - public static TimeSpan GetTimeDuration(FrameworkElement target) - { - return (TimeSpan)target.GetValue(ScrollAnimationBehavior.TimeDurationProperty); - } - - private static void OnIsEnabledChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) - { - ScrollViewer scrollViewer = sender as ScrollViewer; - if (scrollViewer != null) - { - scrollViewer.Loaded += new RoutedEventHandler(ScrollAnimationBehavior.ScrollerLoaded); - } - } - - private static void OnVerticalOffsetChanged(DependencyObject target, DependencyPropertyChangedEventArgs e) - { - ScrollViewer scrollViewer = target as ScrollViewer; - if (scrollViewer != null) - { - scrollViewer.ScrollToVerticalOffset((double)e.NewValue); - } - } - - private static void ScrollerLoaded(object sender, RoutedEventArgs e) - { - ScrollAnimationBehavior.SetEventHandlersForScrollViewer(sender as ScrollViewer); - } - - private static void ScrollViewerPreviewMouseWheel(object sender, MouseWheelEventArgs e) - { - double num; - double num1 = ScrollAnimationBehavior._currentToValue; - double delta = (double)e.Delta; - ScrollViewer scrollViewer = (ScrollViewer)sender; - double num2 = delta * 2 / 3; - if (ScrollAnimationBehavior._storyboard == null || ScrollAnimationBehavior._storyboard.GetCurrentState() == ClockState.Filling) - { - ScrollAnimationBehavior._currentToValue = scrollViewer.VerticalOffset; - } - if (num2 > ScrollAnimationBehavior._currentToValue) - { - num = 0; - } - else - { - num = (ScrollAnimationBehavior._currentToValue - num2 > scrollViewer.ScrollableHeight ? scrollViewer.ScrollableHeight : ScrollAnimationBehavior._currentToValue - num2); - } - ScrollAnimationBehavior._currentToValue = num; - if (ScrollAnimationBehavior._currentToValue != scrollViewer.VerticalOffset && ScrollAnimationBehavior._currentToValue != num1) - { - ScrollAnimationBehavior.AnimateScroll(scrollViewer); - } - e.Handled = true; - } - - private static void SetEventHandlersForScrollViewer(ScrollViewer scroller) - { - scroller.PreviewMouseWheel += new MouseWheelEventHandler(ScrollAnimationBehavior.ScrollViewerPreviewMouseWheel); - } - - public static void SetIsEnabled(FrameworkElement target, bool value) - { - target.SetValue(ScrollAnimationBehavior.IsEnabledProperty, value); - } - - public static void SetPointsToScroll(FrameworkElement target, double value) - { - target.SetValue(ScrollAnimationBehavior.PointsToScrollProperty, value); - } - - public static void SetTimeDuration(FrameworkElement target, TimeSpan value) - { - target.SetValue(ScrollAnimationBehavior.TimeDurationProperty, value); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Security/Token.cs b/Gestor.Common/Gestor.Common.Security/Token.cs deleted file mode 100644 index c2d76b1..0000000 --- a/Gestor.Common/Gestor.Common.Security/Token.cs +++ /dev/null @@ -1,148 +0,0 @@ -using Gestor.Common.Helpers; -using System; -using System.IO; -using System.Security.Cryptography; -using System.Text; - -namespace Gestor.Common.Security -{ - public class Token - { - private readonly byte[] _key = new byte[] { 45, 103, 73, 146, 210, 184, 220, 224, 94, 3, 114, 60, 211, 119, 21, 100, 18, 201, 230, 195, 119, 252, 73, 208, 209, 39, 222, 48, 47, 142, 94, 24 }; - - private readonly byte[] _initializationVector = new byte[] { 95, 17, 151, 243, 209, 243, 119, 80, 63, 252, 13, 180, 162, 13, 23, 218 }; - - private readonly static byte[] Salt; - - static Token() - { - Token.Salt = new byte[] { 38, 220, 255, 0, 173, 237, 122, 238, 197, 254, 7, 175, 77, 8, 34, 60 }; - } - - public Token() - { - } - - public string AggerDecrypt(string cipher) - { - string str = string.Concat("aGG3r", Convert.ToString(1012), "#w3BDz$"); - byte[] numArray = Convert.FromBase64String(cipher); - Rijndael bytes = Rijndael.Create(); - Rfc2898DeriveBytes rfc2898DeriveByte = new Rfc2898DeriveBytes(str, Token.Salt); - bytes.Key = rfc2898DeriveByte.GetBytes(32); - bytes.IV = rfc2898DeriveByte.GetBytes(16); - MemoryStream memoryStream = new MemoryStream(); - CryptoStream cryptoStream = new CryptoStream(memoryStream, bytes.CreateDecryptor(), CryptoStreamMode.Write); - cryptoStream.Write(numArray, 0, (int)numArray.Length); - cryptoStream.Close(); - byte[] array = memoryStream.ToArray(); - return Encoding.UTF8.GetString(array); - } - - public string AggerEncrypt(string plain) - { - string str = string.Concat("aGG3r", Convert.ToString(1012), "#w3BDz$"); - byte[] bytes = Encoding.UTF8.GetBytes(plain); - Rijndael rijndael = Rijndael.Create(); - Rfc2898DeriveBytes rfc2898DeriveByte = new Rfc2898DeriveBytes(str, Token.Salt); - rijndael.Key = rfc2898DeriveByte.GetBytes(32); - rijndael.IV = rfc2898DeriveByte.GetBytes(16); - MemoryStream memoryStream = new MemoryStream(); - CryptoStream cryptoStream = new CryptoStream(memoryStream, rijndael.CreateEncryptor(), CryptoStreamMode.Write); - cryptoStream.Write(bytes, 0, (int)bytes.Length); - cryptoStream.Close(); - return Convert.ToBase64String(memoryStream.ToArray()); - } - - public string Decrypt(string plainText) - { - string end; - string str; - try - { - byte[] numArray = Convert.FromBase64String(plainText); - using (AesCryptoServiceProvider aesCryptoServiceProvider = new AesCryptoServiceProvider()) - { - ICryptoTransform cryptoTransform = aesCryptoServiceProvider.CreateDecryptor(this._key, this._initializationVector); - using (MemoryStream memoryStream = new MemoryStream(numArray)) - { - using (CryptoStream cryptoStream = new CryptoStream(memoryStream, cryptoTransform, CryptoStreamMode.Read)) - { - using (StreamReader streamReader = new StreamReader(cryptoStream)) - { - end = streamReader.ReadToEnd(); - } - } - } - } - str = end; - } - catch (Exception exception) - { - str = null; - } - return str; - } - - public bool DefaultDecryption(string ecryptedText) - { - return this.DefaultVerification(this.Decrypt(ecryptedText).Split(new char[] { ':' })); - } - - public string DefaultEncryption(long clientId, long providerId) - { - object obj = providerId; - DateTime universalTime = Functions.GetNetworkTime().ToUniversalTime(); - string str = string.Format("{0}:{1}", obj, universalTime.Ticks); - return this.Encrypt(str); - } - - public bool DefaultVerification(string[] textDecrypted) - { - if ((int)textDecrypted.Length < 2) - { - return false; - } - DateTime dateTime = new DateTime(long.Parse(textDecrypted[1]), DateTimeKind.Utc); - dateTime = dateTime.Date; - DateTime dateTime1 = dateTime.AddHours(5); - dateTime = Functions.GetNetworkTime().ToUniversalTime(); - return dateTime1 >= dateTime.Date; - } - - public string Encrypt(string plainText) - { - byte[] array; - using (AesCryptoServiceProvider aesCryptoServiceProvider = new AesCryptoServiceProvider()) - { - ICryptoTransform cryptoTransform = aesCryptoServiceProvider.CreateEncryptor(this._key, this._initializationVector); - using (MemoryStream memoryStream = new MemoryStream()) - { - using (CryptoStream cryptoStream = new CryptoStream(memoryStream, cryptoTransform, CryptoStreamMode.Write)) - { - using (StreamWriter streamWriter = new StreamWriter(cryptoStream)) - { - streamWriter.Write(plainText); - } - array = memoryStream.ToArray(); - } - } - } - return Convert.ToBase64String(array); - } - - public bool VerifyToken(string authHeader) - { - bool flag; - try - { - flag = (authHeader.Contains("Token") ? this.DefaultDecryption(authHeader.Replace("Token ", "")) : false); - } - catch (Exception exception) - { - flag = false; - } - return flag; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/SemValicao.cs b/Gestor.Common/Gestor.Common.Validation/SemValicao.cs deleted file mode 100644 index 7c6fde3..0000000 --- a/Gestor.Common/Gestor.Common.Validation/SemValicao.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class SemValicao : ValidationRule - { - public SemValicao() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - return ValidationResult.ValidResult; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoAno.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoAno.cs deleted file mode 100644 index ccdc82b..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoAno.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoAno : ValidationRule - { - public ValidacaoAno() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateAno()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Ano Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoAnoObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoAnoObrigatorio.cs deleted file mode 100644 index 5b6c947..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoAnoObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoAnoObrigatorio : ValidationRule - { - public ValidacaoAnoObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateAno()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Ano Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoCeiObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoCeiObrigatorio.cs deleted file mode 100644 index c2598d5..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoCeiObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoCeiObrigatorio : ValidationRule - { - public ValidacaoCeiObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateCei()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "CEI Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoCep.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoCep.cs deleted file mode 100644 index 1ef2a5e..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoCep.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoCep : ValidationRule - { - public ValidacaoCep() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidatePostCode()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "CEP Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoCepObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoCepObrigatorio.cs deleted file mode 100644 index 7f801fc..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoCepObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoCepObrigatorio : ValidationRule - { - public ValidacaoCepObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidatePostCode()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "CEP Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoChassi.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoChassi.cs deleted file mode 100644 index 5ec78c0..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoChassi.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoChassi : ValidationRule - { - public ValidacaoChassi() - { - } - - public override ValidationResult Validate(object chassiNumber, CultureInfo cultureInfo) - { - object obj = chassiNumber; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || chassiNumber.ToString().ValidateChassi()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Chassi Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoChassiObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoChassiObrigatorio.cs deleted file mode 100644 index a2e81ab..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoChassiObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoChassiObrigatorio : ValidationRule - { - public ValidacaoChassiObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateChassi()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Chassi Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoData.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoData.cs deleted file mode 100644 index 98b507a..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoData.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoData : ValidationRule - { - public ValidacaoData() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateDate()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Data Inválida"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataFutura.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoDataFutura.cs deleted file mode 100644 index 4180751..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataFutura.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoDataFutura : ValidationRule - { - public ValidacaoDataFutura() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateFutureDate()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Data Inválida"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataMaior.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoDataMaior.cs deleted file mode 100644 index 4345958..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataMaior.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoDataMaior : ValidationRule - { - public DateTime BaseDate - { - get; - set; - } - - public ValidacaoDataMaior() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if ((DateTime)value >= this.BaseDate) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Data Inválida"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataObrigatoria.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoDataObrigatoria.cs deleted file mode 100644 index 6a498dc..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataObrigatoria.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoDataObrigatoria : ValidationRule - { - public ValidacaoDataObrigatoria() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateDate()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Data Inválida"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataPassada.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoDataPassada.cs deleted file mode 100644 index cb22fb4..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataPassada.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoDataPassada : ValidationRule - { - public ValidacaoDataPassada() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidatePastDate()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Data Inválida"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataPassadaObrigatoria.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoDataPassadaObrigatoria.cs deleted file mode 100644 index f5fd4c8..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoDataPassadaObrigatoria.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoDataPassadaObrigatoria : ValidationRule - { - public ValidacaoDataPassadaObrigatoria() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidatePastDate()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Data Inválida"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoDocumento.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoDocumento.cs deleted file mode 100644 index 2f1a886..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoDocumento.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoDocumento : ValidationRule - { - public ValidacaoDocumento() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateDocument()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Documento Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoDocumentoObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoDocumentoObrigatorio.cs deleted file mode 100644 index 787942f..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoDocumentoObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoDocumentoObrigatorio : ValidationRule - { - public ValidacaoDocumentoObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateDocument()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Documento Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoDouble.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoDouble.cs deleted file mode 100644 index ce33724..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoDouble.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoDouble : ValidationRule - { - public ValidacaoDouble() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateDouble()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Valor Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoEmail.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoEmail.cs deleted file mode 100644 index 504fd63..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoEmail.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoEmail : ValidationRule - { - public ValidacaoEmail() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateMail()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "E-mail Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoEmailObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoEmailObrigatorio.cs deleted file mode 100644 index ab1a6ad..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoEmailObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoEmailObrigatorio : ValidationRule - { - public ValidacaoEmailObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateMail()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "E-mail Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoEstado.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoEstado.cs deleted file mode 100644 index de54bc8..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoEstado.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoEstado : ValidationRule - { - public ValidacaoEstado() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateState()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Estado Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoEstadoObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoEstadoObrigatorio.cs deleted file mode 100644 index 526327e..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoEstadoObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoEstadoObrigatorio : ValidationRule - { - public ValidacaoEstadoObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateState()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Estado Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoFipeObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoFipeObrigatorio.cs deleted file mode 100644 index a3547da..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoFipeObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoFipeObrigatorio : ValidationRule - { - public ValidacaoFipeObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateFipe()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "FIPE Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoInt.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoInt.cs deleted file mode 100644 index 551a95e..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoInt.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoInt : ValidationRule - { - public ValidacaoInt() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateInt()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Número Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoIntObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoIntObrigatorio.cs deleted file mode 100644 index c62cf85..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoIntObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoIntObrigatorio : ValidationRule - { - public ValidacaoIntObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateInt()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Número Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs deleted file mode 100644 index 042454d..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoLong : ValidationRule - { - public ValidacaoLong() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateLong()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Número Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoLongObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoLongObrigatorio.cs deleted file mode 100644 index fd4773b..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoLongObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoLongObrigatorio : ValidationRule - { - public ValidacaoLongObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateLong()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Número Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoObrigatorio.cs deleted file mode 100644 index 23eb517..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoObrigatorio.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoObrigatorio : ValidationRule - { - public ValidacaoObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (!string.IsNullOrWhiteSpace(obj.ToString())) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "OBRIGATÓRIO"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoOrgao.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoOrgao.cs deleted file mode 100644 index d2f3dd1..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoOrgao.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoOrgao : ValidationRule - { - public ValidacaoOrgao() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidateOrgao()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Orgão Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoPlaca.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoPlaca.cs deleted file mode 100644 index b1825e1..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoPlaca.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoPlaca : ValidationRule - { - public ValidacaoPlaca() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidatePlate()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Placa Inválida"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoPlacaObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoPlacaObrigatorio.cs deleted file mode 100644 index cd56924..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoPlacaObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoPlacaObrigatorio : ValidationRule - { - public ValidacaoPlacaObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidatePlate()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Placa Inválida"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoPrefixo.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoPrefixo.cs deleted file mode 100644 index 8b4197b..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoPrefixo.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoPrefixo : ValidationRule - { - public ValidacaoPrefixo() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidatePrefix()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "DDD Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoPrefixoObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoPrefixoObrigatorio.cs deleted file mode 100644 index 36f2157..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoPrefixoObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoPrefixoObrigatorio : ValidationRule - { - public ValidacaoPrefixoObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidatePrefix()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "DDD Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoRneObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoRneObrigatorio.cs deleted file mode 100644 index 5314ac6..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoRneObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoRneObrigatorio : ValidationRule - { - public ValidacaoRneObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateRne()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "RNE Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoTelefone.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoTelefone.cs deleted file mode 100644 index 1723d56..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoTelefone.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoTelefone : ValidationRule - { - public ValidacaoTelefone() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidatePhone()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Telefone Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoTelefoneObrigatorio.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoTelefoneObrigatorio.cs deleted file mode 100644 index 37f33c6..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoTelefoneObrigatorio.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoTelefoneObrigatorio : ValidationRule - { - public ValidacaoTelefoneObrigatorio() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidatePhone()) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Telefone Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoValorDiferenteZero.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoValorDiferenteZero.cs deleted file mode 100644 index f7f7aa3..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoValorDiferenteZero.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoValorDiferenteZero : ValidationRule - { - public ValidacaoValorDiferenteZero() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateDouble() && !((decimal)value == decimal.Zero)) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Valor Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs deleted file mode 100644 index 5ab3a4f..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidacaoValorMaiorQueZero.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Controls; - -namespace Gestor.Common.Validation -{ - public class ValidacaoValorMaiorQueZero : ValidationRule - { - public ValidacaoValorMaiorQueZero() - { - } - - public override ValidationResult Validate(object value, CultureInfo cultureInfo) - { - object obj = value; - if (obj == null) - { - obj = ""; - } - if (string.IsNullOrWhiteSpace(obj.ToString())) - { - return new ValidationResult(false, "Obrigatório"); - } - if (value.ToString().ValidateDouble() && !((decimal)value < new decimal(1, 0, 0, false, 2))) - { - return ValidationResult.ValidResult; - } - return new ValidationResult(false, "Valor Inválido"); - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.Validation/ValidationHelper.cs b/Gestor.Common/Gestor.Common.Validation/ValidationHelper.cs deleted file mode 100644 index 585565c..0000000 --- a/Gestor.Common/Gestor.Common.Validation/ValidationHelper.cs +++ /dev/null @@ -1,992 +0,0 @@ -using Gestor.Common.Helpers; -using Gestor.Model.Attributes; -using Gestor.Model.Helper; -using Microsoft.Win32; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; - -namespace Gestor.Common.Validation -{ - public static class ValidationHelper - { - public static void AddSorted(this ObservableCollection list, T item, IComparer comparer = null) - { - if (comparer == null) - { - comparer = Comparer.Default; - } - int num = 0; - while (num < list.Count && comparer.Compare(list[num], item) < 0) - { - num++; - } - list.Insert(num, item); - } - - public static int Age(this DateTime birthDate) - { - DateTime date = Functions.GetNetworkTime().Date; - int year = date.Year - birthDate.Year; - if (birthDate > date.AddYears(-year)) - { - year--; - } - return year; - } - - public static string Alphanumeric(this string stringToClean, string replaceWith = "") - { - return Regex.Replace(stringToClean, "[^a-zA-Z0-9]", replaceWith); - } - - public static string AlphanumericAndSpace(this string stringToClean) - { - return Regex.Replace(stringToClean, "[^a-zA-Z0-9 ]", string.Empty); - } - - public static string Captalize(this string text) - { - return (new CultureInfo("pt-Br", false)).TextInfo.ToTitleCase(text.ToLower()); - } - - public static string Clear(this string stringToClean) - { - if (stringToClean == null) - { - return null; - } - return Regex.Replace(stringToClean, "[^\\d]", string.Empty); - } - - public static string ClearCurrency(this string stringToClean) - { - if (string.IsNullOrEmpty(stringToClean)) - { - return string.Empty; - } - return Regex.Replace(stringToClean, "[^\\d\\,\\.]", string.Empty); - } - - public static bool ContainsAny(this string stringToCheck, params string[] stringArray) - { - return stringArray.Any(new Func(stringToCheck.Contains)); - } - - public static bool ContainsEquals(this T @this, params T[] possibles) - { - return possibles.Contains(@this); - } - - public static string DescriptionAttribute(this PropertyInfo pi) - { - object obj = pi.GetCustomAttributes(typeof(DescriptionAttribute), true).FirstOrDefault(); - if (obj == null) - { - return ""; - } - return ((DescriptionAttribute)obj).Description; - } - - public static string FormatarTelefone(this string number) - { - string str; - int? nullable; - if (number != null) - { - str = number.OnlyNumber(); - } - else - { - str = null; - } - number = str; - if (number != null) - { - nullable = new int?(number.Length); - } - else - { - nullable = null; - } - int? nullable1 = nullable; - if (nullable1.HasValue) - { - switch (nullable1.GetValueOrDefault()) - { - case 8: - { - return Convert.ToUInt64(number).ToString("0000\\-0000"); - } - case 9: - { - return Convert.ToUInt64(number).ToString("00000\\-0000"); - } - case 11: - { - return Convert.ToUInt64(number).ToString("0000 000 0000"); - } - } - } - return number.Clear(); - } - - public static string FormatCi(this string value) - { - long num; - string str = value.OnlyNumber().Trim(); - if (string.IsNullOrEmpty(str)) - { - return string.Empty; - } - if (!long.TryParse(str, out num)) - { - return str; - } - return Convert.ToUInt64(str).ToString("00\\.000\\.000\\.000\\.000"); - } - - public static string FormatCompetencia(this string date) - { - if (string.IsNullOrEmpty(date)) - { - return ""; - } - date = date.OnlyNumber(); - switch (date.Length) - { - case 2: - { - int year = Functions.GetNetworkTime().Date.Year; - date = string.Concat(date, year.ToString()); - return Convert.ToUInt64(date).ToString("00\\/0000"); - } - case 3: - case 5: - { - return date; - } - case 4: - { - return Convert.ToUInt64(date).ToString("00\\/00"); - } - case 6: - { - return Convert.ToUInt64(date).ToString("00\\/0000"); - } - default: - { - return date; - } - } - } - - public static string FormatCurrency(this string value) - { - if (string.IsNullOrEmpty(value)) - { - return ""; - } - return value.ToCurrency("pt-BR").ToString("c"); - } - - public static string FormatDate(this string date) - { - if (string.IsNullOrEmpty(date)) - { - return ""; - } - date = date.OnlyNumber(); - switch (date.Length) - { - case 4: - { - int year = Functions.GetNetworkTime().Date.Year; - date = string.Concat(date, year.ToString()); - return Convert.ToUInt64(date).ToString("00\\/00\\/0000"); - } - case 5: - case 7: - { - return date; - } - case 6: - { - return Convert.ToUInt64(date).ToString("00\\/00\\/00"); - } - case 8: - { - return Convert.ToUInt64(date).ToString("00\\/00\\/0000"); - } - default: - { - return date; - } - } - } - - public static string FormatDocument(this string number) - { - number = number.OnlyNumber(); - int length = number.Length; - if (length == 11) - { - return Convert.ToUInt64(number).ToString("000\\.000\\.000\\-00"); - } - if (length != 14) - { - return number; - } - return Convert.ToUInt64(number).ToString("00\\.000\\.000\\/0000\\-00"); - } - - public static string FormatFipe(this string value) - { - if (string.IsNullOrEmpty(value)) - { - return ""; - } - ulong num = Convert.ToUInt64(value.OnlyNumber()); - return num.ToString("000000\\-0"); - } - - public static string FormatPostCode(this string postCode) - { - if (string.IsNullOrEmpty(postCode)) - { - return ""; - } - return postCode.FormataCep(); - } - - public static string FormatRegiao(this string str) - { - if (Regex.Match(str, "[^0-9-.]").Success) - { - return str; - } - if (string.IsNullOrEmpty(str)) - { - return ""; - } - ulong num = Convert.ToUInt64(str.OnlyNumber()); - return num.ToString("00\\.000\\-000"); - } - - public static string FormatRenavam(this string value) - { - long num; - if (string.IsNullOrEmpty(value)) - { - return string.Empty; - } - if (!long.TryParse(value.OnlyNumber(), out num)) - { - return string.Empty; - } - return num.ToString("00\\.000\\.000\\.000"); - } - - public static string FormatTime(this string time) - { - if (string.IsNullOrEmpty(time)) - { - return null; - } - time = time.OnlyNumber(); - int length = time.Length; - if (length == 3) - { - return Convert.ToUInt64(time).ToString("00:00"); - } - if (length != 4) - { - return null; - } - return Convert.ToUInt64(time).ToString("00:00"); - } - - public static string GetCategory(this Enum genericEnum) - { - MemberInfo[] member = genericEnum.GetType().GetMember(genericEnum.ToString()); - if (member.Length == 0) - { - return genericEnum.ToString(); - } - object[] customAttributes = member[0].GetCustomAttributes(typeof(CategoryAttribute), false); - if (!customAttributes.Any()) - { - return genericEnum.ToString(); - } - return ((CategoryAttribute)customAttributes.ElementAt(0)).Category; - } - - public static string GetDefaultExtension(this string mimeType) - { - object value; - RegistryKey registryKey = Registry.ClassesRoot.OpenSubKey(string.Concat("MIME\\Database\\Content Type\\", mimeType), false); - if (registryKey != null) - { - value = registryKey.GetValue("Extension", null); - } - else - { - value = null; - } - object obj = value; - if (obj != null) - { - return obj.ToString(); - } - return string.Join(string.Empty, mimeType.Split(Path.GetInvalidPathChars())).Replace("/", "."); - } - - public static string GetDescription(this Enum genericEnum) - { - if (genericEnum == null) - { - return ""; - } - MemberInfo[] member = genericEnum.GetType().GetMember(genericEnum.ToString()); - if (member.Length == 0) - { - return genericEnum.ToString(); - } - object[] customAttributes = member[0].GetCustomAttributes(typeof(DescriptionAttribute), false); - if (!customAttributes.Any()) - { - return genericEnum.ToString().Trim(); - } - return ((DescriptionAttribute)customAttributes.ElementAt(0)).Description.Trim(); - } - - public static string GetEntity(this Enum genericEnum) - { - MemberInfo[] member = genericEnum.GetType().GetMember(genericEnum.ToString()); - if (member.Length == 0) - { - return genericEnum.ToString(); - } - object[] customAttributes = member[0].GetCustomAttributes(typeof(EntityAttribute), false); - if (!customAttributes.Any()) - { - return genericEnum.ToString(); - } - return ((EntityAttribute)customAttributes.ElementAt(0)).Description; - } - - public static T GetEnumFromDescription(string description) - { - Type type = typeof(T); - if (!type.IsEnum) - { - throw new InvalidOperationException(); - } - FieldInfo[] fields = type.GetFields(); - for (int i = 0; i < (int)fields.Length; i++) - { - FieldInfo fieldInfo = fields[i]; - DescriptionAttribute customAttribute = Attribute.GetCustomAttribute(fieldInfo, typeof(DescriptionAttribute)) as DescriptionAttribute; - if (customAttribute != null) - { - if (customAttribute.Description == description) - { - return (T)fieldInfo.GetValue(null); - } - } - else if (fieldInfo.Name == description) - { - return (T)fieldInfo.GetValue(null); - } - } - throw new ArgumentException("Not found.", "description"); - } - - public static T GetEnumFromEntity(this string entityName) - { - T t; - Type type = typeof(T); - if (!type.IsEnum) - { - t = default(T); - return t; - } - FieldInfo[] fields = type.GetFields(); - for (int i = 0; i < (int)fields.Length; i++) - { - FieldInfo fieldInfo = fields[i]; - EntityAttribute customAttribute = Attribute.GetCustomAttribute(fieldInfo, typeof(EntityAttribute)) as EntityAttribute; - if (customAttribute != null) - { - if (customAttribute.Description == entityName) - { - return (T)fieldInfo.GetValue(null); - } - } - else if (fieldInfo.Name == entityName) - { - return (T)fieldInfo.GetValue(null); - } - } - t = default(T); - return t; - } - - public static string GetHelp(this Enum genericEnum) - { - MemberInfo[] member = genericEnum.GetType().GetMember(genericEnum.ToString()); - if (member.Length == 0) - { - return genericEnum.ToString(); - } - object[] customAttributes = member[0].GetCustomAttributes(typeof(HelpAttribute), false); - if (!customAttributes.Any()) - { - return genericEnum.ToString(); - } - return ((HelpAttribute)customAttributes.ElementAt(0)).Description; - } - - public static string GetTipo(this Enum genericEnum) - { - MemberInfo[] member = genericEnum.GetType().GetMember(genericEnum.ToString()); - if (member.Length == 0) - { - return genericEnum.ToString(); - } - object[] customAttributes = member[0].GetCustomAttributes(typeof(TipoAttribute), false); - if (!customAttributes.Any()) - { - return genericEnum.ToString(); - } - return ((TipoAttribute)customAttributes.ElementAt(0)).Description; - } - - public static bool IsNotNullOrEmpty(this string stringToVerify) - { - return !string.IsNullOrEmpty(stringToVerify); - } - - public static bool IsNullOrEmpty(this string stringToVerify) - { - return string.IsNullOrEmpty(stringToVerify); - } - - public static string Join(this IEnumerable stringValues, string separator) - { - return string.Join(separator, stringValues); - } - - public static string Length(this string stringValue, int maxLength) - { - if (stringValue.Length <= maxLength) - { - return stringValue; - } - return stringValue.Substring(0, maxLength); - } - - public static string Mask(this string value, string mask) - { - int num = mask.Count((char x) => x == '#'); - if (string.IsNullOrEmpty(value) || num != value.Length) - { - return string.Empty; - } - string empty = string.Empty; - int num1 = 0; - int num2 = 0; - for (int i = 0; i < mask.Length; i++) - { - if (mask[i] != '#') - { - empty = string.Concat(empty, string.Format("{0}{1}", value.Substring(num1, i - num1 - num2), mask[i])); - num1 = i - num2; - num2++; - } - } - empty = string.Concat(empty, value.Substring(num1, mask.Length - num1 - num2)); - return empty; - } - - public static string Normalized(this string word) - { - if (string.IsNullOrEmpty(word)) - { - return string.Empty; - } - return Encoding.ASCII.GetString(Encoding.GetEncoding("Cyrillic").GetBytes(word)).ToUpper().Trim(); - } - - public static string NormalizePath(this string fullFilename) - { - int i; - char[] invalidPathChars = Path.GetInvalidPathChars(); - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); - fullFilename = fullFilename.Replace("/", string.Empty); - string fileName = Path.GetFileName(fullFilename); - string directoryName = Path.GetDirectoryName(fullFilename); - char[] chrArray = invalidPathChars; - for (i = 0; i < (int)chrArray.Length; i++) - { - char chr = chrArray[i]; - directoryName = directoryName.Replace(chr.ToString(), string.Empty); - } - chrArray = invalidFileNameChars; - for (i = 0; i < (int)chrArray.Length; i++) - { - char chr1 = chrArray[i]; - fileName = fileName.Replace(chr1.ToString(), string.Empty); - } - return string.Concat(directoryName, "\\", fileName); - } - - public static bool NotEquals(this string obj, string value) - { - return !obj.Equals(value); - } - - public static string OnlyNumber(this string sentence) - { - if (sentence == null) - { - return null; - } - return (new Regex("[^\\d]")).Replace(sentence, ""); - } - - public static string RemoveDiacritics(this string stringWithAccents) - { - if (stringWithAccents == null) - { - return ""; - } - return Encoding.ASCII.GetString(Encoding.GetEncoding("Cyrillic").GetBytes(stringWithAccents)); - } - - public static string RemoverAcentos(this string text) - { - if (string.IsNullOrEmpty(text)) - { - return string.Empty; - } - return new string(( - from c in text.Normalize(NormalizationForm.FormD) - where char.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark - select c).ToArray()); - } - - public static string RemoveTag(this string stringWithTag) - { - return Regex.Replace(stringWithTag, "<(.|\\n)*?>", string.Empty); - } - - public static string StringValue(this decimal decimalValue) - { - return decimalValue.ToString("F", new CultureInfo("en-US")); - } - - public static string ToCurrency(this T currencyDecimal, string currentCulture = "pt-BR") - { - return string.Format(new CultureInfo(currentCulture), "{0:N2}", currencyDecimal); - } - - public static decimal ToCurrency(this string currencyString, string currentCulture = "pt-BR") - { - decimal num; - decimal.TryParse(currencyString.ClearCurrency(), NumberStyles.Any, new CultureInfo(currentCulture), out num); - return num; - } - - public static string ToCurrencyWithSymbol(this T currencyDecimal, string currentCulture = "pt-BR") - { - return string.Format(new CultureInfo(currentCulture), "R$ {0:N2}", currencyDecimal); - } - - public static DateTime ToDateTime(this string dateString) - { - DateTime dateTime; - DateTime.TryParse(dateString.Trim(), out dateTime); - return dateTime; - } - - public static DateTime? ToDateTimeNullable(this string dateString) - { - DateTime dateTime; - DateTime? nullable; - if (dateString == null) - { - nullable = null; - return nullable; - } - DateTime.TryParse(dateString.Trim(), out dateTime); - if (dateTime != DateTime.MinValue) - { - return new DateTime?(dateTime); - } - nullable = null; - return nullable; - } - - public static string ToFloating(this T currencyDecimal, string currentCulture = "pt-BR") - { - return string.Format(new CultureInfo(currentCulture), "{0:F}", currencyDecimal); - } - - public static int ToInt(this string stringValue) - { - int num; - int.TryParse(stringValue, out num); - return num; - } - - public static int? ToIntNullable(this string stringValue) - { - int num; - if (int.TryParse(stringValue, out num)) - { - return new int?(num); - } - return null; - } - - public static long ToLong(this string stringValue) - { - long num; - long.TryParse(stringValue, out num); - return num; - } - - public static long? ToLongNullable(this string stringValue) - { - long num; - if (long.TryParse(stringValue, out num)) - { - return new long?(num); - } - return null; - } - - public static string ToTitleCase(this string stringValue) - { - return Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(stringValue.ToLower()); - } - - public static string ToToken(this string postCode) - { - return Functions.GetNetworkTime().ToFileTime().ToString(); - } - - public static bool ValidaCep(this string cep) - { - if (!string.IsNullOrWhiteSpace(cep)) - { - return false; - } - return Regex.IsMatch(cep, "^\\d{5}-?\\d{3}$"); - } - - public static bool ValidateAno(this string ano) - { - int num; - if (!int.TryParse(ano, out num)) - { - return false; - } - return ano.Length == 4; - } - - public static bool ValidateAttendanceNumber(this string number) - { - if (number == null) - { - return false; - } - return Regex.Match(number, "^[0-9]").Success; - } - - public static bool ValidateCaepf(this string caepf) - { - return !string.IsNullOrEmpty(caepf); - } - - public static bool ValidateCei(this string cei) - { - if (string.IsNullOrEmpty(cei)) - { - return false; - } - cei = cei.Trim(); - cei = Regex.Replace(cei, "[^\\d]", ""); - if (cei.Length != 12) - { - return false; - } - int num = 0; - for (int i = 1; i < 12; i++) - { - int num1 = Convert.ToInt32("74185216374".Substring(i - 1, 1)); - int num2 = Convert.ToInt32(cei.Substring(i - 1, 1)); - num = num + num1 * num2; - } - int num3 = num / 10; - int num4 = num - num / 10 * 10; - num = num3 + num4; - num4 = num - num / 10 * 10; - int num5 = 10 - num4; - return Convert.ToInt32(cei.Substring(11, 1)) == num5; - } - - public static bool ValidateChassi(this string chassiNumber) - { - string upper; - if (chassiNumber != null) - { - upper = chassiNumber.ToUpper(); - } - else - { - upper = null; - } - chassiNumber = upper; - if (string.IsNullOrEmpty(chassiNumber)) - { - return true; - } - if (chassiNumber.Length != 17 || Regex.IsMatch(chassiNumber, "^0| |^.{4,}([0-9A-Z])\\1{5,}|[iIoOqQ]")) - { - return false; - } - return Regex.IsMatch(chassiNumber, "[0-9]{4}$"); - } - - public static bool ValidateDate(this string birthday) - { - DateTime dateTime; - return DateTime.TryParse(birthday, out dateTime); - } - - public static bool ValidateDecimal(this string value) - { - decimal num; - return decimal.TryParse(value, out num); - } - - public static bool ValidateDocument(this string cpfCnpj) - { - int j; - int i; - int num; - if (string.IsNullOrEmpty(cpfCnpj)) - { - return false; - } - string str = cpfCnpj.Clear(); - int[] numArray = new int[14]; - int[] numArray1 = new int[2]; - if (str == string.Empty || new string(str[0], str.Length) == str) - { - return false; - } - if (str.Length == 11) - { - for (i = 0; i <= 10; i++) - { - numArray[i] = Convert.ToInt32(str.Substring(i, 1)); - } - for (i = 0; i <= 1; i++) - { - num = 0; - for (j = 0; j <= 8 + i; j++) - { - num = num + numArray[j] * (10 + i - j); - } - numArray1[i] = num * 10 % 11; - if (numArray1[i] == 10) - { - numArray1[i] = 0; - } - } - return numArray1[0] == numArray[9] & numArray1[1] == numArray[10]; - } - if (str.Length != 14) - { - return false; - } - for (i = 0; i <= 13; i++) - { - numArray[i] = Convert.ToInt32(str.Substring(i, 1)); - } - for (i = 0; i <= 1; i++) - { - num = 0; - for (j = 0; j <= 11 + i; j++) - { - num = num + numArray[j] * Convert.ToInt32("6543298765432".Substring(j + 1 - i, 1)); - } - numArray1[i] = num * 10 % 11; - if (numArray1[i] == 10) - { - numArray1[i] = 0; - } - } - return numArray1[0] == numArray[12] & numArray1[1] == numArray[13]; - } - - public static bool ValidateDouble(this string number) - { - double num; - return double.TryParse(number, out num); - } - - public static bool ValidateFipe(this string value) - { - if ((new Regex("^\\d{6}\\-\\d{1}$")).IsMatch(value)) - { - return true; - } - return false; - } - - public static bool ValidateFutureDate(this string birthday) - { - DateTime dateTime; - if (!DateTime.TryParse(birthday, out dateTime)) - { - return false; - } - return dateTime > Functions.GetNetworkTime().Date; - } - - public static bool ValidateInt(this string value) - { - int num; - return int.TryParse(value, out num); - } - - public static bool ValidateLong(this string value) - { - long num; - return long.TryParse(value, out num); - } - - public static bool ValidateMail(this string mail) - { - if (mail == null) - { - return false; - } - return (new Regex("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")).IsMatch(mail); - } - - public static bool ValidateOrgao(this string orgao) - { - if (string.IsNullOrEmpty(orgao)) - { - return false; - } - return (new string[] { "SSP", "DETRAN", "ABNC", "CGPI", "DUREX", "DPF", "CGPI", "CGPMAF", "CNIG", "CNT", "COREN", "CORECON", "CRA", "CRAS", "CRB", "CRC", "CRE", "CREA", "CRECI", "CREFIT", "CRESS", "CRF", "CRM", "CRN", "CRO", "CRP", "CRPRE", "CRQ", "CRRC", "CRMV", "CSC", "CTPS", "DIC", "DIREX", "DPMAF", "DPT", "DST", "FGTS", "FIPE", "FLS", "GOVGO", "I CLA", "IFP", "IGP", "IICCECF/RO", "IIMG", "IML", "IPC", "IPF", "MAE", "MEX", "MMA", "OAB", "OMB", "PCMG", "PMMG", "POM", "SDS", "SNJ", "SECC", "SEJUSP", "SES", "EST", "SESP", "SJS", "SJTC", "SJTS", "SPTC", "DGPC", "" }).Contains(orgao.ToUpper()); - } - - public static bool ValidatePastDate(this string birthday) - { - DateTime dateTime; - if (!DateTime.TryParse(birthday, out dateTime)) - { - return false; - } - return dateTime < Functions.GetNetworkTime().Date; - } - - public static bool ValidatePhone(this string number) - { - if (number == null) - { - return false; - } - return Regex.Match(number, "^([2-9][0-9]{3,4})\\-([0-9]{4})$").Success; - } - - public static bool ValidatePlate(this string plateNumber) - { - string str; - if (plateNumber != null) - { - str = plateNumber.Alphanumeric(""); - } - else - { - str = null; - } - if (string.IsNullOrEmpty(str)) - { - return true; - } - return Regex.IsMatch(plateNumber, "^[a-zA-Z]{3}-?[0-9]{4}$"); - } - - public static bool ValidatePostCode(this string postCode) - { - if (postCode == null) - { - return false; - } - return Regex.Match(postCode, "^[0-9]{2}.?[0-9]{3}-[0-9]{3}$").Success; - } - - public static bool ValidatePrefix(this string prefix) - { - int num; - if (!int.TryParse(prefix, out num)) - { - return false; - } - if (num != 20 && num != 23 && num != 25 && num != 26 && num != 29 && num != 30 && num != 36 && num != 39 && num != 40 && num != 50 && num != 52 && num != 56 && num != 57 && num != 58 && num != 59 && num != 60 && num != 70 && num != 72 && num != 76 && num != 78 && num != 80 && num != 90 && num >= 11 && num <= 99) - { - return true; - } - return false; - } - - public static bool ValidateRne(this string rne) - { - if (string.IsNullOrEmpty(rne)) - { - return false; - } - return true; - } - - public static bool ValidateState(this string state) - { - if (string.IsNullOrEmpty(state)) - { - return false; - } - return (new string[] { "AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO" }).Contains(state.ToUpper()); - } - - public static bool ValidateValor(this string value) - { - string[] strArrays = value.Split(new char[] { '.' }); - if ((int)strArrays.Length < 2) - { - return true; - } - if ((int)strArrays.Length != 2) - { - return false; - } - return strArrays[1].Length <= 2; - } - } -} \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.csproj b/Gestor.Common/Gestor.Common.csproj deleted file mode 100644 index c6a309d..0000000 --- a/Gestor.Common/Gestor.Common.csproj +++ /dev/null @@ -1,490 +0,0 @@ - - - - {AF38021A-3584-40B5-88EF-4742A4C443F5} - Debug - AnyCPU - Gestor.Common - Library - v4.8 - - - bin\Debug\ - true - DEBUG;TRACE - false - 4 - full - prompt - AnyCPU - - - bin\Release\ - false - TRACE - true - 4 - pdbonly - prompt - AnyCPU - - - - - - .\Gestor.CommonReferences\Gestor.Model.dll - - - - - - - - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - false - false - - - - \ No newline at end of file diff --git a/Gestor.Common/Gestor.Common.sln b/Gestor.Common/Gestor.Common.sln deleted file mode 100644 index f22689d..0000000 --- a/Gestor.Common/Gestor.Common.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29728.190 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gestor.Common", "Gestor.Common.csproj", "{AF38021A-3584-40B5-88EF-4742A4C443F5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AF38021A-3584-40B5-88EF-4742A4C443F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF38021A-3584-40B5-88EF-4742A4C443F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF38021A-3584-40B5-88EF-4742A4C443F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF38021A-3584-40B5-88EF-4742A4C443F5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Gestor.Common/Gestor.CommonReferences/Gestor.Model.dll b/Gestor.Common/Gestor.CommonReferences/Gestor.Model.dll deleted file mode 100644 index 2b2b2d0..0000000 Binary files a/Gestor.Common/Gestor.CommonReferences/Gestor.Model.dll and /dev/null differ diff --git a/Gestor.Common/Properties/AssemblyInfo.cs b/Gestor.Common/Properties/AssemblyInfo.cs deleted file mode 100644 index 4107ae2..0000000 --- a/Gestor.Common/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Diagnostics; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Versioning; - -[assembly: AssemblyCompany("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyFileVersion("8.4.0.0")] -[assembly: AssemblyProduct("Gestor.Common")] -[assembly: AssemblyTitle("Gestor.Common")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: CompilationRelaxations(8)] -[assembly: ComVisible(false)] -[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: Guid("73d1cb17-a0c5-4e22-884f-171c125d27bc")] -[assembly: RuntimeCompatibility(WrapNonExceptionThrows=true)] -- cgit v1.2.3