From 674ca83ba9243a9e95a7568c797668dab6aee26a Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:35:25 -0300 Subject: feat: upload files --- .../Converters/EmpresaNomeConverter.cs | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Gestor.Application/Converters/EmpresaNomeConverter.cs (limited to 'Gestor.Application/Converters/EmpresaNomeConverter.cs') diff --git a/Gestor.Application/Converters/EmpresaNomeConverter.cs b/Gestor.Application/Converters/EmpresaNomeConverter.cs new file mode 100644 index 0000000..54ceb4c --- /dev/null +++ b/Gestor.Application/Converters/EmpresaNomeConverter.cs @@ -0,0 +1,38 @@ +using Gestor.Application.Helpers; +using Gestor.Model.Domain.Common; +using Gestor.Model.Domain.Generic; +using System; +using System.Globalization; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Windows.Data; +using System.Windows.Markup; + +namespace Gestor.Application.Converters +{ + public class EmpresaNomeConverter : MarkupExtension, IValueConverter + { + public EmpresaNomeConverter() + { + } + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null && (long)value != 0) + { + return Recursos.Empresas.First((Empresa x) => x.get_Id() == (long)value).get_Nome(); + } + return Recursos.Empresas.First((Empresa x) => x.get_Id() == (long)1).get_Nome(); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return null; + } + + public override object ProvideValue(IServiceProvider serviceProvider) + { + return this; + } + } +} \ No newline at end of file -- cgit v1.2.3