From 674ca83ba9243a9e95a7568c797668dab6aee26a Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:35:25 -0300 Subject: feat: upload files --- .../Drawers/Ajuda/BoletosNotasDrawerView.cs | 174 ++++++++++++++++++++ .../Drawers/Ajuda/ContratosDrawerView.cs | 69 ++++++++ .../Drawers/Ajuda/InstalacaoDrawerView.cs | 181 +++++++++++++++++++++ 3 files changed, 424 insertions(+) create mode 100644 Gestor.Application/Drawers/Ajuda/BoletosNotasDrawerView.cs create mode 100644 Gestor.Application/Drawers/Ajuda/ContratosDrawerView.cs create mode 100644 Gestor.Application/Drawers/Ajuda/InstalacaoDrawerView.cs (limited to 'Gestor.Application/Drawers/Ajuda') diff --git a/Gestor.Application/Drawers/Ajuda/BoletosNotasDrawerView.cs b/Gestor.Application/Drawers/Ajuda/BoletosNotasDrawerView.cs new file mode 100644 index 0000000..5426bb0 --- /dev/null +++ b/Gestor.Application/Drawers/Ajuda/BoletosNotasDrawerView.cs @@ -0,0 +1,174 @@ +using Agger.Registro; +using Gestor.Application.Helpers; +using Gestor.Application.Model.Ajuda; +using Gestor.Application.ViewModels.Drawer.Ajuda; +using Gestor.Application.ViewModels.Generic; +using Gestor.Application.Views.Generic; +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Markup; + +namespace Gestor.Application.Drawers.Ajuda +{ + public class BoletosNotasDrawerView : BaseUserControl, IComponentConnector, IStyleConnector + { + internal System.Windows.Controls.ProgressBar ProgressBar; + + internal ComboBox StatusCbo; + + internal DataGrid BoletosGrid; + + internal DataGridTemplateColumn BaixarBoletoColumn; + + internal DataGridTextColumn PagamentoColumn; + + internal ItemsControl BoletoDisponivel; + + internal TextBlock TxtBoletoDisponivel; + + private bool _contentLoaded; + + public BoletosNotasViewModel ViewModel + { + get; + set; + } + + public BoletosNotasDrawerView() + { + this.ViewModel = new BoletosNotasViewModel(); + base.DataContext = this.ViewModel; + this.InitializeComponent(); + this.StatusCbo.SelectedIndex = 0; + } + + private void ExibirBoleto_OnClick(object sender, RoutedEventArgs e) + { + Boleto selectedItem = (Boleto)this.BoletosGrid.SelectedItem; + if ((selectedItem.Vencimento - Funcoes.GetNetworkTime()).TotalDays > 10) + { + return; + } + Process.Start(string.Format("{0}billet/id/{1}", Address.get_ApiBoletoAgger(), selectedItem.IdBoleto)); + } + + private void ExibirNota_OnClick(object sender, RoutedEventArgs e) + { + Process.Start(((Boleto)this.BoletosGrid.SelectedItem).Nota ?? ""); + } + + private void Fechar_OnClick(object sender, RoutedEventArgs e) + { + this.ViewModel.CloseDrawer(); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (this._contentLoaded) + { + return; + } + this._contentLoaded = true; + System.Windows.Application.LoadComponent(this, new Uri("/Gestor.Application;component/drawers/ajuda/boletosnotasdrawerview.xaml", UriKind.Relative)); + } + + private void SelectedStatus_OnSelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (this.StatusCbo.SelectedItem == null) + { + return; + } + this.ViewModel.WorkOnSelectedStatus(this.StatusCbo.SelectedItem.ToString()); + this.PagamentoColumn.Visibility = (this.StatusCbo.SelectedItem.ToString() == "PENDENTES" ? System.Windows.Visibility.Collapsed : System.Windows.Visibility.Visible); + this.BaixarBoletoColumn.Visibility = (this.StatusCbo.SelectedItem.ToString() == "PENDENTES" ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed); + this.BoletoDisponivel.Visibility = (this.StatusCbo.SelectedItem.ToString() == "PENDENTES" ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed); + } + + [DebuggerNonUserCode] + [EditorBrowsable(EditorBrowsableState.Never)] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) + { + switch (connectionId) + { + case 1: + { + this.ProgressBar = (System.Windows.Controls.ProgressBar)target; + return; + } + case 2: + { + ((Button)target).Click += new RoutedEventHandler(this.Fechar_OnClick); + return; + } + case 3: + { + this.StatusCbo = (ComboBox)target; + this.StatusCbo.SelectionChanged += new SelectionChangedEventHandler(this.SelectedStatus_OnSelectionChanged); + return; + } + case 4: + { + this.BoletosGrid = (DataGrid)target; + return; + } + case 5: + { + this.BaixarBoletoColumn = (DataGridTemplateColumn)target; + return; + } + case 6: + case 7: + { + this._contentLoaded = true; + return; + } + case 8: + { + this.PagamentoColumn = (DataGridTextColumn)target; + return; + } + case 9: + { + this.BoletoDisponivel = (ItemsControl)target; + return; + } + case 10: + { + this.TxtBoletoDisponivel = (TextBlock)target; + return; + } + default: + { + this._contentLoaded = true; + return; + } + } + } + + [DebuggerNonUserCode] + [EditorBrowsable(EditorBrowsableState.Never)] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) + { + if (connectionId == 6) + { + ((Button)target).Click += new RoutedEventHandler(this.ExibirBoleto_OnClick); + return; + } + if (connectionId != 7) + { + return; + } + ((Button)target).Click += new RoutedEventHandler(this.ExibirNota_OnClick); + } + } +} \ No newline at end of file diff --git a/Gestor.Application/Drawers/Ajuda/ContratosDrawerView.cs b/Gestor.Application/Drawers/Ajuda/ContratosDrawerView.cs new file mode 100644 index 0000000..3a3c153 --- /dev/null +++ b/Gestor.Application/Drawers/Ajuda/ContratosDrawerView.cs @@ -0,0 +1,69 @@ +using Gestor.Application.ViewModels.Drawer.Ajuda; +using Gestor.Application.ViewModels.Generic; +using Gestor.Application.Views.Generic; +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Markup; + +namespace Gestor.Application.Drawers.Ajuda +{ + public class ContratosDrawerView : BaseUserControl, IComponentConnector + { + internal DataGrid ContratosGrid; + + private bool _contentLoaded; + + public ContratosViewModel ViewModel + { + get; + set; + } + + public ContratosDrawerView() + { + this.ViewModel = new ContratosViewModel(); + base.DataContext = this.ViewModel; + this.InitializeComponent(); + } + + private void Fechar_OnClick(object sender, RoutedEventArgs e) + { + this.ViewModel.CloseDrawer(); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (this._contentLoaded) + { + return; + } + this._contentLoaded = true; + System.Windows.Application.LoadComponent(this, new Uri("/Gestor.Application;component/drawers/ajuda/contratosdrawerview.xaml", UriKind.Relative)); + } + + [DebuggerNonUserCode] + [EditorBrowsable(EditorBrowsableState.Never)] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) + { + if (connectionId == 1) + { + ((Button)target).Click += new RoutedEventHandler(this.Fechar_OnClick); + return; + } + if (connectionId != 2) + { + this._contentLoaded = true; + return; + } + this.ContratosGrid = (DataGrid)target; + } + } +} \ No newline at end of file diff --git a/Gestor.Application/Drawers/Ajuda/InstalacaoDrawerView.cs b/Gestor.Application/Drawers/Ajuda/InstalacaoDrawerView.cs new file mode 100644 index 0000000..9721288 --- /dev/null +++ b/Gestor.Application/Drawers/Ajuda/InstalacaoDrawerView.cs @@ -0,0 +1,181 @@ +using Gestor.Application.Model.Ajuda; +using Gestor.Application.ViewModels.Drawer.Ajuda; +using Gestor.Application.ViewModels.Generic; +using Gestor.Application.Views.Generic; +using Gestor.Common.Validation; +using System; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Markup; + +namespace Gestor.Application.Drawers.Ajuda +{ + public class InstalacaoDrawerView : BaseUserControl, IComponentConnector, IStyleConnector + { + internal System.Windows.Controls.ProgressBar ProgressBar; + + internal DataGrid GestorGrid; + + internal DataGrid AggilizadorGrid; + + private bool _contentLoaded; + + public InstalacaoViewModel ViewModel + { + get; + set; + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + internal Delegate _CreateDelegate(Type delegateType, string handler) + { + return Delegate.CreateDelegate(delegateType, this, handler); + } + + public InstalacaoDrawerView() + { + this.ViewModel = new InstalacaoViewModel(); + base.DataContext = this.ViewModel; + this.InitializeComponent(); + } + + private void AutoCompleteBox_OnTextChanged(object sender, RoutedEventArgs e) + { + if (!string.IsNullOrWhiteSpace(((AutoCompleteBox)sender).get_Text())) + { + return; + } + this.ViewModel.FiltrarInstalacao(""); + } + + private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e) + { + e.set_Cancel(true); + this.ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.get_Parameter().Trim())).ContinueWith((Task> searchResult) => { + if (searchResult.Result == null) + { + return; + } + AutoCompleteBox autoCompleteBox = (AutoCompleteBox)sender; + autoCompleteBox.set_ItemsSource(searchResult.Result); + autoCompleteBox.PopulateComplete(); + }, TaskScheduler.FromCurrentSynchronizationContext()); + } + + private async void ExcluirInstalacaoAggilizadorGrid_OnClick(object sender, RoutedEventArgs e) + { + Instalacao selectedItem; + if (this.AggilizadorGrid.SelectedItem != null) + { + selectedItem = (Instalacao)this.AggilizadorGrid.SelectedItem; + if (await this.ViewModel.ShowMessage(string.Concat("DESEJA REALMENTE EXCLUIR A INSTALAÇÃO DA MÁQUINA ", selectedItem.Maquina.ToUpper()), "SIM", "NÃO", false)) + { + this.ViewModel.Excluir(selectedItem.Id); + } + } + selectedItem = null; + } + + private async void ExcluirInstalacaoGestorGrid_OnClick(object sender, RoutedEventArgs e) + { + Instalacao selectedItem; + if (this.GestorGrid.SelectedItem != null) + { + selectedItem = (Instalacao)this.GestorGrid.SelectedItem; + if (await this.ViewModel.ShowMessage(string.Concat("DESEJA REALMENTE EXCLUIR A INSTALAÇÃO DA MÁQUINA ", selectedItem.Maquina.ToUpper()), "SIM", "NÃO", false)) + { + this.ViewModel.Excluir(selectedItem.Id); + } + } + selectedItem = null; + } + + private void Fechar_OnClick(object sender, RoutedEventArgs e) + { + this.ViewModel.CloseDrawer(); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (this._contentLoaded) + { + return; + } + this._contentLoaded = true; + System.Windows.Application.LoadComponent(this, new Uri("/Gestor.Application;component/drawers/ajuda/instalacaodrawerview.xaml", UriKind.Relative)); + } + + [DebuggerNonUserCode] + [EditorBrowsable(EditorBrowsableState.Never)] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) + { + switch (connectionId) + { + case 1: + { + this.ProgressBar = (System.Windows.Controls.ProgressBar)target; + return; + } + case 2: + { + ((Button)target).Click += new RoutedEventHandler(this.Fechar_OnClick); + return; + } + case 3: + { + ((AutoCompleteBox)target).add_Populating(new PopulatingEventHandler(this, InstalacaoDrawerView.AutoCompleteBox_Populating)); + ((AutoCompleteBox)target).add_TextChanged(new RoutedEventHandler(this.AutoCompleteBox_OnTextChanged)); + return; + } + case 4: + { + this.GestorGrid = (DataGrid)target; + return; + } + case 5: + { + this._contentLoaded = true; + return; + } + case 6: + { + this.AggilizadorGrid = (DataGrid)target; + return; + } + default: + { + this._contentLoaded = true; + return; + } + } + } + + [DebuggerNonUserCode] + [EditorBrowsable(EditorBrowsableState.Never)] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) + { + if (connectionId == 5) + { + ((Button)target).Click += new RoutedEventHandler(this.ExcluirInstalacaoGestorGrid_OnClick); + return; + } + if (connectionId != 7) + { + return; + } + ((Button)target).Click += new RoutedEventHandler(this.ExcluirInstalacaoAggilizadorGrid_OnClick); + } + } +} \ No newline at end of file -- cgit v1.2.3