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 --- Gestor.Application/Views/Financeiro/PlanoView.cs | 117 +++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 Gestor.Application/Views/Financeiro/PlanoView.cs (limited to 'Gestor.Application/Views/Financeiro/PlanoView.cs') diff --git a/Gestor.Application/Views/Financeiro/PlanoView.cs b/Gestor.Application/Views/Financeiro/PlanoView.cs new file mode 100644 index 0000000..5d4bff5 --- /dev/null +++ b/Gestor.Application/Views/Financeiro/PlanoView.cs @@ -0,0 +1,117 @@ +using Gestor.Application.Helpers; +using Gestor.Application.ViewModels.Financeiro; +using Gestor.Application.ViewModels.Generic; +using Gestor.Application.Views.Generic; +using Gestor.Model.Domain.Financeiro; +using Gestor.Model.Domain.Generic; +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.Markup; + +namespace Gestor.Application.Views.Financeiro +{ + public class PlanoView : BaseUserControl, IComponentConnector + { + private bool _contentLoaded; + + public PlanoViewModel ViewModel + { + get; + set; + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + internal Delegate _CreateDelegate(Type delegateType, string handler) + { + return Delegate.CreateDelegate(delegateType, this, handler); + } + + public PlanoView(Plano plano) + { + this.ViewModel = new PlanoViewModel(plano); + base.DataContext = this.ViewModel; + this.InitializeComponent(); + } + + private void Alterar_OnClick(object sender, RoutedEventArgs e) + { + this.ViewModel.Cancel = (Plano)this.ViewModel.SelectedPlano.Clone(); + this.ViewModel.Alterar(true); + } + + private void Cancelar_OnClick(object sender, RoutedEventArgs e) + { + this.ViewModel.Cancelar(); + } + + private void Incluir_OnClick(object sender, RoutedEventArgs e) + { + this.ViewModel.Incluir(); + } + + [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/views/financeiro/planoview.xaml", UriKind.Relative)); + } + + private async void Salvar_OnClick(object sender, RoutedEventArgs e) + { + bool flag; + this.ViewModel.Loading(true); + List> keyValuePairs = await this.ViewModel.Salvar(); + this.ValidateFields(keyValuePairs, true); + flag = (keyValuePairs == null ? true : keyValuePairs.Count == 0); + this.ViewModel.Loading(false); + if (!flag) + { + await this.ViewModel.ShowMessage(keyValuePairs, this.ViewModel.ErroCamposInvalidos, "OK", ""); + } + } + + [DebuggerNonUserCode] + [EditorBrowsable(EditorBrowsableState.Never)] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) + { + switch (connectionId) + { + case 1: + { + ((MenuItem)target).Click += new RoutedEventHandler(this.Incluir_OnClick); + return; + } + case 2: + { + ((MenuItem)target).Click += new RoutedEventHandler(this.Alterar_OnClick); + return; + } + case 3: + { + ((MenuItem)target).Click += new RoutedEventHandler(this.Salvar_OnClick); + return; + } + case 4: + { + ((MenuItem)target).Click += new RoutedEventHandler(this.Cancelar_OnClick); + return; + } + } + this._contentLoaded = true; + } + } +} \ No newline at end of file -- cgit v1.2.3