diff options
Diffstat (limited to 'Codemerx/Gestor.Application/Views/Ferramentas/QualificacaoView.cs')
| -rw-r--r-- | Codemerx/Gestor.Application/Views/Ferramentas/QualificacaoView.cs | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Application/Views/Ferramentas/QualificacaoView.cs b/Codemerx/Gestor.Application/Views/Ferramentas/QualificacaoView.cs new file mode 100644 index 0000000..e3a334c --- /dev/null +++ b/Codemerx/Gestor.Application/Views/Ferramentas/QualificacaoView.cs @@ -0,0 +1,197 @@ +using CurrencyTextBoxControl;
+using Gestor.Application.Helpers;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.ViewModels.Generic;
+using Gestor.Application.Views.Generic;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+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.Ferramentas
+{
+ public class QualificacaoView : BaseUserControl, IComponentConnector
+ {
+ public QualificacaoViewModel ViewModel;
+
+ internal MenuItem MaisOpcoesButton;
+
+ private bool _contentLoaded;
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ internal Delegate _CreateDelegate(Type delegateType, string handler)
+ {
+ return Delegate.CreateDelegate(delegateType, this, handler);
+ }
+
+ public QualificacaoView()
+ {
+ base.Tag = "CADASTRO DE QUALIFICAÇÃO";
+ this.ViewModel = new QualificacaoViewModel();
+ base.DataContext = this.ViewModel;
+ this.InitializeComponent();
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ this.ViewModel.AbrirLog(48, this.ViewModel.SelectedQualificacao.get_Id());
+ }
+
+ private void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ this.ViewModel.CancelQualificacao = (Qualificacao)this.ViewModel.SelectedQualificacao.Clone();
+ this.ViewModel.Alterar(true);
+ this.ViewModel.SelectedQualificacao.Initialize();
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ this.ViewModel.CancelarAlteracao();
+ }
+
+ private void CurrencyTextBox_OnLostFocus(object sender, RoutedEventArgs e)
+ {
+ if (this.ViewModel.SelectedQualificacao.get_Liquido2() <= this.ViewModel.SelectedQualificacao.get_Liquido1())
+ {
+ this.ViewModel.SelectedQualificacao.set_Liquido2(this.ViewModel.SelectedQualificacao.get_Liquido1() + new decimal(1, 0, 0, false, 2));
+ }
+ if (this.ViewModel.SelectedQualificacao.get_Liquido3() <= this.ViewModel.SelectedQualificacao.get_Liquido2())
+ {
+ this.ViewModel.SelectedQualificacao.set_Liquido3(this.ViewModel.SelectedQualificacao.get_Liquido2() + new decimal(1, 0, 0, false, 2));
+ }
+ if (this.ViewModel.SelectedQualificacao.get_Comissao2() <= this.ViewModel.SelectedQualificacao.get_Comissao1())
+ {
+ this.ViewModel.SelectedQualificacao.set_Comissao2(this.ViewModel.SelectedQualificacao.get_Comissao1() + new decimal(1, 0, 0, false, 2));
+ }
+ if (this.ViewModel.SelectedQualificacao.get_Comissao3() <= this.ViewModel.SelectedQualificacao.get_Comissao2())
+ {
+ this.ViewModel.SelectedQualificacao.set_Comissao3(this.ViewModel.SelectedQualificacao.get_Comissao2() + new decimal(1, 0, 0, false, 2));
+ }
+ if (this.ViewModel.SelectedQualificacao.get_Resultado2() <= this.ViewModel.SelectedQualificacao.get_Resultado1())
+ {
+ this.ViewModel.SelectedQualificacao.set_Resultado2(this.ViewModel.SelectedQualificacao.get_Resultado1() + new decimal(1, 0, 0, false, 2));
+ }
+ if (this.ViewModel.SelectedQualificacao.get_Resultado3() <= this.ViewModel.SelectedQualificacao.get_Resultado2())
+ {
+ this.ViewModel.SelectedQualificacao.set_Resultado3(this.ViewModel.SelectedQualificacao.get_Resultado2() + new decimal(1, 0, 0, false, 2));
+ }
+ this.ViewModel.SelectedQualificacao = this.ViewModel.SelectedQualificacao;
+ }
+
+ [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/ferramentas/qualificacaoview.xaml", UriKind.Relative));
+ }
+
+ private async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ bool flag;
+ this.ViewModel.Loading(true);
+ List<KeyValuePair<string, string>> 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.Alterar_OnClick);
+ return;
+ }
+ case 2:
+ {
+ ((MenuItem)target).Click += new RoutedEventHandler(this.Salvar_OnClick);
+ return;
+ }
+ case 3:
+ {
+ ((MenuItem)target).Click += new RoutedEventHandler(this.Cancelar_OnClick);
+ return;
+ }
+ case 4:
+ {
+ this.MaisOpcoesButton = (MenuItem)target;
+ return;
+ }
+ case 5:
+ {
+ ((MenuItem)target).Click += new RoutedEventHandler(this.AbrirLog_OnClick);
+ return;
+ }
+ case 6:
+ {
+ ((CurrencyTextBox)target).LostFocus += new RoutedEventHandler(this.CurrencyTextBox_OnLostFocus);
+ return;
+ }
+ case 7:
+ {
+ ((CurrencyTextBox)target).LostFocus += new RoutedEventHandler(this.CurrencyTextBox_OnLostFocus);
+ return;
+ }
+ case 8:
+ {
+ ((CurrencyTextBox)target).LostFocus += new RoutedEventHandler(this.CurrencyTextBox_OnLostFocus);
+ return;
+ }
+ case 9:
+ {
+ ((CurrencyTextBox)target).LostFocus += new RoutedEventHandler(this.CurrencyTextBox_OnLostFocus);
+ return;
+ }
+ case 10:
+ {
+ ((CurrencyTextBox)target).LostFocus += new RoutedEventHandler(this.CurrencyTextBox_OnLostFocus);
+ return;
+ }
+ case 11:
+ {
+ ((CurrencyTextBox)target).LostFocus += new RoutedEventHandler(this.CurrencyTextBox_OnLostFocus);
+ return;
+ }
+ case 12:
+ {
+ ((CurrencyTextBox)target).LostFocus += new RoutedEventHandler(this.CurrencyTextBox_OnLostFocus);
+ return;
+ }
+ case 13:
+ {
+ ((CurrencyTextBox)target).LostFocus += new RoutedEventHandler(this.CurrencyTextBox_OnLostFocus);
+ return;
+ }
+ case 14:
+ {
+ ((CurrencyTextBox)target).LostFocus += new RoutedEventHandler(this.CurrencyTextBox_OnLostFocus);
+ return;
+ }
+ }
+ this._contentLoaded = true;
+ }
+ }
+}
\ No newline at end of file |