diff options
Diffstat (limited to 'Gestor.Application/Views/Seguros/PerfilEmpresaView.cs')
| -rw-r--r-- | Gestor.Application/Views/Seguros/PerfilEmpresaView.cs | 267 |
1 files changed, 0 insertions, 267 deletions
diff --git a/Gestor.Application/Views/Seguros/PerfilEmpresaView.cs b/Gestor.Application/Views/Seguros/PerfilEmpresaView.cs deleted file mode 100644 index 3d80f8c..0000000 --- a/Gestor.Application/Views/Seguros/PerfilEmpresaView.cs +++ /dev/null @@ -1,267 +0,0 @@ -using Gestor.Application.Componentes;
-using Gestor.Application.Helpers;
-using Gestor.Application.ViewModels.Generic;
-using Gestor.Application.ViewModels.Seguros;
-using Gestor.Application.Views.Generic;
-using Gestor.Common.Helpers;
-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.Controls.Primitives;
-using System.Windows.Input;
-using System.Windows.Markup;
-using Xceed.Wpf.Toolkit;
-
-namespace Gestor.Application.Views.Seguros
-{
- public class PerfilEmpresaView : BaseUserControl, IComponentConnector
- {
- public PerfilEmpresaViewModel ViewModel;
-
- private Controle _controle;
-
- internal MenuItem CancelarApoliceButton;
-
- internal TextBox TextAtividade;
-
- internal CustomIsReadOnlyControl ComboSegurancaControl;
-
- internal CheckComboBox ComboSeguranca;
-
- internal CustomIsReadOnlyControl ComboIncendioControl;
-
- internal CheckComboBox ComboIncendio;
-
- internal CheckBox ExclusivoDeposito;
-
- internal CheckBox DivisaTerrenoBaldio;
-
- internal CheckBox PatrimonioHistorio;
-
- internal CheckBox PossuiTelhado;
-
- internal CheckBox CaixasEletronicos;
-
- internal CheckBox Isopainel;
-
- internal CheckBox ConstrucaoReforma;
-
- private bool _contentLoaded;
-
- [DebuggerNonUserCode]
- [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
- internal Delegate _CreateDelegate(Type delegateType, string handler)
- {
- return Delegate.CreateDelegate(delegateType, this, handler);
- }
-
- public PerfilEmpresaView(Controle controle)
- {
- this._controle = controle;
- base.Tag = "CADASTRO DE PERFIL";
- this.ViewModel = new PerfilEmpresaViewModel(controle);
- base.DataContext = this.ViewModel;
- this.InitializeComponent();
- this.LoadData();
- }
-
- private void Alterar_OnClick(object sender, RoutedEventArgs e)
- {
- this.ViewModel.Alterar(true);
- }
-
- private void Cancelar_OnClick(object sender, RoutedEventArgs e)
- {
- bool id;
- this.ViewModel.CancelarAlteracao();
- PerfilEmpresa selectedPerfilEmpresa = this.ViewModel.SelectedPerfilEmpresa;
- if (selectedPerfilEmpresa != null)
- {
- id = selectedPerfilEmpresa.get_Id() == (long)0;
- }
- else
- {
- id = false;
- }
- if (id || this.ViewModel.SelectedPerfilEmpresa == null)
- {
- this.ViewModel.EnableIncluirPerfil = true;
- }
- }
-
- private async void Excluir_OnClick(object sender, RoutedEventArgs e)
- {
- await this.ViewModel.Excluir();
- }
-
- private void Incluir_OnClick(object sender, RoutedEventArgs e)
- {
- this.ViewModel.EnableIncluirPerfil = false;
- 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/seguros/perfilempresaview.xaml", UriKind.Relative));
- }
-
- private void LoadData()
- {
- this.ComboSeguranca.BindData<EquipamentoSeguranca>(false, true, "", false);
- this.ComboIncendio.BindData<EquipamentoIncendio>(false, true, "", false);
- }
-
- private async void Salvar_OnClick(object sender, RoutedEventArgs e)
- {
- this.ViewModel.Loading(true);
- List<KeyValuePair<string, string>> keyValuePairs = await this.ViewModel.Salvar();
- this.ViewModel.Loading(false);
- if (keyValuePairs != null)
- {
- 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:
- {
- this.CancelarApoliceButton = (MenuItem)target;
- this.CancelarApoliceButton.Click += new RoutedEventHandler(this.Cancelar_OnClick);
- return;
- }
- case 5:
- {
- ((MenuItem)target).Click += new RoutedEventHandler(this.Excluir_OnClick);
- return;
- }
- case 6:
- {
- PerfilEmpresaView perfilEmpresaView = this;
- ((TextBox)target).PreviewTextInput += new TextCompositionEventHandler(perfilEmpresaView.SomenteNumeros);
- return;
- }
- case 7:
- {
- ((ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(this.VerificaOnSelected);
- return;
- }
- case 8:
- {
- this.TextAtividade = (TextBox)target;
- return;
- }
- case 9:
- {
- this.ComboSegurancaControl = (CustomIsReadOnlyControl)target;
- return;
- }
- case 10:
- {
- this.ComboSeguranca = (CheckComboBox)target;
- return;
- }
- case 11:
- {
- this.ComboIncendioControl = (CustomIsReadOnlyControl)target;
- return;
- }
- case 12:
- {
- this.ComboIncendio = (CheckComboBox)target;
- return;
- }
- case 13:
- {
- this.ExclusivoDeposito = (CheckBox)target;
- return;
- }
- case 14:
- {
- this.DivisaTerrenoBaldio = (CheckBox)target;
- return;
- }
- case 15:
- {
- this.PatrimonioHistorio = (CheckBox)target;
- return;
- }
- case 16:
- {
- this.PossuiTelhado = (CheckBox)target;
- return;
- }
- case 17:
- {
- this.CaixasEletronicos = (CheckBox)target;
- return;
- }
- case 18:
- {
- this.Isopainel = (CheckBox)target;
- return;
- }
- case 19:
- {
- this.ConstrucaoReforma = (CheckBox)target;
- return;
- }
- }
- this._contentLoaded = true;
- }
-
- private void VerificaOnSelected(object sender, SelectionChangedEventArgs e)
- {
- ComboBox comboBox = (ComboBox)sender;
- if (comboBox.SelectedItem == null)
- {
- return;
- }
- if (EnumHelper.GetDescription<object>(comboBox.SelectedItem) == EnumHelper.GetDescription<AtividadeEmpresa>(0))
- {
- this.ViewModel.AtivaCampos = System.Windows.Visibility.Visible;
- return;
- }
- if (this.ViewModel.AtivaCampos == System.Windows.Visibility.Visible)
- {
- this.TextAtividade.Text = "";
- this.ViewModel.AtivaCampos = System.Windows.Visibility.Collapsed;
- }
- }
- }
-}
\ No newline at end of file |