diff options
Diffstat (limited to 'Decompiler/Gestor.Application.Views.BI')
| -rw-r--r-- | Decompiler/Gestor.Application.Views.BI/AcompanhamentoView.cs | 369 | ||||
| -rw-r--r-- | Decompiler/Gestor.Application.Views.BI/AgendaBIView.cs | 81 | ||||
| -rw-r--r-- | Decompiler/Gestor.Application.Views.BI/NotasView.cs | 275 | ||||
| -rw-r--r-- | Decompiler/Gestor.Application.Views.BI/PainelBiView.cs | 450 | ||||
| -rw-r--r-- | Decompiler/Gestor.Application.Views.BI/ProspeccaoView.cs | 403 | ||||
| -rw-r--r-- | Decompiler/Gestor.Application.Views.BI/TarefaView.cs | 601 |
6 files changed, 2179 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.BI/AcompanhamentoView.cs b/Decompiler/Gestor.Application.Views.BI/AcompanhamentoView.cs new file mode 100644 index 0000000..910e4d8 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.BI/AcompanhamentoView.cs @@ -0,0 +1,369 @@ +using System; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using Gestor.Application.Helpers; +using Gestor.Application.ViewModels; +using Gestor.Application.Views.Generic; +using Gestor.Model.Common; +using Gestor.Model.Domain.Ferramentas; + +namespace Gestor.Application.Views.BI; + +public class AcompanhamentoView : BaseUserControl, IComponentConnector, IStyleConnector +{ + private ListBox _dragSource; + + private object _data; + + internal ListBox FasesListBox; + + private bool _contentLoaded; + + public TrilhaViewModel ViewModel { get; set; } + + public AcompanhamentoView() + { + ((FrameworkElement)this).Tag = "CADASTRO DE TRILHAS"; + ViewModel = new TrilhaViewModel(); + ((FrameworkElement)this).DataContext = ViewModel; + InitializeComponent(); + ((FrameworkElement)FasesListBox).DataContext = ViewModel; + } + + private static object GetDataFromListBox(ItemsControl source, Point point) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + IInputElement obj = ((UIElement)source).InputHitTest(point); + UIElement val = (UIElement)(object)((obj is UIElement) ? obj : null); + if (val != null) + { + object obj2 = DependencyProperty.UnsetValue; + while (obj2 == DependencyProperty.UnsetValue) + { + if (val != null) + { + obj2 = source.ItemContainerGenerator.ItemFromContainer((DependencyObject)(object)val); + if (obj2 == DependencyProperty.UnsetValue) + { + DependencyObject parent = VisualTreeHelper.GetParent((DependencyObject)(object)val); + val = (UIElement)(object)((parent is UIElement) ? parent : null); + } + if (val == source) + { + return null; + } + } + } + if (obj2 != DependencyProperty.UnsetValue) + { + return obj2; + } + } + return null; + } + + private void ListBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + //IL_000a: Unknown result type (might be due to invalid IL or missing references) + //IL_0010: Expected O, but got Unknown + //IL_002c: Unknown result type (might be due to invalid IL or missing references) + //IL_004c: Unknown result type (might be due to invalid IL or missing references) + if (sender is Button) + { + Button val = (Button)sender; + ListBox dragSource = ((DependencyObject)(object)val).FindAncestor<ListBox>().FirstOrDefault(); + _dragSource = dragSource; + _data = GetDataFromListBox((ItemsControl)(object)_dragSource, ((MouseEventArgs)e).GetPosition((IInputElement)(object)val)); + if (_data != null) + { + DragDrop.DoDragDrop((DependencyObject)(object)val, _data, (DragDropEffects)2); + ((RoutedEventArgs)e).Handled = true; + } + } + } + + private void ListBox_Drop(object sender, DragEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0007: Expected O, but got Unknown + //IL_008e: Unknown result type (might be due to invalid IL or missing references) + //IL_0098: Expected O, but got Unknown + //IL_00a1: Unknown result type (might be due to invalid IL or missing references) + //IL_00ad: Expected O, but got Unknown + //IL_0042: Unknown result type (might be due to invalid IL or missing references) + ListBox val = (ListBox)sender; + object data = e.Data.GetData(_data.GetType()); + int index = -1; + for (int i = 0; i < ((CollectionView)((ItemsControl)val).Items).Count; i++) + { + DependencyObject obj = ((ItemsControl)val).ItemContainerGenerator.ContainerFromIndex(i); + ListBoxItem val2 = (ListBoxItem)(object)((obj is ListBoxItem) ? obj : null); + if (val2 != null && IsMouseOverTarget((Visual)(object)val2, e.GetPosition((IInputElement)(object)val2))) + { + index = i; + break; + } + } + object dataContext = ((FrameworkElement)_dragSource).DataContext; + Fase origem = (Fase)((dataContext is Fase) ? dataContext : null); + object dataContext2 = ((FrameworkElement)val).DataContext; + Fase origem2 = (Fase)((dataContext2 is Fase) ? dataContext2 : null); + ViewModel.Excluir(origem, (Tarefa)data); + ViewModel.Inserir(origem2, (Tarefa)data, index); + ViewModel.Update(); + } + + private static bool IsMouseOverTarget(Visual target, Point point) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0006: Unknown result type (might be due to invalid IL or missing references) + //IL_0009: Unknown result type (might be due to invalid IL or missing references) + Rect descendantBounds = VisualTreeHelper.GetDescendantBounds(target); + return ((Rect)(ref descendantBounds)).Contains(point); + } + + private void Info_OnClick(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0006: Unknown result type (might be due to invalid IL or missing references) + //IL_000c: Unknown result type (might be due to invalid IL or missing references) + //IL_001f: Unknown result type (might be due to invalid IL or missing references) + Button val = (Button)sender; + bool isOpen = !((ToolTip)((FrameworkElement)val).ToolTip).IsOpen; + ((ToolTip)((FrameworkElement)val).ToolTip).IsOpen = isOpen; + } + + private async void AdicionarTarefa_OnClick(object sender, RoutedEventArgs e) + { + object dataContext = ((FrameworkElement)(Button)sender).DataContext; + Fase fase = (Fase)((dataContext is Fase) ? dataContext : null); + Tarefa data = new Tarefa + { + Agendamento = Funcoes.GetNetworkTime(), + Titulo = "NOVA TAREFA", + Usuario = Recursos.Usuario, + Trilha = ViewModel.SelectedTrilha, + Status = (StatusTarefa)0, + Fase = fase + }; + ViewModel.Loading(isLoading: true); + while (true) + { + Tarefa val = await ViewModel.ShowTarefaDialog(data); + if (val == null) + { + return; + } + List<KeyValuePair<string, string>> list = await ViewModel.Salvar(val); + ViewModel.Loading(isLoading: false); + if (list == null || list.Count == 0) + { + break; + } + await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK"); + } + ViewModel.ToggleSnackBar("TAREFA SALVA COM SUCESSO."); + ViewModel.Alterar(alterar: false); + } + + private async void ListBox_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) + { + ListBox val = (ListBox)sender; + object dataFromListBox = GetDataFromListBox((ItemsControl)(object)val, ((MouseEventArgs)e).GetPosition((IInputElement)(object)val)); + if (dataFromListBox != null) + { + await AbrirTarefa((Tarefa)dataFromListBox); + } + } + + private async Task AbrirTarefa(Tarefa data) + { + while (true) + { + Tarefa val = await ViewModel.ShowTarefaDialog(data); + if (val == null) + { + return; + } + List<KeyValuePair<string, string>> list = await ViewModel.Salvar(val); + ViewModel.Loading(isLoading: false); + if (list == null || list.Count == 0) + { + break; + } + await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK"); + } + ViewModel.ToggleSnackBar("TAREFA SALVA COM SUCESSO."); + ViewModel.Alterar(alterar: false); + } + + private async void ExcluirTarefa_OnClick(object sender, RoutedEventArgs e) + { + object dataContext = ((FrameworkElement)(Button)sender).DataContext; + Tarefa tarefa = (Tarefa)((dataContext is Tarefa) ? dataContext : null); + await ViewModel.Excluir(tarefa); + } + + private async void EditarTarefa_OnClick(object sender, RoutedEventArgs e) + { + object dataContext = ((FrameworkElement)(Button)sender).DataContext; + Tarefa data = (Tarefa)((dataContext is Tarefa) ? dataContext : null); + await AbrirTarefa(data); + } + + private async void TarefaConcluida_OnClick(object sender, RoutedEventArgs e) + { + object dataContext = ((FrameworkElement)(Button)sender).DataContext; + Tarefa val = (Tarefa)((dataContext is Tarefa) ? dataContext : null); + if (val != null) + { + val.Conclusao = Funcoes.GetNetworkTime(); + val.Status = (StatusTarefa)2; + await ViewModel.Salvar(val); + await ViewModel.CarregarTrilha(ViewModel.SelectedTrilha); + } + } + + private void FasesListBox_OnDragOver(object sender, DragEventArgs e) + { + //IL_0018: Unknown result type (might be due to invalid IL or missing references) + //IL_001d: Unknown result type (might be due to invalid IL or missing references) + ListBox val = (ListBox)((sender is ListBox) ? sender : null); + ScrollViewer val2 = AcompanhamentoView.FindVisualChild<ScrollViewer>((DependencyObject)(object)FasesListBox); + if (val != null) + { + Point position = e.GetPosition((IInputElement)(object)val); + double x = ((Point)(ref position)).X; + if (x < 100.0) + { + val2.ScrollToHorizontalOffset(val2.HorizontalOffset - 30.0); + } + else if (x > ((FrameworkElement)val).ActualWidth - 100.0) + { + val2.ScrollToHorizontalOffset(val2.HorizontalOffset + 30.0); + } + } + } + + public static TChildItem FindVisualChild<TChildItem>(DependencyObject obj) where TChildItem : DependencyObject + { + for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++) + { + DependencyObject child = VisualTreeHelper.GetChild(obj, i); + TChildItem val = (TChildItem)(object)((child is TChildItem) ? child : null); + if (val != null) + { + return val; + } + TChildItem val2 = FindVisualChild<TChildItem>(child); + if (val2 != null) + { + return val2; + } + } + return default(TChildItem); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/bi/acompanhamentoview.xaml", UriKind.Relative); + Application.LoadComponent((object)this, uri); + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IComponentConnector.Connect(int connectionId, object target) + { + //IL_0006: Unknown result type (might be due to invalid IL or missing references) + //IL_0010: Expected O, but got Unknown + //IL_001d: Unknown result type (might be due to invalid IL or missing references) + //IL_0027: Expected O, but got Unknown + if (connectionId == 1) + { + FasesListBox = (ListBox)target; + ((UIElement)FasesListBox).DragOver += new DragEventHandler(FasesListBox_OnDragOver); + } + else + { + _contentLoaded = true; + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IStyleConnector.Connect(int connectionId, object target) + { + //IL_0026: Unknown result type (might be due to invalid IL or missing references) + //IL_0032: Unknown result type (might be due to invalid IL or missing references) + //IL_003c: Expected O, but got Unknown + //IL_003e: Unknown result type (might be due to invalid IL or missing references) + //IL_004a: Unknown result type (might be due to invalid IL or missing references) + //IL_0054: Expected O, but got Unknown + //IL_0056: Unknown result type (might be due to invalid IL or missing references) + //IL_0062: Unknown result type (might be due to invalid IL or missing references) + //IL_006c: Expected O, but got Unknown + //IL_006d: Unknown result type (might be due to invalid IL or missing references) + //IL_0079: Unknown result type (might be due to invalid IL or missing references) + //IL_0083: Expected O, but got Unknown + //IL_0084: Unknown result type (might be due to invalid IL or missing references) + //IL_0090: Unknown result type (might be due to invalid IL or missing references) + //IL_009a: Expected O, but got Unknown + //IL_009c: Unknown result type (might be due to invalid IL or missing references) + //IL_00a8: Unknown result type (might be due to invalid IL or missing references) + //IL_00b2: Expected O, but got Unknown + //IL_00b4: Unknown result type (might be due to invalid IL or missing references) + //IL_00c0: Unknown result type (might be due to invalid IL or missing references) + //IL_00ca: Expected O, but got Unknown + //IL_00cc: Unknown result type (might be due to invalid IL or missing references) + //IL_00d8: Unknown result type (might be due to invalid IL or missing references) + //IL_00e2: Expected O, but got Unknown + //IL_00e4: Unknown result type (might be due to invalid IL or missing references) + //IL_00f0: Unknown result type (might be due to invalid IL or missing references) + //IL_00fa: Expected O, but got Unknown + switch (connectionId) + { + case 2: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarTarefa_OnClick); + break; + case 3: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Info_OnClick); + break; + case 4: + ((Control)(ListBox)target).PreviewMouseDoubleClick += new MouseButtonEventHandler(ListBox_OnPreviewMouseDoubleClick); + ((UIElement)(ListBox)target).MouseLeftButtonDown += new MouseButtonEventHandler(ListBox_PreviewMouseLeftButtonDown); + ((UIElement)(ListBox)target).Drop += new DragEventHandler(ListBox_Drop); + break; + case 5: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirTarefa_OnClick); + break; + case 6: + ((UIElement)(Button)target).PreviewMouseLeftButtonDown += new MouseButtonEventHandler(ListBox_PreviewMouseLeftButtonDown); + break; + case 7: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(EditarTarefa_OnClick); + break; + case 8: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(TarefaConcluida_OnClick); + break; + } + } +} diff --git a/Decompiler/Gestor.Application.Views.BI/AgendaBIView.cs b/Decompiler/Gestor.Application.Views.BI/AgendaBIView.cs new file mode 100644 index 0000000..921fa92 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.BI/AgendaBIView.cs @@ -0,0 +1,81 @@ +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Markup; +using System.Windows.Threading; + +namespace Gestor.Application.Views.BI; + +public class AgendaBIView : UserControl, IComponentConnector +{ + internal ContentControl NotasControl; + + internal ContentControl TarefaControl; + + internal ContentControl BiControl; + + private bool _contentLoaded; + + public AgendaBIView() + { + InitializeComponent(); + Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher; + if (dispatcher != null) + { + dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad)); + } + } + + private void ContentLoad() + { + NotasView notasView = new NotasView(); + NotasControl.Content = notasView; + ((FrameworkElement)NotasControl).DataContext = ((FrameworkElement)notasView).DataContext; + TarefaView tarefaView = new TarefaView(); + TarefaControl.Content = tarefaView; + ((FrameworkElement)TarefaControl).DataContext = ((FrameworkElement)tarefaView).DataContext; + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/bi/agendabiview.xaml", UriKind.Relative); + Application.LoadComponent((object)this, uri); + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IComponentConnector.Connect(int connectionId, object target) + { + //IL_0018: Unknown result type (might be due to invalid IL or missing references) + //IL_0022: Expected O, but got Unknown + //IL_0025: Unknown result type (might be due to invalid IL or missing references) + //IL_002f: Expected O, but got Unknown + //IL_0032: Unknown result type (might be due to invalid IL or missing references) + //IL_003c: Expected O, but got Unknown + switch (connectionId) + { + case 1: + NotasControl = (ContentControl)target; + break; + case 2: + TarefaControl = (ContentControl)target; + break; + case 3: + BiControl = (ContentControl)target; + break; + default: + _contentLoaded = true; + break; + } + } +} diff --git a/Decompiler/Gestor.Application.Views.BI/NotasView.cs b/Decompiler/Gestor.Application.Views.BI/NotasView.cs new file mode 100644 index 0000000..788cf19 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.BI/NotasView.cs @@ -0,0 +1,275 @@ +using System; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +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.Media; +using Gestor.Application.Helpers; +using Gestor.Application.ViewModels.BI; +using Gestor.Application.Views.Generic; +using Gestor.Model.Common; +using Gestor.Model.Domain.Ferramentas; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; + +namespace Gestor.Application.Views.BI; + +public class NotasView : BaseUserControl, IComponentConnector, IStyleConnector +{ + internal ProgressBar ProgressRing; + + private bool _contentLoaded; + + public NotasViewModel ViewModel { get; set; } + + public NotasView() + { + ViewModel = new NotasViewModel(); + ((FrameworkElement)this).DataContext = ViewModel; + InitializeComponent(); + } + + private static object GetDataFromListBox(ItemsControl source, Point point) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + IInputElement obj = ((UIElement)source).InputHitTest(point); + UIElement val = (UIElement)(object)((obj is UIElement) ? obj : null); + if (val == null) + { + return null; + } + object obj2 = DependencyProperty.UnsetValue; + while (obj2 == DependencyProperty.UnsetValue) + { + if (val != null) + { + obj2 = source.ItemContainerGenerator.ItemFromContainer((DependencyObject)(object)val); + if (obj2 == DependencyProperty.UnsetValue) + { + DependencyObject parent = VisualTreeHelper.GetParent((DependencyObject)(object)val); + val = (UIElement)(object)((parent is UIElement) ? parent : null); + } + if (val == source) + { + return null; + } + } + } + if (obj2 == DependencyProperty.UnsetValue) + { + return null; + } + return obj2; + } + + private async void AdicionarNota_OnClick(object sender, RoutedEventArgs e) + { + await ViewModel.AdicionarNota(); + } + + private async void ListBox_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) + { + ListBox val = (ListBox)sender; + object dataFromListBox = GetDataFromListBox((ItemsControl)(object)val, ((MouseEventArgs)e).GetPosition((IInputElement)(object)val)); + if (dataFromListBox != null) + { + Tarefa val2 = new Tarefa(); + DomainBase.Copy<Tarefa, Tarefa>(val2, (Tarefa)dataFromListBox); + val2.UsuariosVinculados = val2.Responsaveis?.Select((ResponsavelTarefa x) => x.Usuario).ToList(); + await AbrirNota(val2, (int)val2.Entidade == 1, (int)val2.Entidade == 1); + } + } + + private async Task AbrirNota(Tarefa data, bool notaBool = false, bool agendamento = false) + { + while (true) + { + Tarefa nota = await ViewModel.ShowTarefaDialog(data, notaBool, agendamento); + if (nota == null) + { + return; + } + if (nota.Usuario == null) + { + nota.Usuario = nota.UsuariosVinculados.FirstOrDefault(); + } + List<ResponsavelTarefa> responsaveis = ((IEnumerable<Usuario>)nota.UsuariosVinculados).Select((Func<Usuario, ResponsavelTarefa>)((Usuario x) => new ResponsavelTarefa + { + IdTarefa = ((DomainBase)nota).Id, + Usuario = x + })).ToList(); + nota.Responsaveis = responsaveis; + ViewModel.Loading(isLoading: true); + List<KeyValuePair<string, string>> list = await ViewModel.Salvar(nota); + ViewModel.Loading(isLoading: false); + if (list == null || list.Count == 0) + { + break; + } + await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK"); + } + ViewModel.ToggleSnackBar("NOTA SALVA COM SUCESSO."); + await ViewModel.CarregarNotas(); + } + + private async void NotaConcluida_OnClick(object sender, RoutedEventArgs e) + { + object dataContext = ((FrameworkElement)(Button)sender).DataContext; + Tarefa val = (Tarefa)((dataContext is Tarefa) ? dataContext : null); + if (val != null) + { + val.Conclusao = Funcoes.GetNetworkTime(); + val.Status = (StatusTarefa)2; + await ViewModel.SalvarNota(val); + await ViewModel.CarregarNotas(); + } + } + + private void ToggleNotasConcluidas_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.ToggleNotasConcluidas(); + } + + private async void ExcluirNota_OnClick(object sender, RoutedEventArgs e) + { + object dataContext = ((FrameworkElement)(Button)sender).DataContext; + Tarefa val = (Tarefa)((dataContext is Tarefa) ? dataContext : null); + if (val != null) + { + await ViewModel.ExcluirNota(val); + await ViewModel.CarregarNotas(); + } + } + + private async void SarvarNota_OnClick(object sender, RoutedEventArgs e) + { + object dataContext = ((FrameworkElement)(Button)sender).DataContext; + Tarefa val = (Tarefa)((dataContext is Tarefa) ? dataContext : null); + if (val != null) + { + ViewModel.Loading(isLoading: true); + List<KeyValuePair<string, string>> list = await ViewModel.Salvar(val); + ViewModel.Loading(isLoading: false); + if (list == null || list.Count == 0) + { + ViewModel.ToggleSnackBar("NOTA SALVA COM SUCESSO."); + } + else + { + await ViewModel.CarregarNotas(); + } + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/bi/notasview.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_002c: Unknown result type (might be due to invalid IL or missing references) + //IL_0036: Expected O, but got Unknown + //IL_0038: Unknown result type (might be due to invalid IL or missing references) + //IL_0044: Unknown result type (might be due to invalid IL or missing references) + //IL_004e: Expected O, but got Unknown + //IL_0050: Unknown result type (might be due to invalid IL or missing references) + //IL_005c: Unknown result type (might be due to invalid IL or missing references) + //IL_0066: Expected O, but got Unknown + //IL_0068: Unknown result type (might be due to invalid IL or missing references) + //IL_0074: Unknown result type (might be due to invalid IL or missing references) + //IL_007e: Expected O, but got Unknown + //IL_0080: Unknown result type (might be due to invalid IL or missing references) + //IL_008c: Unknown result type (might be due to invalid IL or missing references) + //IL_0096: Expected O, but got Unknown + switch (connectionId) + { + case 1: + ProgressRing = (ProgressBar)target; + break; + case 2: + ((Control)(ListBox)target).PreviewMouseDoubleClick += new MouseButtonEventHandler(ListBox_OnPreviewMouseDoubleClick); + break; + case 6: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarNota_OnClick); + break; + case 7: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ToggleNotasConcluidas_OnClick); + break; + case 8: + ((Control)(ListBox)target).PreviewMouseDoubleClick += new MouseButtonEventHandler(ListBox_OnPreviewMouseDoubleClick); + break; + default: + _contentLoaded = true; + break; + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IStyleConnector.Connect(int connectionId, object target) + { + //IL_002a: Unknown result type (might be due to invalid IL or missing references) + //IL_0036: Unknown result type (might be due to invalid IL or missing references) + //IL_0040: Expected O, but got Unknown + //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_005a: Unknown result type (might be due to invalid IL or missing references) + //IL_0066: Unknown result type (might be due to invalid IL or missing references) + //IL_0070: Expected O, but got Unknown + //IL_0072: Unknown result type (might be due to invalid IL or missing references) + //IL_007e: Unknown result type (might be due to invalid IL or missing references) + //IL_0088: Expected O, but got Unknown + //IL_008a: Unknown result type (might be due to invalid IL or missing references) + //IL_0096: Unknown result type (might be due to invalid IL or missing references) + //IL_00a0: Expected O, but got Unknown + switch (connectionId) + { + case 3: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirNota_OnClick); + break; + case 4: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(NotaConcluida_OnClick); + break; + case 5: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(SarvarNota_OnClick); + break; + case 9: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirNota_OnClick); + break; + case 10: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(SarvarNota_OnClick); + break; + case 6: + case 7: + case 8: + break; + } + } +} diff --git a/Decompiler/Gestor.Application.Views.BI/PainelBiView.cs b/Decompiler/Gestor.Application.Views.BI/PainelBiView.cs new file mode 100644 index 0000000..4512167 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.BI/PainelBiView.cs @@ -0,0 +1,450 @@ +using System; +using System.CodeDom.Compiler; +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 Gestor.Application.ViewModels.BI; +using Gestor.Application.Views.Generic; +using Gestor.Common.Validation; +using LiveCharts.Wpf; + +namespace Gestor.Application.Views.BI; + +public class PainelBiView : BaseUserControl, IComponentConnector +{ + public PainelBiViewModel ViewModel; + + internal ProgressBar ProgressProducao; + + internal DatePicker InicioBox; + + internal DatePicker FimBox; + + internal Button Anterior; + + internal Button Gerada; + + internal Button Apolices; + + internal Button Endossos; + + internal Button NovosNegocios; + + internal Button Faturas; + + internal Button Renovacoes; + + internal Button Cancelamentos; + + internal ProgressBar ProgressClientes; + + internal DatePicker InicioClientesBox; + + internal DatePicker FimClientesBox; + + internal Button Aniversariantes; + + internal Button VencimentoCnh; + + internal ProgressBar ProgressPendencia; + + internal DatePicker InicioPendenciaBox; + + internal DatePicker FimPendenciaBox; + + internal Button VencimentoApolices; + + internal Button ParcelasAVencer; + + internal Button ApolicesPendentes; + + internal Button ParcelasPendentes; + + private bool _contentLoaded; + + public PainelBiView() + { + ViewModel = new PainelBiViewModel(); + ((FrameworkElement)this).DataContext = ViewModel; + ((FrameworkElement)this).Tag = "PAINEL B.I."; + InitializeComponent(); + } + + private async void Atualizar_Click(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; + } + await ViewModel.GerarProducao(); + } + + private void Grafico_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) + { + ViewModel.Detalhar(0); + } + + private async void AtualizarClientes_OnClick(object sender, RoutedEventArgs e) + { + InicioClientesBox.Text = ValidationHelper.FormatDate(InicioClientesBox.Text); + FimClientesBox.Text = ValidationHelper.FormatDate(FimClientesBox.Text); + try + { + ViewModel.Inicio = Convert.ToDateTime(InicioClientesBox.Text); + ViewModel.Fim = Convert.ToDateTime(FimClientesBox.Text); + } + catch (Exception) + { + return; + } + await ViewModel.GerarClientes(); + } + + private async void AtualizarPendencias_OnClick(object sender, RoutedEventArgs e) + { + InicioPendenciaBox.Text = ValidationHelper.FormatDate(InicioPendenciaBox.Text); + FimPendenciaBox.Text = ValidationHelper.FormatDate(FimPendenciaBox.Text); + try + { + ViewModel.Inicio = Convert.ToDateTime(InicioPendenciaBox.Text); + ViewModel.Fim = Convert.ToDateTime(FimPendenciaBox.Text); + } + catch (Exception) + { + return; + } + await ViewModel.GerarVencimento(); + } + + private void Fechamento_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) + { + ViewModel.Detalhar(1); + } + + private void DetalharProducao_OnClick(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + switch (((FrameworkElement)(Button)sender).Name) + { + default: + ViewModel.Detalhar(0); + break; + case "NovosNegocios": + ViewModel.Detalhar(2); + break; + case "Renovacoes": + ViewModel.Detalhar(3); + break; + case "Cancelamentos": + ViewModel.Detalhar(4); + break; + case "Aniversariantes": + ViewModel.Detalhar(5); + break; + case "VencimentoCnh": + ViewModel.Detalhar(6); + break; + case "VencimentoApolices": + ViewModel.Detalhar(7); + break; + case "ParcelasAVencer": + ViewModel.Detalhar(8); + break; + case "ApolicesPendentes": + ViewModel.Detalhar(9); + break; + case "ParcelasPendentes": + ViewModel.Detalhar(10); + break; + case "Faturas": + ViewModel.Detalhar(12); + break; + case "Endossos": + ViewModel.Detalhar(11); + break; + case "Apolices": + ViewModel.Detalhar(13); + break; + case "Anterior": + ViewModel.Detalhar(14); + break; + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/bi/painelbiview.xaml", UriKind.Relative); + Application.LoadComponent((object)this, uri); + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IComponentConnector.Connect(int connectionId, object target) + { + //IL_008b: Unknown result type (might be due to invalid IL or missing references) + //IL_0095: Expected O, but got Unknown + //IL_0098: Unknown result type (might be due to invalid IL or missing references) + //IL_00a2: Expected O, but got Unknown + //IL_00af: Unknown result type (might be due to invalid IL or missing references) + //IL_00b9: Expected O, but got Unknown + //IL_00c6: Unknown result type (might be due to invalid IL or missing references) + //IL_00d0: Expected O, but got Unknown + //IL_00d3: Unknown result type (might be due to invalid IL or missing references) + //IL_00dd: Expected O, but got Unknown + //IL_00ea: Unknown result type (might be due to invalid IL or missing references) + //IL_00f4: Expected O, but got Unknown + //IL_0101: Unknown result type (might be due to invalid IL or missing references) + //IL_010b: Expected O, but got Unknown + //IL_010d: Unknown result type (might be due to invalid IL or missing references) + //IL_0119: Unknown result type (might be due to invalid IL or missing references) + //IL_0123: Expected O, but got Unknown + //IL_0125: Unknown result type (might be due to invalid IL or missing references) + //IL_0131: Unknown result type (might be due to invalid IL or missing references) + //IL_013b: Expected O, but got Unknown + //IL_013d: Unknown result type (might be due to invalid IL or missing references) + //IL_0149: Unknown result type (might be due to invalid IL or missing references) + //IL_0153: Expected O, but got Unknown + //IL_0156: Unknown result type (might be due to invalid IL or missing references) + //IL_0160: Expected O, but got Unknown + //IL_016d: Unknown result type (might be due to invalid IL or missing references) + //IL_0177: Expected O, but got Unknown + //IL_017a: Unknown result type (might be due to invalid IL or missing references) + //IL_0184: Expected O, but got Unknown + //IL_0191: Unknown result type (might be due to invalid IL or missing references) + //IL_019b: Expected O, but got Unknown + //IL_019e: Unknown result type (might be due to invalid IL or missing references) + //IL_01a8: Expected O, but got Unknown + //IL_01b5: Unknown result type (might be due to invalid IL or missing references) + //IL_01bf: Expected O, but got Unknown + //IL_01c2: Unknown result type (might be due to invalid IL or missing references) + //IL_01cc: Expected O, but got Unknown + //IL_01d9: Unknown result type (might be due to invalid IL or missing references) + //IL_01e3: Expected O, but got Unknown + //IL_01e6: Unknown result type (might be due to invalid IL or missing references) + //IL_01f0: Expected O, but got Unknown + //IL_01fd: Unknown result type (might be due to invalid IL or missing references) + //IL_0207: Expected O, but got Unknown + //IL_020a: Unknown result type (might be due to invalid IL or missing references) + //IL_0214: Expected O, but got Unknown + //IL_0221: Unknown result type (might be due to invalid IL or missing references) + //IL_022b: Expected O, but got Unknown + //IL_022e: Unknown result type (might be due to invalid IL or missing references) + //IL_0238: Expected O, but got Unknown + //IL_0245: Unknown result type (might be due to invalid IL or missing references) + //IL_024f: Expected O, but got Unknown + //IL_0252: Unknown result type (might be due to invalid IL or missing references) + //IL_025c: Expected O, but got Unknown + //IL_0269: Unknown result type (might be due to invalid IL or missing references) + //IL_0273: Expected O, but got Unknown + //IL_0275: Unknown result type (might be due to invalid IL or missing references) + //IL_0281: Unknown result type (might be due to invalid IL or missing references) + //IL_028b: Expected O, but got Unknown + //IL_028d: Unknown result type (might be due to invalid IL or missing references) + //IL_0299: Unknown result type (might be due to invalid IL or missing references) + //IL_02a3: Expected O, but got Unknown + //IL_02a5: Unknown result type (might be due to invalid IL or missing references) + //IL_02b1: Unknown result type (might be due to invalid IL or missing references) + //IL_02bb: Expected O, but got Unknown + //IL_02be: Unknown result type (might be due to invalid IL or missing references) + //IL_02c8: Expected O, but got Unknown + //IL_02cb: Unknown result type (might be due to invalid IL or missing references) + //IL_02d5: Expected O, but got Unknown + //IL_02e2: Unknown result type (might be due to invalid IL or missing references) + //IL_02ec: Expected O, but got Unknown + //IL_02f9: Unknown result type (might be due to invalid IL or missing references) + //IL_0303: Expected O, but got Unknown + //IL_0306: Unknown result type (might be due to invalid IL or missing references) + //IL_0310: Expected O, but got Unknown + //IL_031d: Unknown result type (might be due to invalid IL or missing references) + //IL_0327: Expected O, but got Unknown + //IL_0334: Unknown result type (might be due to invalid IL or missing references) + //IL_033e: Expected O, but got Unknown + //IL_0340: Unknown result type (might be due to invalid IL or missing references) + //IL_034c: Unknown result type (might be due to invalid IL or missing references) + //IL_0356: Expected O, but got Unknown + //IL_0359: Unknown result type (might be due to invalid IL or missing references) + //IL_0363: Expected O, but got Unknown + //IL_0370: Unknown result type (might be due to invalid IL or missing references) + //IL_037a: Expected O, but got Unknown + //IL_037d: Unknown result type (might be due to invalid IL or missing references) + //IL_0387: Expected O, but got Unknown + //IL_0394: Unknown result type (might be due to invalid IL or missing references) + //IL_039e: Expected O, but got Unknown + //IL_03a1: Unknown result type (might be due to invalid IL or missing references) + //IL_03ab: Expected O, but got Unknown + //IL_03ae: Unknown result type (might be due to invalid IL or missing references) + //IL_03b8: Expected O, but got Unknown + //IL_03c5: Unknown result type (might be due to invalid IL or missing references) + //IL_03cf: Expected O, but got Unknown + //IL_03dc: Unknown result type (might be due to invalid IL or missing references) + //IL_03e6: Expected O, but got Unknown + //IL_03e9: Unknown result type (might be due to invalid IL or missing references) + //IL_03f3: Expected O, but got Unknown + //IL_0400: Unknown result type (might be due to invalid IL or missing references) + //IL_040a: Expected O, but got Unknown + //IL_0417: Unknown result type (might be due to invalid IL or missing references) + //IL_0421: Expected O, but got Unknown + //IL_0423: Unknown result type (might be due to invalid IL or missing references) + //IL_042f: Unknown result type (might be due to invalid IL or missing references) + //IL_0439: Expected O, but got Unknown + //IL_043c: Unknown result type (might be due to invalid IL or missing references) + //IL_0446: Expected O, but got Unknown + //IL_0453: Unknown result type (might be due to invalid IL or missing references) + //IL_045d: Expected O, but got Unknown + //IL_0460: Unknown result type (might be due to invalid IL or missing references) + //IL_046a: Expected O, but got Unknown + //IL_0477: Unknown result type (might be due to invalid IL or missing references) + //IL_0481: Expected O, but got Unknown + //IL_0484: Unknown result type (might be due to invalid IL or missing references) + //IL_048e: Expected O, but got Unknown + //IL_049b: Unknown result type (might be due to invalid IL or missing references) + //IL_04a5: Expected O, but got Unknown + //IL_04a8: Unknown result type (might be due to invalid IL or missing references) + //IL_04b2: Expected O, but got Unknown + //IL_04bf: Unknown result type (might be due to invalid IL or missing references) + //IL_04c9: Expected O, but got Unknown + switch (connectionId) + { + case 1: + ProgressProducao = (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: + ((Control)(CartesianChart)target).PreviewMouseDoubleClick += new MouseButtonEventHandler(Grafico_OnPreviewMouseDoubleClick); + break; + case 5: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Atualizar_Click); + break; + case 6: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 7: + Anterior = (Button)target; + ((ButtonBase)Anterior).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 8: + Gerada = (Button)target; + ((ButtonBase)Gerada).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 9: + Apolices = (Button)target; + ((ButtonBase)Apolices).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 10: + Endossos = (Button)target; + ((ButtonBase)Endossos).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 11: + NovosNegocios = (Button)target; + ((ButtonBase)NovosNegocios).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 12: + Faturas = (Button)target; + ((ButtonBase)Faturas).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 13: + Renovacoes = (Button)target; + ((ButtonBase)Renovacoes).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 14: + Cancelamentos = (Button)target; + ((ButtonBase)Cancelamentos).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 15: + ((Control)(PieChart)target).PreviewMouseDoubleClick += new MouseButtonEventHandler(Grafico_OnPreviewMouseDoubleClick); + break; + case 16: + ((Control)(PieChart)target).PreviewMouseDoubleClick += new MouseButtonEventHandler(Grafico_OnPreviewMouseDoubleClick); + break; + case 17: + ((Control)(CartesianChart)target).PreviewMouseDoubleClick += new MouseButtonEventHandler(Fechamento_OnPreviewMouseDoubleClick); + break; + case 18: + ProgressClientes = (ProgressBar)target; + break; + case 19: + InicioClientesBox = (DatePicker)target; + ((UIElement)InicioClientesBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + ((Control)InicioClientesBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); + break; + case 20: + FimClientesBox = (DatePicker)target; + ((UIElement)FimClientesBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + ((Control)FimClientesBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); + break; + case 21: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AtualizarClientes_OnClick); + break; + case 22: + Aniversariantes = (Button)target; + ((ButtonBase)Aniversariantes).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 23: + VencimentoCnh = (Button)target; + ((ButtonBase)VencimentoCnh).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 24: + ProgressPendencia = (ProgressBar)target; + break; + case 25: + InicioPendenciaBox = (DatePicker)target; + ((UIElement)InicioPendenciaBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + ((Control)InicioPendenciaBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); + break; + case 26: + FimPendenciaBox = (DatePicker)target; + ((UIElement)FimPendenciaBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + ((Control)FimPendenciaBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); + break; + case 27: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AtualizarPendencias_OnClick); + break; + case 28: + VencimentoApolices = (Button)target; + ((ButtonBase)VencimentoApolices).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 29: + ParcelasAVencer = (Button)target; + ((ButtonBase)ParcelasAVencer).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 30: + ApolicesPendentes = (Button)target; + ((ButtonBase)ApolicesPendentes).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + case 31: + ParcelasPendentes = (Button)target; + ((ButtonBase)ParcelasPendentes).Click += new RoutedEventHandler(DetalharProducao_OnClick); + break; + default: + _contentLoaded = true; + break; + } + } +} diff --git a/Decompiler/Gestor.Application.Views.BI/ProspeccaoView.cs b/Decompiler/Gestor.Application.Views.BI/ProspeccaoView.cs new file mode 100644 index 0000000..fa3513d --- /dev/null +++ b/Decompiler/Gestor.Application.Views.BI/ProspeccaoView.cs @@ -0,0 +1,403 @@ +using System; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +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 Gestor.Application.Drawers; +using Gestor.Application.Helpers; +using Gestor.Application.Servicos; +using Gestor.Application.ViewModels.BI; +using Gestor.Application.Views.Generic; +using Gestor.Common.Validation; +using Gestor.Model.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; + +namespace Gestor.Application.Views.BI; + +public class ProspeccaoView : BaseUserControl, IComponentConnector, IStyleConnector +{ + private bool openProsceccao; + + internal DatePicker InicioBox; + + internal DatePicker FimBox; + + internal AutoCompleteBox AutoCompleteFornecedor; + + internal MenuItem MaisOpcoesButton; + + private bool _contentLoaded; + + public ProspeccaoViewModel ViewModel { get; set; } + + public ProspeccaoView() + { + ((FrameworkElement)this).Tag = "PROSPECTAR"; + ViewModel = new ProspeccaoViewModel(); + ((FrameworkElement)this).DataContext = ViewModel; + Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher; + if (dispatcher != null) + { + dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad)); + } + InitializeComponent(); + } + + private async void ContentLoad() + { + await ViewModel.CarregaProspeccao(); + await ViewModel.CarregarPermissao(); + } + + private async void Periodo_OnSelectedDateChanged(object sender, SelectionChangedEventArgs e) + { + await ViewModel.CarregarProspeccoes(); + } + + private async void Vendedor_OnSelectionChanged(object sender, SelectionChangedEventArgs e) + { + await ViewModel.CarregarProspeccoes(); + } + + private async void StatusProspeccao_OnSelectionChanged(object sender, SelectionChangedEventArgs e) + { + await ViewModel.CarregarProspeccoes(); + } + + private async void CriarProspeccao_OnClick(object sender, RoutedEventArgs e) + { + if (!(await ViewModel.BuscaPermissao("Incluir"))) + { + await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA INCLUIR PROSPECÇÃO. CONTATE O ADMINISTRADOR DO SISTEMA."); + } + else if (!openProsceccao) + { + openProsceccao = true; + Prospeccao data = new Prospeccao + { + Status = (StatusProspeccao)1, + Renovacao = true + }; + ViewModel.Loading(isLoading: true); + await AbrirProspeccao(data); + openProsceccao = false; + ViewModel.Loading(isLoading: false); + } + } + + private async Task AbrirProspeccao(Prospeccao data) + { + if (!(await ViewModel.BuscaPermissao("Alterar"))) + { + await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ALTERAR PROSPECÇÃO. CONTATE O ADMINISTRADOR DO SISTEMA."); + return; + } + 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; + } + Prospeccao tarefa; + while (true) + { + bool inclusao = ((DomainBase)data).Id == 0; + tarefa = await ViewModel.ShowProspeccaoDialog(data); + if (tarefa == null) + { + if (!inclusao) + { + await ViewModel.CarregarProspeccoes(); + ViewModel.SelectedProspeccao = ((IEnumerable<Prospeccao>)ViewModel.ProspeccoesFiltradas).FirstOrDefault((Func<Prospeccao, bool>)((Prospeccao x) => ((DomainBase)x).Id == ((DomainBase)data).Id)); + } + return; + } + List<KeyValuePair<string, string>> list = await ViewModel.Salvar(data); + if (list == null || list.Count == 0) + { + break; + } + await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK"); + } + string text = ((((DomainBase)tarefa).Id == 0L) ? "INCLUIU" : "ALTEROU"); + ViewModel.RegistrarAcao(text + " PROSPECÇÃO \"" + tarefa.Nome + "\"", ((DomainBase)tarefa).Id, (TipoTela)33, $"CLIENTE \"{tarefa.Nome}\", ID: {((DomainBase)tarefa).Id}"); + ViewModel.ToggleSnackBar("PROSPECÇÃO SALVA COM SUCESSO."); + await ViewModel.CarregarProspeccoes(); + } + + private void AutoCompleteBoxDetalhe_Populating(object sender, PopulatingEventArgs e) + { + e.Cancel = true; + ViewModel.FiltrarProspecao(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Prospeccao>> 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 async void Control_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) + { + DataGrid val = (DataGrid)sender; + if (val == null || ((Selector)val).SelectedIndex >= 0) + { + Prospeccao data = (Prospeccao)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null); + ViewModel.Loading(isLoading: true); + await AbrirProspeccao(data); + ViewModel.Loading(isLoading: false); + } + } + + private async void EditarProspeccao_OnClick(object sender, RoutedEventArgs e) + { + Prospeccao data = (Prospeccao)((FrameworkElement)(Button)sender).DataContext; + ViewModel.Loading(isLoading: true); + await AbrirProspeccao(data); + ViewModel.Loading(isLoading: false); + } + + private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e) + { + if (!(await ViewModel.BuscaPermissao("Alterar"))) + { + await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ALTERAR PROSPECÇÃO. CONTATE O ADMINISTRADOR DO SISTEMA."); + return; + } + if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)11).Consultar) + { + await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)11) + "."); + return; + } + Prospeccao val = (Prospeccao)((FrameworkElement)(Button)sender).DataContext; + FiltroArquivoDigital filtro = new FiltroArquivoDigital + { + Id = ((DomainBase)val).Id, + Tipo = (TipoArquivoDigital)11, + Parente = val + }; + ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false); + } + + private async void ExcluirProspeccao_OnClick(object sender, RoutedEventArgs e) + { + if (!(await ViewModel.BuscaPermissao("Excluir"))) + { + await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA EXCLUIR PROSPECÇÃO. CONTATE O ADMINISTRADOR DO SISTEMA."); + return; + } + Prospeccao prospeccao = (Prospeccao)((FrameworkElement)(Button)sender).DataContext; + ViewModel.Excluir(prospeccao); + } + + private void AbrirLog_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AbrirLog((TipoTela)33, ((DomainBase)ViewModel.SelectedProspeccao).Id); + } + + private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AbrirLogEmail((TipoTela)33, ((DomainBase)ViewModel.SelectedProspeccao).Id); + } + + private async void Imprimir_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; + } + await ViewModel.Print(); + } + + private async void Excel_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; + } + await ViewModel.GerarExcel(); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/bi/prospeccaoview.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_003e: Unknown result type (might be due to invalid IL or missing references) + //IL_004a: Unknown result type (might be due to invalid IL or missing references) + //IL_0054: Expected O, but got Unknown + //IL_0056: Unknown result type (might be due to invalid IL or missing references) + //IL_0062: Unknown result type (might be due to invalid IL or missing references) + //IL_006c: Expected O, but got Unknown + //IL_006f: Unknown result type (might be due to invalid IL or missing references) + //IL_0079: Expected O, but got Unknown + //IL_0086: Unknown result type (might be due to invalid IL or missing references) + //IL_0090: Expected O, but got Unknown + //IL_009d: Unknown result type (might be due to invalid IL or missing references) + //IL_00a7: Expected O, but got Unknown + //IL_00b4: Unknown result type (might be due to invalid IL or missing references) + //IL_00be: Expected O, but got Unknown + //IL_00d8: Unknown result type (might be due to invalid IL or missing references) + //IL_00e2: Expected O, but got Unknown + //IL_00ef: Unknown result type (might be due to invalid IL or missing references) + //IL_00f9: Expected O, but got Unknown + //IL_0106: Unknown result type (might be due to invalid IL or missing references) + //IL_0110: Expected O, but got Unknown + //IL_011d: Unknown result type (might be due to invalid IL or missing references) + //IL_0127: Expected O, but got Unknown + //IL_0141: Unknown result type (might be due to invalid IL or missing references) + //IL_014b: Expected O, but got Unknown + //IL_0158: Unknown result type (might be due to invalid IL or missing references) + //IL_0162: Expected O, but got Unknown + //IL_0164: Unknown result type (might be due to invalid IL or missing references) + //IL_0170: Unknown result type (might be due to invalid IL or missing references) + //IL_017a: Expected O, but got Unknown + //IL_017c: Unknown result type (might be due to invalid IL or missing references) + //IL_0188: Unknown result type (might be due to invalid IL or missing references) + //IL_0192: Expected O, but got Unknown + //IL_0194: Unknown result type (might be due to invalid IL or missing references) + //IL_01a0: Unknown result type (might be due to invalid IL or missing references) + //IL_01aa: Expected O, but got Unknown + //IL_01ad: Unknown result type (might be due to invalid IL or missing references) + //IL_01b7: Expected O, but got Unknown + //IL_01b9: Unknown result type (might be due to invalid IL or missing references) + //IL_01c5: Unknown result type (might be due to invalid IL or missing references) + //IL_01cf: Expected O, but got Unknown + //IL_01d1: Unknown result type (might be due to invalid IL or missing references) + //IL_01dd: Unknown result type (might be due to invalid IL or missing references) + //IL_01e7: Expected O, but got Unknown + //IL_01e9: Unknown result type (might be due to invalid IL or missing references) + //IL_01f5: Unknown result type (might be due to invalid IL or missing references) + //IL_01ff: Expected O, but got Unknown + switch (connectionId) + { + case 1: + ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(Vendedor_OnSelectionChanged); + break; + case 2: + ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(StatusProspeccao_OnSelectionChanged); + break; + case 3: + InicioBox = (DatePicker)target; + ((UIElement)InicioBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + ((UIElement)InicioBox).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown); + ((Control)InicioBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); + InicioBox.SelectedDateChanged += Periodo_OnSelectedDateChanged; + break; + case 4: + FimBox = (DatePicker)target; + ((UIElement)FimBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + ((UIElement)FimBox).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown); + ((Control)FimBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); + FimBox.SelectedDateChanged += Periodo_OnSelectedDateChanged; + break; + case 5: + AutoCompleteFornecedor = (AutoCompleteBox)target; + AutoCompleteFornecedor.Populating += new PopulatingEventHandler(AutoCompleteBoxDetalhe_Populating); + break; + case 6: + ((MenuItem)target).Click += new RoutedEventHandler(Imprimir_OnClick); + break; + case 7: + ((MenuItem)target).Click += new RoutedEventHandler(Excel_OnClick); + break; + case 8: + ((MenuItem)target).Click += new RoutedEventHandler(CriarProspeccao_OnClick); + break; + case 9: + MaisOpcoesButton = (MenuItem)target; + break; + case 10: + ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick); + break; + case 11: + ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick); + break; + case 12: + ((Control)(DataGrid)target).MouseDoubleClick += new MouseButtonEventHandler(Control_OnMouseDoubleClick); + break; + default: + _contentLoaded = true; + break; + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IStyleConnector.Connect(int connectionId, object target) + { + //IL_0017: Unknown result type (might be due to invalid IL or missing references) + //IL_0023: Unknown result type (might be due to invalid IL or missing references) + //IL_002d: Expected O, but got Unknown + //IL_002f: Unknown result type (might be due to invalid IL or missing references) + //IL_003b: Unknown result type (might be due to invalid IL or missing references) + //IL_0045: Expected O, but got Unknown + //IL_0047: Unknown result type (might be due to invalid IL or missing references) + //IL_0053: Unknown result type (might be due to invalid IL or missing references) + //IL_005d: Expected O, but got Unknown + switch (connectionId) + { + case 13: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirProspeccao_OnClick); + break; + case 14: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click); + break; + case 15: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(EditarProspeccao_OnClick); + break; + } + } +} diff --git a/Decompiler/Gestor.Application.Views.BI/TarefaView.cs b/Decompiler/Gestor.Application.Views.BI/TarefaView.cs new file mode 100644 index 0000000..4d574e2 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.BI/TarefaView.cs @@ -0,0 +1,601 @@ +using System; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Threading; +using Gestor.Application.Actions; +using Gestor.Application.Componentes; +using Gestor.Application.Drawers; +using Gestor.Application.Helpers; +using Gestor.Application.Servicos; +using Gestor.Application.ViewModels.BI; +using Gestor.Application.Views.Ferramentas; +using Gestor.Application.Views.Generic; +using Gestor.Common.Validation; +using Gestor.Model.Common; +using Gestor.Model.Domain.Ferramentas; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.MalaDireta; +using Gestor.Model.Domain.Seguros; +using MaterialDesignThemes.Wpf; +using Xceed.Wpf.AvalonDock.Controls; + +namespace Gestor.Application.Views.BI; + +public class TarefaView : BaseUserControl, IComponentConnector, IStyleConnector +{ + internal ComboBox UsuarioBox; + + internal DatePicker InicioBox; + + internal DatePicker FimBox; + + internal TextBox TituloTarefaLabel; + + internal DatePicker AgendamentoBox; + + internal ComboBox ResponsavelBox; + + internal RadioButton AnotacoesButton; + + internal RadioButton AnotacoesInternasButton; + + internal WebEditor Anotacoes; + + internal WebEditor Historico; + + internal WebEditor AnotacoesInternas; + + internal WebEditor HistoricoInterno; + + private bool _contentLoaded; + + public TarefaBIViewModel ViewModel { get; set; } + + public TarefaView() + { + ViewModel = new TarefaBIViewModel(); + ((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_0046: Unknown result type (might be due to invalid IL or missing references) + //IL_0050: Expected O, but got Unknown + //IL_005d: Unknown result type (might be due to invalid IL or missing references) + //IL_0067: Expected O, but got Unknown + ((ToggleButton)AnotacoesButton).IsChecked = ViewModel.IsAnotacoes; + ((ToggleButton)AnotacoesInternasButton).IsChecked = !ViewModel.IsAnotacoes; + ((ToggleButton)AnotacoesButton).Checked += new RoutedEventHandler(Anotacoes_OnChecked); + ((ToggleButton)AnotacoesInternasButton).Checked += new RoutedEventHandler(AnotacoesInternas_OnChecked); + } + + private async void ExcluirTarefa_OnClick(object sender, RoutedEventArgs e) + { + if (!(await ViewModel.ValidaPermissaoParaExcluirTarefa())) + { + await ViewModel.ShowMessage($"APENAS O USUÁRIO {ViewModel.SelectedTarefa.UsuarioCadastro.Nome} (ID: {((DomainBase)ViewModel.SelectedTarefa.UsuarioCadastro).Id}) PODE EXCLUIR ESSA TAREFA."); + } + else + { + await ViewModel.Excluir(); + } + } + + private async void TarefaConcluida_OnClick(object sender, RoutedEventArgs e) + { + object dataContext = ((FrameworkElement)(Button)sender).DataContext; + Tarefa tarefa = (Tarefa)((dataContext is Tarefa) ? dataContext : null); + if (tarefa != null) + { + if (!(await ViewModel.ValidaPermissaoParaEditarTarefa())) + { + await ViewModel.ShowMessage($"APENAS O USUÁRIO {ViewModel.SelectedTarefa.UsuarioCadastro.Nome} (ID: {((DomainBase)ViewModel.SelectedTarefa.UsuarioCadastro).Id}) PODE CONCLUIR ESSA TAREFA."); + return; + } + tarefa.Conclusao = Funcoes.GetNetworkTime(); + tarefa.Status = (StatusTarefa)2; + await ViewModel.ConcluirTarefa(tarefa); + await ViewModel.CarregarTarefas(); + Gestor.Application.Actions.Actions.AtualizaTrilhas?.Invoke(); + } + } + + private async void Concluida_OnClick(object sender, RoutedEventArgs e) + { + if (ViewModel.SelectedTarefa == null) + { + await ViewModel.ShowMessage("NECESSÁRIO SELECIONAR UMA TAREFA ANTES DE CONCLUIR."); + return; + } + if (!(await ViewModel.ValidaPermissaoParaEditarTarefa())) + { + await ViewModel.ShowMessage($"APENAS O USUÁRIO {ViewModel.SelectedTarefa.UsuarioCadastro.Nome} (ID: {((DomainBase)ViewModel.SelectedTarefa.UsuarioCadastro).Id}) PODE CONCLUIR ESSA TAREFA."); + return; + } + ViewModel.SelectedTarefa.Conclusao = Funcoes.GetNetworkTime(); + ViewModel.SelectedTarefa.Status = (StatusTarefa)2; + await ViewModel.ConcluirTarefa(ViewModel.SelectedTarefa); + await ViewModel.CarregarTarefas(); + } + + private async void NaoConcluida_OnClick(object sender, RoutedEventArgs e) + { + if (ViewModel.SelectedTarefa == null) + { + await ViewModel.ShowMessage("NECESSÁRIO SELECIONAR UMA TAREFA ANTES DE MARCAR COMO NÃO CONCLUÍDO."); + return; + } + ViewModel.SelectedTarefa.Conclusao = null; + ViewModel.SelectedTarefa.Status = (StatusTarefa)0; + await ViewModel.ConcluirTarefa(ViewModel.SelectedTarefa); + await ViewModel.CarregarTarefas(); + } + + private async void Salvar_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.SelectedTarefa.Anotacoes = Anotacoes.GetHtml(); + ViewModel.SelectedTarefa.AnotacoesInternas = AnotacoesInternas.GetHtml(); + ViewModel.SelectedTarefa.Usuario = (Usuario)((Selector)ResponsavelBox).SelectedItem; + List<KeyValuePair<string, string>> list = await ViewModel.Salvar(TituloTarefaLabel.Text); + bool num = list == null || list.Count == 0; + ViewModel.Loading(isLoading: false); + if (num) + { + ViewModel.ToggleSnackBar("TAREFA SALVA COM SUCESSO."); + ViewModel.Alterar(alterar: false); + } + else + { + await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK"); + } + } + + private async void Cancelar_OnClick(object sender, RoutedEventArgs e) + { + await ViewModel.Cancelar(); + } + + private async void Excluir_OnClick(object sender, RoutedEventArgs e) + { + if (!ViewModel.SelectedTarefa.Restrito.HasValue || !ViewModel.SelectedTarefa.Restrito.Value || ((DomainBase)ViewModel.SelectedTarefa.UsuarioCadastro).Id == ((DomainBase)Recursos.Usuario).Id || Recursos.Usuario.Administrador) + { + await ViewModel.Excluir(); + } + else + { + await ViewModel.ShowMessage($"APENAS O USUÁRIO {ViewModel.SelectedTarefa.UsuarioCadastro.Nome} (ID: {((DomainBase)ViewModel.SelectedTarefa.UsuarioCadastro).Id}) PODE EXCLUIR ESSA TAREFA."); + } + } + + private void AdicionarFiltro_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AdcionarFiltro(); + } + + private void ExcluirFiltro_onClick(object sender, RoutedEventArgs e) + { + Chip val = (Chip)((sender is Chip) ? sender : null); + if (val != null) + { + ListBox val2 = Extentions.FindVisualAncestor<ListBox>((DependencyObject)(object)val); + string text = (string)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)]; + if (text != null) + { + ViewModel.ExcluirFiltro(text); + } + } + } + + private void Alterar_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AlterarTarefa(); + Anotacoes.Initialize(); + AnotacoesInternas.Initialize(); + } + + private void CopyTelefoneToClipBoard_Click(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0007: Expected O, but got Unknown + Button val = (Button)sender; + if (((FrameworkElement)val).DataContext != null) + { + object dataContext = ((FrameworkElement)val).DataContext; + TelefoneBase val2 = (TelefoneBase)((dataContext is TelefoneBase) ? dataContext : null); + if (val2 != null) + { + (val2.Prefixo + ValidationHelper.OnlyNumber(val2.Numero)).CopyToClipboard(); + ViewModel.ToggleSnackBar("COPIADO - " + val2.Prefixo + ValidationHelper.OnlyNumber(val2.Numero)); + } + } + } + + private async void WhatsAppMessage_Click(object sender, RoutedEventArgs e) + { + Button val = (Button)sender; + if (((FrameworkElement)val).DataContext != null) + { + object dataContext = ((FrameworkElement)val).DataContext; + TelefoneBase val2 = (TelefoneBase)((dataContext is TelefoneBase) ? dataContext : null); + if (val2 != null && !((val2.Tipo.HasValue && (int)val2.Tipo.GetValueOrDefault() == 8) ? (val2.Prefixo + val2.Numero).Clear() : ("55" + val2.Prefixo + val2.Numero.Clear())).EnviarWhatsapp()) + { + await ViewModel.ShowMessage("HOUVE UM PROBLEMA AO ABRIR LINK DO WHATSAPP, O LINK FOI COPIADO EM SUA MAQUINA, BASTA ABRIR O NAVEGADOR DE INTERNET E COLAR NA BARRA DE ENDEREÇOS"); + } + } + } + + private async void Email_OnClick(object sender, RoutedEventArgs e) + { + MalaDireta val = await ViewModel.CriarMalaDireta(ViewModel.SelectedTarefa.Entidade); + if (val == null) + { + await ViewModel.ShowMessage("NECESSÁRIO SELECIONAR AO MENOS UM CLIENTE PARA PROSSEGUIR."); + return; + } + if (Funcoes.IsWindowOpen<HosterWindow>("ENVIO DE E-MAIL")) + { + Funcoes.Destroy<HosterWindow>("ENVIO DE E-MAIL"); + } + string text = "Cliente: " + ViewModel.SelectedTarefa.Cliente + "<br>"; + text += $"Número do Atendimento: {((DomainBase)ViewModel.SelectedTarefa).Id}<br>"; + text += $"Data/Hora da Solicitação: {ViewModel.SelectedTarefa.Agendamento}<br>"; + if (ViewModel.SelectedTarefa.Conclusao.HasValue) + { + text += $"Data/Hora da Conclusão: {ViewModel.SelectedTarefa.Conclusao}<br>"; + } + if (ViewModel.SelectedTarefa.Usuario != null) + { + text = text + "Atendente: " + ViewModel.SelectedTarefa.Usuario.Nome + "<br>"; + } + if (ViewModel.SelectedTarefa.TipoDeTarefa != null) + { + text = text + "Tipo: " + ViewModel.SelectedTarefa.TipoDeTarefa.Nome + "<br>"; + } + text = text + "Assunto: " + ViewModel.SelectedTarefa.Titulo + "<br>"; + text = text + "Situação do Atendimento: " + ValidationHelper.GetDescription((Enum)(object)ViewModel.SelectedTarefa.Status) + "<br><br>"; + text += "Prezado cliente,<br>"; + text += "Segue, abaixo, a descrição do seu atendimento prestado pela corretora.<br><hr>"; + ((Window)new HosterWindow((ContentControl)(object)new MalaDiretaView(new List<MalaDireta> { val }, ViewModel.SelectedTarefa.Titulo, text + ViewModel.Descricao), "ENVIO DE E-MAIL", 1200.0, 600.0, canMaximize: true)).Show(); + } + + private void Imprimir_OnClick(object sender, RoutedEventArgs e) + { + if (((DomainBase)ViewModel.SelectedTarefa).Id != 0L) + { + ViewModel.Print(); + } + } + + private void Cliente_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.Abrir((TipoTarefa)2); + } + + private void Apolice_OnClick(object sender, RoutedEventArgs e) + { + //IL_0011: Unknown result type (might be due to invalid IL or missing references) + //IL_0017: Invalid comparison between Unknown and I4 + ViewModel.Abrir((TipoTarefa)(((int)ViewModel.SelectedTarefa.Entidade == 3) ? 3 : 0)); + } + + private void Sinistro_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.Abrir((TipoTarefa)4); + } + + private void AbrirLog_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AbrirLog((TipoTela)38, ((DomainBase)ViewModel.SelectedTarefa).Id); + } + + private void ArquivoDigital_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AbrirArquivoDigital(); + } + + private async void AnexoTarefa_OnClick(object sender, RoutedEventArgs e) + { + if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)15).Consultar) + { + await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)15) + "."); + return; + } + FiltroArquivoDigital filtro = new FiltroArquivoDigital + { + Id = ((DomainBase)ViewModel.SelectedTarefa).Id, + Tipo = (TipoArquivoDigital)15, + Parente = ViewModel.SelectedTarefa + }; + ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false); + } + + private void Anotacoes_OnChecked(object sender, RoutedEventArgs e) + { + ViewModel.IsAnotacoes = true; + } + + private void AnotacoesInternas_OnChecked(object sender, RoutedEventArgs e) + { + ViewModel.IsAnotacoes = false; + } + + private void ExcluirResponsavel_OnClick(object sender, RoutedEventArgs e) + { + //IL_0011: Unknown result type (might be due to invalid IL or missing references) + //IL_0017: Expected O, but got Unknown + Chip val = (Chip)((sender is Chip) ? sender : null); + if (val == null) + { + return; + } + ResponsavelTarefa val2 = (ResponsavelTarefa)((FrameworkElement)val).DataContext; + if (val2 != null) + { + ViewModel.Responsaveis.Remove(val2); + ViewModel.Usuarios.Add(val2.Usuario); + ViewModel.Usuarios = new ObservableCollection<Usuario>(ViewModel.Usuarios.OrderBy((Usuario x) => x.Nome)); + } + } + + private void AdicionarResponsavel_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AdcionarResponsavel(); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/bi/tarefaview.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_0097: Unknown result type (might be due to invalid IL or missing references) + //IL_00a1: Expected O, but got Unknown + //IL_00a4: Unknown result type (might be due to invalid IL or missing references) + //IL_00ae: Expected O, but got Unknown + //IL_00bb: Unknown result type (might be due to invalid IL or missing references) + //IL_00c5: Expected O, but got Unknown + //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_00f6: Unknown result type (might be due to invalid IL or missing references) + //IL_0100: Expected O, but got Unknown + //IL_010d: Unknown result type (might be due to invalid IL or missing references) + //IL_0117: Expected O, but got Unknown + //IL_0119: Unknown result type (might be due to invalid IL or missing references) + //IL_0125: Unknown result type (might be due to invalid IL or missing references) + //IL_012f: Expected O, but got Unknown + //IL_0131: Unknown result type (might be due to invalid IL or missing references) + //IL_013d: Unknown result type (might be due to invalid IL or missing references) + //IL_0147: Expected O, but got Unknown + //IL_0149: Unknown result type (might be due to invalid IL or missing references) + //IL_0155: Unknown result type (might be due to invalid IL or missing references) + //IL_015f: Expected O, but got Unknown + //IL_0161: Unknown result type (might be due to invalid IL or missing references) + //IL_016d: Unknown result type (might be due to invalid IL or missing references) + //IL_0177: Expected O, but got Unknown + //IL_0179: Unknown result type (might be due to invalid IL or missing references) + //IL_0185: Unknown result type (might be due to invalid IL or missing references) + //IL_018f: Expected O, but got Unknown + //IL_0191: Unknown result type (might be due to invalid IL or missing references) + //IL_019d: Unknown result type (might be due to invalid IL or missing references) + //IL_01a7: Expected O, but got Unknown + //IL_01a9: Unknown result type (might be due to invalid IL or missing references) + //IL_01b5: Unknown result type (might be due to invalid IL or missing references) + //IL_01bf: Expected O, but got Unknown + //IL_01c1: Unknown result type (might be due to invalid IL or missing references) + //IL_01cd: Unknown result type (might be due to invalid IL or missing references) + //IL_01d7: Expected O, but got Unknown + //IL_01d9: Unknown result type (might be due to invalid IL or missing references) + //IL_01e5: Unknown result type (might be due to invalid IL or missing references) + //IL_01ef: Expected O, but got Unknown + //IL_01f1: Unknown result type (might be due to invalid IL or missing references) + //IL_01fd: Unknown result type (might be due to invalid IL or missing references) + //IL_0207: Expected O, but got Unknown + //IL_0209: Unknown result type (might be due to invalid IL or missing references) + //IL_0215: Unknown result type (might be due to invalid IL or missing references) + //IL_021f: Expected O, but got Unknown + //IL_0221: Unknown result type (might be due to invalid IL or missing references) + //IL_022d: Unknown result type (might be due to invalid IL or missing references) + //IL_0237: Expected O, but got Unknown + //IL_0239: Unknown result type (might be due to invalid IL or missing references) + //IL_0245: Unknown result type (might be due to invalid IL or missing references) + //IL_024f: Expected O, but got Unknown + //IL_0251: Unknown result type (might be due to invalid IL or missing references) + //IL_025d: Unknown result type (might be due to invalid IL or missing references) + //IL_0267: Expected O, but got Unknown + //IL_0269: Unknown result type (might be due to invalid IL or missing references) + //IL_0275: Unknown result type (might be due to invalid IL or missing references) + //IL_027f: Expected O, but got Unknown + //IL_0282: Unknown result type (might be due to invalid IL or missing references) + //IL_028c: Expected O, but got Unknown + //IL_028f: Unknown result type (might be due to invalid IL or missing references) + //IL_0299: Expected O, but got Unknown + //IL_02a6: Unknown result type (might be due to invalid IL or missing references) + //IL_02b0: Expected O, but got Unknown + //IL_02b3: Unknown result type (might be due to invalid IL or missing references) + //IL_02bd: Expected O, but got Unknown + //IL_02bf: Unknown result type (might be due to invalid IL or missing references) + //IL_02cb: Unknown result type (might be due to invalid IL or missing references) + //IL_02d5: Expected O, but got Unknown + //IL_02d8: Unknown result type (might be due to invalid IL or missing references) + //IL_02e2: Expected O, but got Unknown + //IL_02e5: Unknown result type (might be due to invalid IL or missing references) + //IL_02ef: Expected O, but got Unknown + switch (connectionId) + { + case 1: + UsuarioBox = (ComboBox)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: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarFiltro_OnClick); + break; + case 8: + ((MenuItem)target).Click += new RoutedEventHandler(Concluida_OnClick); + break; + case 9: + ((MenuItem)target).Click += new RoutedEventHandler(NaoConcluida_OnClick); + break; + case 10: + ((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick); + break; + case 11: + ((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick); + break; + case 12: + ((MenuItem)target).Click += new RoutedEventHandler(Cancelar_OnClick); + break; + case 13: + ((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick); + break; + case 14: + ((MenuItem)target).Click += new RoutedEventHandler(AnexoTarefa_OnClick); + break; + case 15: + ((MenuItem)target).Click += new RoutedEventHandler(Cliente_OnClick); + break; + case 16: + ((MenuItem)target).Click += new RoutedEventHandler(Apolice_OnClick); + break; + case 17: + ((MenuItem)target).Click += new RoutedEventHandler(ArquivoDigital_OnClick); + break; + case 18: + ((MenuItem)target).Click += new RoutedEventHandler(Sinistro_OnClick); + break; + case 19: + ((MenuItem)target).Click += new RoutedEventHandler(Imprimir_OnClick); + break; + case 20: + ((MenuItem)target).Click += new RoutedEventHandler(Email_OnClick); + break; + case 21: + ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick); + break; + case 24: + TituloTarefaLabel = (TextBox)target; + break; + case 25: + AgendamentoBox = (DatePicker)target; + ((UIElement)AgendamentoBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); + break; + case 26: + ResponsavelBox = (ComboBox)target; + break; + case 27: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarResponsavel_OnClick); + break; + case 29: + AnotacoesButton = (RadioButton)target; + break; + case 30: + AnotacoesInternasButton = (RadioButton)target; + break; + case 31: + Anotacoes = (WebEditor)target; + break; + case 32: + Historico = (WebEditor)target; + break; + case 33: + AnotacoesInternas = (WebEditor)target; + break; + case 34: + HistoricoInterno = (WebEditor)target; + break; + default: + _contentLoaded = true; + break; + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IStyleConnector.Connect(int connectionId, object target) + { + //IL_008b: Unknown result type (might be due to invalid IL or missing references) + //IL_0097: Unknown result type (might be due to invalid IL or missing references) + //IL_00a1: Expected O, but got Unknown + //IL_002b: Unknown result type (might be due to invalid IL or missing references) + //IL_0037: Unknown result type (might be due to invalid IL or missing references) + //IL_0041: Expected O, but got Unknown + //IL_0043: Unknown result type (might be due to invalid IL or missing references) + //IL_004f: Unknown result type (might be due to invalid IL or missing references) + //IL_0059: Expected O, but got Unknown + //IL_005b: Unknown result type (might be due to invalid IL or missing references) + //IL_0067: Unknown result type (might be due to invalid IL or missing references) + //IL_0071: Expected O, but got Unknown + //IL_00a3: Unknown result type (might be due to invalid IL or missing references) + //IL_00af: Unknown result type (might be due to invalid IL or missing references) + //IL_00b9: Expected O, but got Unknown + //IL_0073: Unknown result type (might be due to invalid IL or missing references) + //IL_007f: Unknown result type (might be due to invalid IL or missing references) + //IL_0089: Expected O, but got Unknown + switch (connectionId) + { + case 5: + ((Chip)target).DeleteClick += new RoutedEventHandler(ExcluirFiltro_onClick); + break; + case 6: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirTarefa_OnClick); + break; + case 7: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(TarefaConcluida_OnClick); + break; + case 22: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(CopyTelefoneToClipBoard_Click); + break; + case 23: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(WhatsAppMessage_Click); + break; + case 28: + ((Chip)target).DeleteClick += new RoutedEventHandler(ExcluirResponsavel_OnClick); + break; + } + } +} |