summaryrefslogtreecommitdiff
path: root/Gestor.Application/Componentes/DialogTransferencia.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:35:25 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:35:25 +0000
commit674ca83ba9243a9e95a7568c797668dab6aee26a (patch)
tree4a905b3fb1d827665a34d63f67bc5559f8e7235b /Gestor.Application/Componentes/DialogTransferencia.cs
downloadgestor-674ca83ba9243a9e95a7568c797668dab6aee26a.tar.gz
gestor-674ca83ba9243a9e95a7568c797668dab6aee26a.zip
feat: upload files
Diffstat (limited to 'Gestor.Application/Componentes/DialogTransferencia.cs')
-rw-r--r--Gestor.Application/Componentes/DialogTransferencia.cs110
1 files changed, 110 insertions, 0 deletions
diff --git a/Gestor.Application/Componentes/DialogTransferencia.cs b/Gestor.Application/Componentes/DialogTransferencia.cs
new file mode 100644
index 0000000..30f31c5
--- /dev/null
+++ b/Gestor.Application/Componentes/DialogTransferencia.cs
@@ -0,0 +1,110 @@
+using Assinador.Infrastructure.Helpers;
+using CurrencyTextBoxControl;
+using Gestor.Application.ViewModels.Financeiro;
+using Gestor.Common.Validation;
+using Gestor.Model.Domain.Financeiro;
+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.Input;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Componentes
+{
+ public class DialogTransferencia : UserControl, IComponentConnector
+ {
+ internal ComboBox ContaOrigemBox;
+
+ internal CurrencyTextBox ValorBox;
+
+ internal DatePicker VencimentoBox;
+
+ internal ComboBox ContaDestinoBox;
+
+ private bool _contentLoaded;
+
+ private TranferenciaViewModel ViewModel
+ {
+ get;
+ }
+
+ public DialogTransferencia(Transferencia transferencia)
+ {
+ this.ViewModel = new TranferenciaViewModel(transferencia);
+ base.DataContext = this.ViewModel;
+ this.InitializeComponent();
+ }
+
+ private void DataAtual_OnDoubleClick(object sender, RoutedEventArgs e)
+ {
+ ((DatePicker)sender).SelectedDate = new DateTime?(Functions.GetNetworkTime().Date);
+ }
+
+ public void DatePicker_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
+ {
+ DatePicker datePicker = (DatePicker)sender;
+ datePicker.Text = ValidationHelper.FormatDate(datePicker.Text);
+ }
+
+ public void DatePicker_PreviewKeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key != Key.Return)
+ {
+ return;
+ }
+ DatePicker str = (DatePicker)sender;
+ DateTime date = Functions.GetNetworkTime().Date;
+ str.Text = date.ToString("dd/MM/yyyy");
+ }
+
+ [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/componentes/dialogtransferencia.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.ContaOrigemBox = (ComboBox)target;
+ return;
+ }
+ case 2:
+ {
+ this.ValorBox = (CurrencyTextBox)target;
+ return;
+ }
+ case 3:
+ {
+ this.VencimentoBox = (DatePicker)target;
+ this.VencimentoBox.PreviewKeyDown += new KeyEventHandler(this.DatePicker_PreviewKeyDown);
+ this.VencimentoBox.LostKeyboardFocus += new KeyboardFocusChangedEventHandler(this.DatePicker_OnLostKeyboardFocus);
+ this.VencimentoBox.MouseDoubleClick += new MouseButtonEventHandler(this.DataAtual_OnDoubleClick);
+ return;
+ }
+ case 4:
+ {
+ this.ContaDestinoBox = (ComboBox)target;
+ return;
+ }
+ }
+ this._contentLoaded = true;
+ }
+ }
+} \ No newline at end of file