From 225aa1499e37faf9d38257caabbadc68d78b427e Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 12:29:41 -0300 Subject: decompiler.com --- .../DialogPrintViewModel.cs | 176 +++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 Decompiler/Gestor.Application.ViewModels.Relatorios/DialogPrintViewModel.cs (limited to 'Decompiler/Gestor.Application.ViewModels.Relatorios/DialogPrintViewModel.cs') diff --git a/Decompiler/Gestor.Application.ViewModels.Relatorios/DialogPrintViewModel.cs b/Decompiler/Gestor.Application.ViewModels.Relatorios/DialogPrintViewModel.cs new file mode 100644 index 0000000..859ee64 --- /dev/null +++ b/Decompiler/Gestor.Application.ViewModels.Relatorios/DialogPrintViewModel.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; +using Gestor.Application.Helpers; +using Gestor.Application.Servicos.Configuracoes; +using Gestor.Application.ViewModels.Generic; +using Gestor.Model.Common; +using Gestor.Model.Domain.Relatorios; + +namespace Gestor.Application.ViewModels.Relatorios; + +public class DialogPrintViewModel : BaseViewModel +{ + private bool _carregando; + + private ConfiguracaoImpressao _configuracoes; + + private List _tamanhos = new List { "GRANDE", "MÉDIO", "PEQUENO" }; + + private bool _orientacaoImpressaoPortrait; + + private bool _orientacaoImpressaoLandscape; + + private string _tamanhoFonte = "PEQUENO"; + + private Relatorio _relatorio { get; set; } + + private Type _tipo { get; set; } + + public bool Carregando + { + get + { + return _carregando; + } + set + { + _carregando = value; + OnPropertyChanged("Carregando"); + } + } + + public ConfiguracaoImpressao Configuracoes + { + get + { + return _configuracoes; + } + set + { + _configuracoes = value; + OnPropertyChanged("Configuracoes"); + } + } + + public List Tamanhos + { + get + { + return _tamanhos; + } + set + { + _tamanhos = value; + OnPropertyChanged("Tamanhos"); + } + } + + public bool OrientacaoImpressaoPortrait + { + get + { + return _orientacaoImpressaoPortrait; + } + set + { + _orientacaoImpressaoPortrait = value; + OnPropertyChanged("OrientacaoImpressaoPortrait"); + } + } + + public bool OrientacaoImpressaoLandscape + { + get + { + return _orientacaoImpressaoLandscape; + } + set + { + _orientacaoImpressaoLandscape = value; + OnPropertyChanged("OrientacaoImpressaoLandscape"); + } + } + + public bool OrientacaoImpressao { get; set; } + + public string TamanhoFonte + { + get + { + return _tamanhoFonte; + } + set + { + _tamanhoFonte = value; + if (!(value == "MÉDIO")) + { + if (!(value == "GRANDE")) + { + Configuracoes.TamanhoFonte = 7; + } + else + { + Configuracoes.TamanhoFonte = 5; + } + } + else + { + Configuracoes.TamanhoFonte = 6; + } + OnPropertyChanged("TamanhoFonte"); + } + } + + public DialogPrintViewModel(Relatorio relatorio, Type tipo) + { + //IL_003e: Unknown result type (might be due to invalid IL or missing references) + _relatorio = relatorio; + _tipo = tipo; + } + + public async Task Carregar() + { + List list = await new ConfuguracoesServico().BuscarParametros(_relatorio); + if (list == null || list.Count == 0) + { + list = ((IEnumerable)_tipo.GetProperties(BindingFlags.Instance | BindingFlags.Public)).Select((Func)((PropertyInfo x) => new ParametrosRelatorio + { + Campo = x.Name, + Header = x.GetDescriptionAttribute(), + Tipo = x.GetTypeAttribute(), + Relatorio = _relatorio, + Width = 0, + Ordem = 0 + })).ToList(); + } + list.ForEach(delegate(ParametrosRelatorio x) + { + x.Selecionado = true; + }); + Configuracoes = new ConfiguracaoImpressao + { + TamanhoFonte = 7, + Campos = list, + OrientacaoImpressao = false + }; + } + + public void Selecionar() + { + if (Carregando) + { + return; + } + ConfiguracaoImpressao configuracoes = Configuracoes; + if (configuracoes != null) + { + configuracoes.Campos?.ForEach(delegate(ParametrosRelatorio x) + { + x.Selecionado = !x.Selecionado; + }); + } + } +} -- cgit v1.2.3