diff options
Diffstat (limited to 'Gestor.Application/ViewModels/Seguros/Itens/PatrimonialViewModel.cs')
| -rw-r--r-- | Gestor.Application/ViewModels/Seguros/Itens/PatrimonialViewModel.cs | 678 |
1 files changed, 678 insertions, 0 deletions
diff --git a/Gestor.Application/ViewModels/Seguros/Itens/PatrimonialViewModel.cs b/Gestor.Application/ViewModels/Seguros/Itens/PatrimonialViewModel.cs new file mode 100644 index 0000000..caf28fa --- /dev/null +++ b/Gestor.Application/ViewModels/Seguros/Itens/PatrimonialViewModel.cs @@ -0,0 +1,678 @@ +using Gestor.Application.Actions;
+using Gestor.Application.Componentes;
+using Gestor.Application.Servicos.Generic;
+using Gestor.Application.Servicos.Seguros;
+using Gestor.Application.Servicos.Seguros.Itens;
+using Gestor.Application.ViewModels;
+using Gestor.Application.ViewModels.Generic;
+using Gestor.Application.ViewModels.Seguros;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Gestor.Application.ViewModels.Seguros.Itens
+{
+ public class PatrimonialViewModel : ItemViewModel, IDisposable
+ {
+ private readonly ItemServico _itemServico;
+
+ private readonly PatrimonialServico _servico;
+
+ private bool _allowAlterarExcluir = true;
+
+ private object _cobertura;
+
+ private string _codigoItem;
+
+ private Item _selectedItem = new Item();
+
+ private Visibility _visibilityTipoMoradia = Visibility.Collapsed;
+
+ private Visibility _visibilityFianca = Visibility.Collapsed;
+
+ private Visibility _visibilityPatrimonial;
+
+ private string _bensInformacoes = "BENS/INFORMAÇÕES";
+
+ private string _locatarioTomador1 = "LOCATÁRIO 1:";
+
+ private string _locatarioTomador2 = "LOCATÁRIO 2:";
+
+ private string _locatarioTomador3 = "LOCATÁRIO 3:";
+
+ private Visibility _visibilityDescricao = Visibility.Collapsed;
+
+ public bool AllowAlterarExcluir
+ {
+ get
+ {
+ return this._allowAlterarExcluir;
+ }
+ set
+ {
+ this._allowAlterarExcluir = value;
+ base.OnPropertyChanged("AllowAlterarExcluir");
+ }
+ }
+
+ public string BensInformacoes
+ {
+ get
+ {
+ return this._bensInformacoes;
+ }
+ set
+ {
+ this._bensInformacoes = value;
+ base.OnPropertyChanged("BensInformacoes");
+ }
+ }
+
+ public object Cobertura
+ {
+ get
+ {
+ return this._cobertura;
+ }
+ set
+ {
+ this._cobertura = value;
+ base.OnPropertyChanged("Cobertura");
+ }
+ }
+
+ public string CodigoItem
+ {
+ get
+ {
+ return this._codigoItem;
+ }
+ set
+ {
+ this._codigoItem = value;
+ base.OnPropertyChanged("CodigoItem");
+ }
+ }
+
+ public bool Garantia
+ {
+ get;
+ set;
+ }
+
+ public bool Invoke
+ {
+ get;
+ set;
+ }
+
+ private Item ItemSelecionado
+ {
+ get;
+ set;
+ }
+
+ public string LocatarioTomador1
+ {
+ get
+ {
+ return this._locatarioTomador1;
+ }
+ set
+ {
+ this._locatarioTomador1 = value;
+ base.OnPropertyChanged("LocatarioTomador1");
+ }
+ }
+
+ public string LocatarioTomador2
+ {
+ get
+ {
+ return this._locatarioTomador2;
+ }
+ set
+ {
+ this._locatarioTomador2 = value;
+ base.OnPropertyChanged("LocatarioTomador2");
+ }
+ }
+
+ public string LocatarioTomador3
+ {
+ get
+ {
+ return this._locatarioTomador3;
+ }
+ set
+ {
+ this._locatarioTomador3 = value;
+ base.OnPropertyChanged("LocatarioTomador3");
+ }
+ }
+
+ private Gestor.Model.Domain.Seguros.Ramo Ramo
+ {
+ get;
+ }
+
+ public Item SelectedItem
+ {
+ get
+ {
+ return this._selectedItem;
+ }
+ set
+ {
+ long? nullable;
+ this._selectedItem = value;
+ if (value != null)
+ {
+ nullable = new long?(value.get_Id());
+ }
+ else
+ {
+ nullable = null;
+ }
+ base.VerificarEnables(nullable);
+ base.OnPropertyChanged("SelectedItem");
+ }
+ }
+
+ public Visibility VisibilityDescricao
+ {
+ get
+ {
+ return this._visibilityDescricao;
+ }
+ set
+ {
+ this._visibilityDescricao = value;
+ base.OnPropertyChanged("VisibilityDescricao");
+ }
+ }
+
+ public Visibility VisibilityFianca
+ {
+ get
+ {
+ return this._visibilityFianca;
+ }
+ set
+ {
+ this._visibilityFianca = value;
+ base.OnPropertyChanged("VisibilityFianca");
+ }
+ }
+
+ public Visibility VisibilityPatrimonial
+ {
+ get
+ {
+ return this._visibilityPatrimonial;
+ }
+ set
+ {
+ this._visibilityPatrimonial = value;
+ base.OnPropertyChanged("VisibilityPatrimonial");
+ }
+ }
+
+ public Visibility VisibilityTipoMoradia
+ {
+ get
+ {
+ return this._visibilityTipoMoradia;
+ }
+ set
+ {
+ this._visibilityTipoMoradia = value;
+ base.OnPropertyChanged("VisibilityTipoMoradia");
+ }
+ }
+
+ public PatrimonialViewModel(bool substituir = false, ManutencaoItem manutencao = null, Item itemSelecionado = null, Gestor.Model.Domain.Seguros.Ramo ramo = null, bool endossoRenovacao = false)
+ {
+ this.Invoke = itemSelecionado == null;
+ this.ItemSelecionado = itemSelecionado ?? ConsultaViewModel.ItemSelecionado;
+ this.Ramo = ramo ?? ConsultaViewModel.DocumentoSelecionado.get_Controle().get_Ramo();
+ if (this.Invoke)
+ {
+ this.ItemSelecionado = this.ItemSelecionado ?? new Item();
+ this.ItemSelecionado.set_Documento(ConsultaViewModel.DocumentoSelecionado);
+ }
+ this._itemServico = new ItemServico();
+ this._servico = new PatrimonialServico();
+ this.Seleciona(this.ItemSelecionado);
+ if (substituir)
+ {
+ this.Substituir(this.ItemSelecionado);
+ }
+ if (manutencao != null)
+ {
+ this.Manter(this.ItemSelecionado, manutencao);
+ }
+ this.AllowAlterarExcluir = !endossoRenovacao;
+ this.CarregaCobertura();
+ }
+
+ public async void CancelarAlteracao()
+ {
+ base.Loading(true);
+ await this.SelecionaItem(this.ItemSelecionado, false);
+ await this.CoberturaViewModel.CancelarAlteracao();
+ base.Alterar(false);
+ base.Loading(false);
+ }
+
+ public void CarregaCobertura()
+ {
+ this.CoberturaViewModel.Item = this.ItemSelecionado;
+ this.CoberturaViewModel.Ramo = this.Ramo;
+ this.Cobertura = new CoberturaView(this.CoberturaViewModel);
+ }
+
+ public void Descarregar()
+ {
+ this.Cobertura = null;
+ }
+
+ public void Dispose()
+ {
+ Gestor.Application.Actions.Actions.UpdateItem = (Action<Item>)Delegate.Remove(Gestor.Application.Actions.Actions.UpdateItem, new Action<Item>(this.Seleciona));
+ Gestor.Application.Actions.Actions.SubstituirItem = (Action<Item>)Delegate.Remove(Gestor.Application.Actions.Actions.SubstituirItem, new Action<Item>(this.Substituir));
+ Gestor.Application.Actions.Actions.ManterItem = (Action<Item, ManutencaoItem>)Delegate.Remove(Gestor.Application.Actions.Actions.ManterItem, new Action<Item, ManutencaoItem>(this.Manter));
+ }
+
+ public async Task<bool> Excluir()
+ {
+ bool flag;
+ if (this.SelectedItem == null || this.SelectedItem.get_Id() == 0)
+ {
+ flag = false;
+ }
+ else if (await base.ShowMessage("DESEJA EXCLUIR?", "SIM", "NÃO", false))
+ {
+ base.Loading(true);
+ bool flag1 = await this._servico.Delete(this.SelectedItem);
+ base.Loading(false);
+ if (flag1)
+ {
+ string str = string.Concat("EXCLUIU ITEM DE DESCRIÇÃO \"", this.SelectedItem.get_Descricao(), "\"");
+ long id = this.SelectedItem.get_Id();
+ TipoTela? nullable = new TipoTela?(3);
+ object[] objArray = new object[] { this.SelectedItem.get_Id(), this.SelectedItem.get_Documento().get_Id(), this.SelectedItem.get_Documento().get_Controle().get_Ramo().get_Nome(), this.SelectedItem.get_Documento().get_Controle().get_Cliente().get_Nome(), this.SelectedItem.get_Documento().get_Controle().get_Cliente().get_Id() };
+ base.RegistrarAcao(str, id, nullable, string.Format("ID ITEM: {0}\nID DOCUMENTO: {1}\nRAMO: {2}\nCLIENTE: {3}\nID CLIENTE: {4}", objArray));
+ base.ToggleSnackBar(string.Concat(this.Ramo.get_Nome(), " EXCLUÍDO COM SUCESSO"), true);
+ flag = true;
+ }
+ else
+ {
+ await base.ShowMessage("NÃO POSSÍVEL EXCLUIR O ITEM", "OK", "", false);
+ flag = false;
+ }
+ }
+ else
+ {
+ flag = false;
+ }
+ return flag;
+ }
+
+ private void HabilitaCamposGarantia()
+ {
+ this.VisibilityPatrimonial = (this.Ramo.get_Id() == (long)38 ? Visibility.Collapsed : Visibility.Visible);
+ this.BensInformacoes = "OBSERVAÇÕES";
+ this.LocatarioTomador1 = "TOMADOR 1:";
+ this.LocatarioTomador2 = "TOMADOR 2:";
+ this.LocatarioTomador3 = "TOMADOR 3:";
+ this.VisibilityDescricao = Visibility.Visible;
+ this.Garantia = true;
+ }
+
+ public async Task Incluir(bool substituir = false)
+ {
+ int? ordem;
+ List<Gestor.Model.Domain.Seguros.Cobertura> coberturas;
+ long? nullable;
+ Patrimonial patrimonial1;
+ coberturas = (this.CoberturaViewModel.Coberturas == null ? this.CoberturaViewModel.CarregaCoberturaPadrao().ToList<Gestor.Model.Domain.Seguros.Cobertura>() : this.CoberturaViewModel.Coberturas.ToList<Gestor.Model.Domain.Seguros.Cobertura>());
+ List<Gestor.Model.Domain.Seguros.Cobertura> coberturas1 = coberturas;
+ Item item = new Item();
+ item.set_Documento(this.ItemSelecionado.get_Documento());
+ Item item1 = item;
+ ordem = (substituir ? base.ItemSubstituido.get_Ordem() : new int?(await base.QuantidadeDeItens(this.ItemSelecionado.get_Documento().get_Controle().get_Id())));
+ item1.set_Ordem(ordem);
+ Item item2 = item;
+ Patrimonial patrimonial2 = new Patrimonial();
+ patrimonial2.set_Item(this.SelectedItem);
+ item2.set_Patrimonial(patrimonial2);
+ Item item3 = item;
+ if (substituir)
+ {
+ nullable = new long?(base.ItemSubstituido.get_Id());
+ }
+ else
+ {
+ nullable = null;
+ }
+ item3.set_Substituicao(nullable);
+ Item item4 = item;
+ item1 = null;
+ item = null;
+ bool garantia = !this.Garantia;
+ if (garantia)
+ {
+ garantia = await base.ShowMessage("COPIAR OS DADOS DE ENDEREÇO DO CLIENTE?", "SIM", "NÃO", false);
+ }
+ if (garantia)
+ {
+ ObservableCollection<ClienteEndereco> observableCollection = await (new ClienteServico()).BuscarEnderecosAsync(item4.get_Documento().get_Controle().get_Cliente().get_Id());
+ if (observableCollection != null && observableCollection.Any<ClienteEndereco>())
+ {
+ ObservableCollection<ClienteEndereco> observableCollection1 = observableCollection;
+ IOrderedEnumerable<ClienteEndereco> valueOrDefault =
+ from x in observableCollection1
+ orderby x.get_Ordem().GetValueOrDefault() == 1
+ select x;
+ List<Patrimonial> list = valueOrDefault.Select<ClienteEndereco, Patrimonial>((ClienteEndereco e) => {
+ Patrimonial patrimonial = new Patrimonial();
+ patrimonial.set_Endereco(e.get_Endereco());
+ patrimonial.set_Numero(e.get_Numero());
+ patrimonial.set_Complemento(e.get_Complemento());
+ patrimonial.set_Bairro(e.get_Bairro());
+ patrimonial.set_Cidade(e.get_Cidade());
+ patrimonial.set_Estado(e.get_Estado());
+ patrimonial.set_Cep(e.get_Cep());
+ return patrimonial;
+ }).ToList<Patrimonial>();
+ Item item5 = item4;
+ if (list.Any<Patrimonial>())
+ {
+ patrimonial1 = list.Last<Patrimonial>();
+ }
+ else
+ {
+ patrimonial1 = null;
+ }
+ item5.set_Patrimonial(patrimonial1);
+ }
+ }
+ ordem = item4.get_Ordem();
+ if (ordem.GetValueOrDefault() == 2)
+ {
+ if (!await base.ShowMessage("ESTA APÓLICE SERÁ UMA FROTA, DESEJA CONTINUAR?", "SIM", "NÃO", false))
+ {
+ coberturas1 = null;
+ item4 = null;
+ return;
+ }
+ }
+ this.SelectedItem = item4;
+ this.SelectedItem.get_Patrimonial().set_Item(item4);
+ ordem = item4.get_Ordem();
+ int num = 1;
+ garantia = ordem.GetValueOrDefault() > num & ordem.HasValue;
+ if (garantia)
+ {
+ garantia = await base.ShowMessage("DESEJA REPLICAR AS COBERTURAS DO ITEM SELECIONADO?", "SIM", "NÃO", false);
+ }
+ if (!garantia)
+ {
+ this.CoberturaViewModel.CarregaPadrao();
+ }
+ else
+ {
+ this.CoberturaViewModel.Coberturas = new ObservableCollection<Gestor.Model.Domain.Seguros.Cobertura>();
+ coberturas1.ForEach((Gestor.Model.Domain.Seguros.Cobertura x) => {
+ x.set_Item(this.SelectedItem);
+ this.CoberturaViewModel.Coberturas.Add(x);
+ });
+ }
+ if (substituir)
+ {
+ this.CoberturaViewModel.Coberturas = new ObservableCollection<Gestor.Model.Domain.Seguros.Cobertura>();
+ coberturas1.ForEach((Gestor.Model.Domain.Seguros.Cobertura x) => {
+ x.set_Item(this.SelectedItem);
+ this.CoberturaViewModel.Coberturas.Add(x);
+ });
+ }
+ base.Alterar(true);
+ coberturas1 = null;
+ item4 = null;
+ }
+
+ public void Manter(Item item, ManutencaoItem manutencao)
+ {
+ if (manutencao.get_Tipo() == 1)
+ {
+ base.ItemSubstituido = item;
+ }
+ this.Manter(manutencao);
+ base.Mantido = true;
+ }
+
+ public void Manter(ManutencaoItem manutencao)
+ {
+ long? nullable;
+ object list;
+ ObservableCollection<Gestor.Model.Domain.Seguros.Cobertura> coberturas = this.CoberturaViewModel.Coberturas;
+ if (coberturas != null)
+ {
+ list = coberturas.ToList<Gestor.Model.Domain.Seguros.Cobertura>();
+ }
+ else
+ {
+ list = null;
+ }
+ this.SelectedItem.set_Id((long)0);
+ this.SelectedItem.get_Patrimonial().set_Id((long)0);
+ Item selectedItem = this.SelectedItem;
+ Item itemSubstituido = base.ItemSubstituido;
+ if (itemSubstituido != null)
+ {
+ nullable = new long?(itemSubstituido.get_Id());
+ }
+ else
+ {
+ nullable = null;
+ }
+ selectedItem.set_Substituicao(nullable);
+ this.SelectedItem.set_Documento(this.ItemSelecionado.get_Documento());
+ if (manutencao.get_Tipo() == null)
+ {
+ this.SelectedItem.set_Sinistrado(false);
+ this.SelectedItem.set_Status("");
+ this.SelectedItem.set_Sinistro(null);
+ this.SelectedItem.set_Sinistros(null);
+ }
+ this.CoberturaViewModel.CarregaPadrao();
+ this.CoberturaViewModel.Coberturas = new ObservableCollection<Gestor.Model.Domain.Seguros.Cobertura>();
+ if (list != null)
+ {
+ ((List<Gestor.Model.Domain.Seguros.Cobertura>)list).ForEach((Gestor.Model.Domain.Seguros.Cobertura x) => {
+ x.set_Item(this.SelectedItem);
+ this.CoberturaViewModel.Coberturas.Add(x);
+ });
+ }
+ else
+ {
+ }
+ base.Alterar(true);
+ }
+
+ public async Task<List<KeyValuePair<string, string>>> Salvar()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs;
+ string descricao;
+ string str;
+ string str1;
+ string str2;
+ string str3;
+ Item selectedItem = this.SelectedItem;
+ if (this.VisibilityPatrimonial == Visibility.Visible)
+ {
+ string[] endereco = new string[] { this.SelectedItem.get_Patrimonial().get_Endereco(), ", ", this.SelectedItem.get_Patrimonial().get_Numero(), " - ", this.SelectedItem.get_Patrimonial().get_Complemento(), " - ", this.SelectedItem.get_Patrimonial().get_Bairro(), ", ", this.SelectedItem.get_Patrimonial().get_Cidade(), " / ", this.SelectedItem.get_Patrimonial().get_Estado() };
+ descricao = string.Concat(endereco);
+ }
+ else
+ {
+ descricao = this.SelectedItem.get_Descricao();
+ }
+ selectedItem.set_Descricao(descricao);
+ List<KeyValuePair<string, string>> keyValuePairs1 = this.SelectedItem.Validate();
+ if (keyValuePairs1.Count <= 0)
+ {
+ Item item = this.SelectedItem;
+ item.set_Coberturas(await this.CoberturaViewModel.LimpaCoberturas());
+ item = null;
+ if (this.SelectedItem.get_Documento().get_Ordem() <= 0)
+ {
+ str = "";
+ }
+ else if (base.Mantido)
+ {
+ str = string.Format("ITEM ALTERADO NO ENDOSSO ORDEM {0}", this.SelectedItem.get_Documento().get_Ordem());
+ }
+ else
+ {
+ str = (base.ItemSubstituido != null ? string.Format("SUBSTITUIÇÃO DO ITEM {0} NO ENDOSSO ORDEM {1}", base.ItemSubstituido.get_Ordem(), this.SelectedItem.get_Documento().get_Ordem()) : string.Format("ITEM INCLUÍDO NO ENDOSSO ORDEM {0}", this.SelectedItem.get_Documento().get_Ordem()));
+ }
+ string str4 = str;
+ if (this.SelectedItem.get_Id() == 0)
+ {
+ this.SelectedItem.set_Status(str4);
+ }
+ str1 = (this.SelectedItem.get_Id() == 0 ? "INCLUIU" : "ALTEROU");
+ str3 = str1;
+ this.SelectedItem = await this._itemServico.Save(this.SelectedItem);
+ if (this._itemServico.Sucesso)
+ {
+ if (base.ItemSubstituido != null)
+ {
+ str2 = (base.Mantido ? string.Format("ITEM ALTERADO NO ENDOSSO ORDEM {0}", this.SelectedItem.get_Documento().get_Ordem()) : string.Format("ITEM SUBSTITUIDO NO ENDOSSO ORDEM {0}", this.SelectedItem.get_Documento().get_Ordem()));
+ string str5 = str2;
+ await this._itemServico.Substituir(base.ItemSubstituido, this.SelectedItem.get_Id(), str5);
+ }
+ base.Mantido = false;
+ await this.SelecionaItem(this.SelectedItem, false);
+ this.ItemSelecionado = this.SelectedItem;
+ if (this.Invoke)
+ {
+ ConsultaViewModel.ItemSelecionado = this.SelectedItem;
+ }
+ base.ToggleSnackBar(string.Concat(this.Ramo.get_Nome(), " SALVO COM SUCESSO"), true);
+ string str6 = string.Concat(str3, " ITEM DE DESCRIÇÃO \"", this.SelectedItem.get_Descricao(), "\"");
+ long id = this.SelectedItem.get_Id();
+ TipoTela? nullable = new TipoTela?(3);
+ object[] objArray = new object[] { this.SelectedItem.get_Id(), this.SelectedItem.get_Documento().get_Id(), this.SelectedItem.get_Documento().get_Controle().get_Ramo().get_Nome(), this.SelectedItem.get_Documento().get_Controle().get_Cliente().get_Nome(), this.SelectedItem.get_Documento().get_Controle().get_Cliente().get_Id() };
+ base.RegistrarAcao(str6, id, nullable, string.Format("ID ITEM: {0}\nID DOCUMENTO: {1}\nRAMO: {2}\nCLIENTE: {3}\nID CLIENTE: {4}", objArray));
+ base.Alterar(false);
+ keyValuePairs = null;
+ }
+ else
+ {
+ keyValuePairs = null;
+ }
+ }
+ else
+ {
+ keyValuePairs = keyValuePairs1;
+ }
+ str3 = null;
+ return keyValuePairs;
+ }
+
+ private async void Seleciona(Item item)
+ {
+ base.Loading(true);
+ await base.PermissaoTela(3);
+ await this.SelecionaItem(item, true);
+ base.Loading(false);
+ }
+
+ public async Task SelecionaItem(Item item, bool registrar = true)
+ {
+ Visibility visibility;
+ Visibility visibility1;
+ if (item == null || this.LastAccessId != item.get_Id() || this.LastAccessTela != 9)
+ {
+ base.Mantido = false;
+ List<long> nums = new List<long>()
+ {
+ (long)1,
+ (long)2,
+ (long)3,
+ (long)15,
+ (long)18,
+ (long)30,
+ (long)38
+ };
+ if (nums.Contains(this.Ramo.get_Id()))
+ {
+ PatrimonialViewModel patrimonialViewModel = this;
+ visibility = (this.Ramo.get_Id() == (long)1 ? Visibility.Visible : Visibility.Collapsed);
+ patrimonialViewModel.VisibilityTipoMoradia = visibility;
+ this.CoberturaViewModel.Ramo = this.Ramo;
+ if (this.CoberturaViewModel.CoberturasPadrao == null)
+ {
+ await this.CoberturaViewModel.SelectionaCoberturas();
+ }
+ PatrimonialViewModel patrimonialViewModel1 = this;
+ visibility1 = (this.Ramo.get_Id() == (long)15 || this.Ramo.get_Id() == (long)38 ? Visibility.Visible : Visibility.Collapsed);
+ patrimonialViewModel1.VisibilityFianca = visibility1;
+ if (this.Ramo.get_Id() == (long)38)
+ {
+ this.HabilitaCamposGarantia();
+ }
+ if (item == null || item.get_Id() == 0)
+ {
+ this.SelectedItem = null;
+ this.CoberturaViewModel.Coberturas = null;
+ base.IsVisible = Visibility.Visible;
+ }
+ else
+ {
+ base.Loading(true);
+ item = await this._itemServico.BuscarItemPorIdAsync(item.get_Id());
+ Item item1 = item;
+ Patrimonial patrimonial = await this._itemServico.BuscaPatrimonial(item.get_Id());
+ item1.set_Patrimonial(patrimonial);
+ item1 = null;
+ this.SelectedItem = item;
+ this.SelectedItem.Initialize();
+ this.Initialized = true;
+ this.CoberturaViewModel.Item = item;
+ await this.CoberturaViewModel.CancelarAlteracao();
+ if (registrar)
+ {
+ string str = string.Concat("ACESSOU ITEM DE DESCRIÇÃO \"", this.SelectedItem.get_Descricao(), "\"");
+ long id = this.SelectedItem.get_Id();
+ TipoTela? nullable = new TipoTela?(3);
+ object[] objArray = new object[] { this.SelectedItem.get_Id(), this.SelectedItem.get_Documento().get_Id(), this.SelectedItem.get_Documento().get_Controle().get_Ramo().get_Nome(), this.SelectedItem.get_Documento().get_Controle().get_Cliente().get_Nome(), this.SelectedItem.get_Documento().get_Controle().get_Cliente().get_Id() };
+ base.RegistrarAcao(str, id, nullable, string.Format("ID ITEM: {0}\nID DOCUMENTO: {1}\nRAMO: {2}\nCLIENTE: {3}\nID CLIENTE: {4}", objArray));
+ }
+ this.LastAccessId = this.SelectedItem.get_Id();
+ this.LastAccessTela = 3;
+ this.CodigoItem = this.SelectedItem.get_Id().ToString();
+ base.Loading(false);
+ }
+ }
+ }
+ }
+
+ public async void Substituir(Item item)
+ {
+ base.ItemSubstituido = item;
+ await this.Incluir(true);
+ }
+ }
+}
\ No newline at end of file |