diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 15:29:41 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 15:29:41 +0000 |
| commit | 225aa1499e37faf9d38257caabbadc68d78b427e (patch) | |
| tree | 102bb7a40c58595348ae9d3c7076201759fe0720 /Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs | |
| parent | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff) | |
| download | gestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip | |
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs')
| -rw-r--r-- | Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs | 351 |
1 files changed, 351 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs new file mode 100644 index 0000000..6d45419 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.Ferramentas/RamoView.cs @@ -0,0 +1,351 @@ +using System; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Threading; +using CurrencyTextBoxControl; +using Gestor.Application.Drawers; +using Gestor.Application.Helpers; +using Gestor.Application.ViewModels.Ferramentas; +using Gestor.Application.Views.Generic; +using Gestor.Common.Validation; +using Gestor.Model.Common; +using Gestor.Model.Domain.Configuracoes; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; + +namespace Gestor.Application.Views.Ferramentas; + +public class RamoView : BaseUserControl, IComponentConnector +{ + [Serializable] + [CompilerGenerated] + private sealed class _003C_003Ec + { + public static readonly _003C_003Ec _003C_003E9 = new _003C_003Ec(); + + public static MouseButtonEventHandler _003C_003E9__5_0; + + public static MouseButtonEventHandler _003C_003E9__5_1; + + public static Func<ConfiguracaoSistema, bool> _003C_003E9__16_0; + + internal void _003CContentLoad_003Eb__5_0(object sender, MouseButtonEventArgs args) + { + } + + internal void _003CContentLoad_003Eb__5_1(object sender, MouseButtonEventArgs args) + { + } + + internal bool _003CImpostos_OnClick_003Eb__16_0(ConfiguracaoSistema x) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0007: Invalid comparison between Unknown and I4 + return (int)x.Configuracao != 5; + } + } + + internal DataGrid RamoGrid; + + internal MenuItem MaisOpcoesButton; + + internal TextBox ApoliceBox; + + internal CurrencyTextBox IofBox; + + internal DataGrid CoberturaGrid; + + private bool _contentLoaded; + + public RamoViewModel ViewModel { get; set; } + + public RamoView() + { + ((FrameworkElement)this).Tag = "RAMOS"; + ViewModel = new RamoViewModel(); + ((FrameworkElement)this).DataContext = ViewModel; + InitializeComponent(); + Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher; + if (dispatcher != null) + { + dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad)); + } + ((FrameworkElement)RamoGrid).DataContext = ((FrameworkElement)this).DataContext; + ((FrameworkElement)CoberturaGrid).DataContext = ((FrameworkElement)this).DataContext; + } + + private void ContentLoad() + { + //IL_0019: Unknown result type (might be due to invalid IL or missing references) + //IL_0023: Expected O, but got Unknown + //IL_003d: Unknown result type (might be due to invalid IL or missing references) + //IL_0042: Unknown result type (might be due to invalid IL or missing references) + //IL_0048: Expected O, but got Unknown + //IL_0067: Unknown result type (might be due to invalid IL or missing references) + //IL_006c: Unknown result type (might be due to invalid IL or missing references) + //IL_0072: Expected O, but got Unknown + ((Selector)RamoGrid).SelectedIndex = 0; + ((Selector)RamoGrid).SelectionChanged += new SelectionChangedEventHandler(RamoGrid_OnSelectionChanged); + DataGrid ramoGrid = RamoGrid; + object obj = _003C_003Ec._003C_003E9__5_0; + if (obj == null) + { + MouseButtonEventHandler val = delegate + { + }; + _003C_003Ec._003C_003E9__5_0 = val; + obj = (object)val; + } + ((Control)ramoGrid).MouseDoubleClick += (MouseButtonEventHandler)obj; + DataGrid coberturaGrid = CoberturaGrid; + object obj2 = _003C_003Ec._003C_003E9__5_1; + if (obj2 == null) + { + MouseButtonEventHandler val2 = delegate + { + }; + _003C_003Ec._003C_003E9__5_1 = val2; + obj2 = (object)val2; + } + ((Control)coberturaGrid).MouseDoubleClick += (MouseButtonEventHandler)obj2; + } + + private async void Salvar_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.Loading(isLoading: true); + List<KeyValuePair<string, string>> list = await ViewModel.Salvar(); + ((DependencyObject)(object)this).ValidateFields(list); + bool num = list == null || list.Count == 0; + ViewModel.Loading(isLoading: false); + if (!num) + { + await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK"); + } + } + + private void Cancelar_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.CancelarAlteracao(); + } + + private void AutoCompleteBoxRamo_Populating(object sender, PopulatingEventArgs e) + { + e.Cancel = true; + ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Ramo>> searchResult) + { + //IL_000f: Unknown result type (might be due to invalid IL or missing references) + //IL_0014: Unknown result type (might be due to invalid IL or missing references) + if (searchResult.Result != null) + { + AutoCompleteBox val = (AutoCompleteBox)sender; + val.ItemsSource = searchResult.Result; + val.PopulateComplete(); + } + }, TaskScheduler.FromCurrentSynchronizationContext()); + } + + private void AutoCompleteBoxCobertura_Populating(object sender, PopulatingEventArgs e) + { + e.Cancel = true; + ViewModel.FiltrarCobertura(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<CoberturaPadrao>> searchResult) + { + //IL_000f: Unknown result type (might be due to invalid IL or missing references) + //IL_0014: Unknown result type (might be due to invalid IL or missing references) + if (searchResult.Result != null) + { + AutoCompleteBox val = (AutoCompleteBox)sender; + val.ItemsSource = searchResult.Result; + val.PopulateComplete(); + } + }, TaskScheduler.FromCurrentSynchronizationContext()); + } + + private void AutoCompleteBox_OnTextChanged(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + if (string.IsNullOrWhiteSpace(((AutoCompleteBox)sender).Text)) + { + ViewModel.FiltrarRamo(""); + } + } + + private void AutoCompleteBoxCobertura_OnTextChanged(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + if (string.IsNullOrWhiteSpace(((AutoCompleteBox)sender).Text)) + { + ViewModel.FiltrarCoberturaRamo(""); + } + } + + private void Alterar_OnClick(object sender, RoutedEventArgs e) + { + //IL_0016: Unknown result type (might be due to invalid IL or missing references) + //IL_0020: Expected O, but got Unknown + ViewModel.CancelRamo = (Ramo)((DomainBase)ViewModel.SelectedRamo).Clone(); + ViewModel.Alterar(alterar: true); + } + + private void RamoGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0007: Expected O, but got Unknown + //IL_0031: Unknown result type (might be due to invalid IL or missing references) + //IL_003b: Expected O, but got Unknown + DataGrid val = (DataGrid)sender; + if (val == null || ((Selector)val).SelectedIndex >= 0) + { + ViewModel.SelecionaRamo((Ramo)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null)); + } + } + + private void AbrirLog_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AbrirLog((TipoTela)12, ((DomainBase)ViewModel.SelectedRamo).Id); + } + + private void Incluir_OnClick(object sender, RoutedEventArgs e) + { + IncluirRamoView incluirRamoView = new IncluirRamoView(ViewModel.Ramos); + ((Window)new HosterWindow((ContentControl)(object)incluirRamoView, "INCLUIR RAMO", 500.0, 600.0)).ShowDialog(); + if (incluirRamoView.ViewModel.AdicionarRamo != null) + { + ViewModel.Incluir(incluirRamoView.ViewModel.AdicionarRamo); + } + } + + private async void Impostos_OnClick(object sender, RoutedEventArgs e) + { + if (Recursos.Configuracoes.All((ConfiguracaoSistema x) => (int)x.Configuracao != 5)) + { + await ViewModel.ShowMessage("RECURSO NÃO HABILITADO, ACESSE AS CONFIGURAÇÕES DENTRO DO CADASTRO DE EMPRESAS E FILIAIS PARA HABILITAR O RECURSO."); + } + else if (await ViewModel.VerificarPermissao((TipoTela)56)) + { + ViewModel.ShowDrawer(new ImpostoDrawer(1, ((DomainBase)ViewModel.SelectedRamo).Id), 0, close: false); + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/ramoview.xaml", UriKind.Relative); + Application.LoadComponent((object)this, uri); + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + internal Delegate _CreateDelegate(Type delegateType, string handler) + { + return Delegate.CreateDelegate(delegateType, this, handler); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IComponentConnector.Connect(int connectionId, object target) + { + //IL_0042: Unknown result type (might be due to invalid IL or missing references) + //IL_004e: Unknown result type (might be due to invalid IL or missing references) + //IL_0058: Expected O, but got Unknown + //IL_0059: Unknown result type (might be due to invalid IL or missing references) + //IL_0065: Unknown result type (might be due to invalid IL or missing references) + //IL_006f: Expected O, but got Unknown + //IL_0072: Unknown result type (might be due to invalid IL or missing references) + //IL_007c: Expected O, but got Unknown + //IL_007e: Unknown result type (might be due to invalid IL or missing references) + //IL_008a: Unknown result type (might be due to invalid IL or missing references) + //IL_0094: Expected O, but got Unknown + //IL_0096: Unknown result type (might be due to invalid IL or missing references) + //IL_00a2: Unknown result type (might be due to invalid IL or missing references) + //IL_00ac: Expected O, but got Unknown + //IL_00ae: Unknown result type (might be due to invalid IL or missing references) + //IL_00ba: Unknown result type (might be due to invalid IL or missing references) + //IL_00c4: Expected O, but got Unknown + //IL_00c6: Unknown result type (might be due to invalid IL or missing references) + //IL_00d2: Unknown result type (might be due to invalid IL or missing references) + //IL_00dc: Expected O, but got Unknown + //IL_00df: Unknown result type (might be due to invalid IL or missing references) + //IL_00e9: Expected O, but got Unknown + //IL_00eb: Unknown result type (might be due to invalid IL or missing references) + //IL_00f7: Unknown result type (might be due to invalid IL or missing references) + //IL_0101: Expected O, but got Unknown + //IL_0103: Unknown result type (might be due to invalid IL or missing references) + //IL_010f: Unknown result type (might be due to invalid IL or missing references) + //IL_0119: Expected O, but got Unknown + //IL_011c: Unknown result type (might be due to invalid IL or missing references) + //IL_0126: Expected O, but got Unknown + //IL_0129: Unknown result type (might be due to invalid IL or missing references) + //IL_0133: Expected O, but got Unknown + //IL_0135: Unknown result type (might be due to invalid IL or missing references) + //IL_0141: Unknown result type (might be due to invalid IL or missing references) + //IL_014b: Expected O, but got Unknown + //IL_014c: Unknown result type (might be due to invalid IL or missing references) + //IL_0158: Unknown result type (might be due to invalid IL or missing references) + //IL_0162: Expected O, but got Unknown + //IL_0165: Unknown result type (might be due to invalid IL or missing references) + //IL_016f: Expected O, but got Unknown + switch (connectionId) + { + case 1: + ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxRamo_Populating); + ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged); + break; + case 2: + RamoGrid = (DataGrid)target; + break; + case 3: + ((MenuItem)target).Click += new RoutedEventHandler(Incluir_OnClick); + break; + case 4: + ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick); + break; + case 5: + ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick); + break; + case 6: + ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick); + break; + case 7: + MaisOpcoesButton = (MenuItem)target; + break; + case 8: + ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick); + break; + case 9: + ((MenuItem)target).Click += new RoutedEventHandler(Impostos_OnClick); + break; + case 10: + ApoliceBox = (TextBox)target; + break; + case 11: + IofBox = (CurrencyTextBox)target; + break; + case 12: + ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxCobertura_Populating); + ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBoxCobertura_OnTextChanged); + break; + case 13: + CoberturaGrid = (DataGrid)target; + break; + default: + _contentLoaded = true; + break; + } + } +} |