using System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; 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 Gestor.Application.Componentes; using Gestor.Application.ViewModels.Financeiro.Relatorios; using Gestor.Application.Views.Generic; using Gestor.Common.Validation; using Gestor.Model.Domain.Financeiro; using Gestor.Model.Domain.Financeiro.Relatorios; namespace Gestor.Application.Views.Financeiro.Relatorios; public class FechamentoFinanceiroView : BaseUserControl, IComponentConnector, IStyleConnector { public FechamentoFinanceiroViewModel ViewModel; internal ProgressBar ProgressRing; internal DatePicker InicioBox; internal DatePicker FimBox; internal WebEditor WebEditor; internal TextBlock NaoHaDados; private bool _contentLoaded; public FechamentoFinanceiroView() { ViewModel = new FechamentoFinanceiroViewModel(); ((FrameworkElement)this).DataContext = ViewModel; InitializeComponent(); Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher; if (dispatcher != null) { dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad)); } } private void ContentLoad() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown ((UIElement)InicioBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((UIElement)InicioBox).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown); InicioBox.SelectedDateChanged += Periodo_OnSelectedDateChanged; ((UIElement)FimBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((UIElement)FimBox).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown); FimBox.SelectedDateChanged += Periodo_OnSelectedDateChanged; } private void Periodo_OnSelectedDateChanged(object sender, SelectionChangedEventArgs e) { ViewModel.Fechamento = new List(); ViewModel.HtmlContent = string.Empty; WebEditor.Initialize(""); } private async void GerarResultados_OnClick(object sender, RoutedEventArgs e) { InicioBox.Text = ValidationHelper.FormatDate(InicioBox.Text); FimBox.Text = ValidationHelper.FormatDate(FimBox.Text); try { ViewModel.Inicio = Convert.ToDateTime(InicioBox.Text); ViewModel.Fim = Convert.ToDateTime(FimBox.Text); } catch (Exception) { return; } if (ViewModel.Inicio > ViewModel.Fim) { await ViewModel.ShowMessage("A DATA FINAL NÃO PODE SER MENOR QUE A DATA INICIAL DO FILTRO."); return; } ((UIElement)ProgressRing).Visibility = (Visibility)0; ViewModel.IsEnabled = false; ViewModel.HtmlContent = string.Empty; ViewModel.Fechamento = new List(); await ViewModel.GerarRelatorio(); if (ViewModel.HtmlContent == string.Empty) { ((UIElement)NaoHaDados).Visibility = (Visibility)0; ViewModel.IsEnabled = true; ((UIElement)ProgressRing).Visibility = (Visibility)2; } WebEditor.Initialize(ViewModel.HtmlContent); ((UIElement)NaoHaDados).Visibility = (Visibility)2; ViewModel.IsEnabled = true; ((UIElement)ProgressRing).Visibility = (Visibility)2; } private async void Imprimir_OnClick(object sender, RoutedEventArgs e) { ((UIElement)ProgressRing).Visibility = (Visibility)0; ViewModel.IsEnabled = false; await ViewModel.Print(); ((UIElement)ProgressRing).Visibility = (Visibility)2; ViewModel.IsEnabled = true; } private async void ExportarExcel_OnClick(object sender, RoutedEventArgs e) { ((UIElement)ProgressRing).Visibility = (Visibility)0; ViewModel.IsEnabled = false; await ViewModel.GerarExcel(); ((UIElement)ProgressRing).Visibility = (Visibility)2; ViewModel.IsEnabled = true; } private void CheckBox_Checked(object sender, RoutedEventArgs e) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) switch (((FrameworkElement)(CheckBox)sender).Name) { default: ViewModel.Plano.ForEach(delegate(Plano x) { x.Selecionado = !x.Selecionado; }); ViewModel.Plano = new List(ViewModel.Plano); break; case "GridPlanos": ViewModel.Planos.ForEach(delegate(Planos x) { x.Selecionado = !x.Selecionado; }); ViewModel.Planos = new List(ViewModel.Planos); break; case "GridCentro": ViewModel.Centro.ForEach(delegate(Centro x) { x.Selecionado = !x.Selecionado; }); ViewModel.Centro = new List(ViewModel.Centro); break; case "GridConta": ViewModel.Conta.ForEach(delegate(BancosContas x) { x.Selecionado = !x.Selecionado; }); ViewModel.Conta = new List(ViewModel.Conta); break; } } private void Filtros_OnClick(object sender, RoutedEventArgs e) { ViewModel.IsExpanded = !ViewModel.IsExpanded; } private void Fechar_OnClick(object sender, RoutedEventArgs e) { ViewModel.IsExpanded = !ViewModel.IsExpanded; } [DebuggerNonUserCode] [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] public void InitializeComponent() { if (!_contentLoaded) { _contentLoaded = true; Uri uri = new Uri("/Gestor.Application;component/views/financeiro/relatorios/fechamentofinanceiroview.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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown switch (connectionId) { case 1: ProgressRing = (ProgressBar)target; break; case 2: InicioBox = (DatePicker)target; ((UIElement)InicioBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((Control)InicioBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); break; case 3: FimBox = (DatePicker)target; ((UIElement)FimBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((Control)FimBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); break; case 4: ((MenuItem)target).Click += new RoutedEventHandler(GerarResultados_OnClick); break; case 5: ((MenuItem)target).Click += new RoutedEventHandler(Filtros_OnClick); break; case 6: ((MenuItem)target).Click += new RoutedEventHandler(Imprimir_OnClick); break; case 7: ((MenuItem)target).Click += new RoutedEventHandler(ExportarExcel_OnClick); break; case 8: WebEditor = (WebEditor)target; break; case 9: NaoHaDados = (TextBlock)target; break; case 10: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Fechar_OnClick); break; default: _contentLoaded = true; break; } } [DebuggerNonUserCode] [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] [EditorBrowsable(EditorBrowsableState.Never)] void IStyleConnector.Connect(int connectionId, object target) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown switch (connectionId) { case 11: ((ToggleButton)(CheckBox)target).Checked += new RoutedEventHandler(CheckBox_Checked); ((ToggleButton)(CheckBox)target).Unchecked += new RoutedEventHandler(CheckBox_Checked); break; case 12: ((ToggleButton)(CheckBox)target).Checked += new RoutedEventHandler(CheckBox_Checked); ((ToggleButton)(CheckBox)target).Unchecked += new RoutedEventHandler(CheckBox_Checked); break; case 13: ((ToggleButton)(CheckBox)target).Checked += new RoutedEventHandler(CheckBox_Checked); ((ToggleButton)(CheckBox)target).Unchecked += new RoutedEventHandler(CheckBox_Checked); break; case 14: ((ToggleButton)(CheckBox)target).Checked += new RoutedEventHandler(CheckBox_Checked); ((ToggleButton)(CheckBox)target).Unchecked += new RoutedEventHandler(CheckBox_Checked); break; } } }