diff options
Diffstat (limited to 'Gestor.Model/Model.Domain.Ferramentas')
19 files changed, 2512 insertions, 0 deletions
diff --git a/Gestor.Model/Model.Domain.Ferramentas/Agenda.cs b/Gestor.Model/Model.Domain.Ferramentas/Agenda.cs new file mode 100644 index 0000000..263f0bc --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/Agenda.cs @@ -0,0 +1,178 @@ +using Gestor.Model.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Gestor.Model.Validation;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class Agenda : DomainBase, IDomain
+ {
+ public string Bairro
+ {
+ get;
+ set;
+ }
+
+ public string Cep
+ {
+ get;
+ set;
+ }
+
+ public string Cidade
+ {
+ get;
+ set;
+ }
+
+ public string Complemento
+ {
+ get;
+ set;
+ }
+
+ public ObservableCollection<AgendaEmail> Emails
+ {
+ get;
+ set;
+ }
+
+ public string Endereco
+ {
+ get;
+ set;
+ }
+
+ public string Estado
+ {
+ get;
+ set;
+ }
+
+ public string Nome
+ {
+ get;
+ set;
+ }
+
+ public string Numero
+ {
+ get;
+ set;
+ }
+
+ public string Observacao
+ {
+ get;
+ set;
+ }
+
+ public ObservableCollection<AgendaTelefone> Telefones
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Agenda agenda = this;
+ return new Func<List<KeyValuePair<string, string>>>(agenda.Validate);
+ }
+ }
+
+ public Agenda()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ string description;
+ List<TupleList> tupleLists = new List<TupleList>()
+ {
+ new TupleList()
+ {
+ Tuples = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("NOME", (string.IsNullOrWhiteSpace(this.Nome) ? "" : this.Nome), ""),
+ new Tuple<string, string, string>("CEP", (string.IsNullOrWhiteSpace(this.Cep) ? "" : this.Cep), ""),
+ new Tuple<string, string, string>("ENDEREÇO", (string.IsNullOrWhiteSpace(this.Endereco) ? "" : this.Endereco), ""),
+ new Tuple<string, string, string>("NÚMERO", (string.IsNullOrWhiteSpace(this.Numero) ? "" : this.Numero), ""),
+ new Tuple<string, string, string>("COMPLEMENTO", (string.IsNullOrWhiteSpace(this.Complemento) ? "" : this.Complemento), ""),
+ new Tuple<string, string, string>("BAIRRO", (string.IsNullOrWhiteSpace(this.Bairro) ? "" : this.Bairro), ""),
+ new Tuple<string, string, string>("CIDADE", (string.IsNullOrWhiteSpace(this.Cidade) ? "" : this.Cidade), ""),
+ new Tuple<string, string, string>("ESTADO", (string.IsNullOrWhiteSpace(this.Estado) ? "" : this.Estado), ""),
+ new Tuple<string, string, string>("OBSERVAÇÕES", (string.IsNullOrWhiteSpace(this.Observacao) ? "" : this.Observacao), "")
+ }
+ }
+ };
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("TELEFONES$", "", "")
+ };
+ foreach (AgendaTelefone telefone in this.Telefones)
+ {
+ observableCollection.Add(new Tuple<string, string, string>(string.Format(" TELEFONE {0}$", this.Telefones.IndexOf(telefone) + 1), "", ""));
+ ObservableCollection<Tuple<string, string, string>> observableCollection1 = observableCollection;
+ TipoTelefone? tipo = telefone.Tipo;
+ if (!tipo.HasValue)
+ {
+ description = "";
+ }
+ else
+ {
+ tipo = telefone.Tipo;
+ if (tipo.HasValue)
+ {
+ description = tipo.GetValueOrDefault().GetDescription();
+ }
+ else
+ {
+ description = null;
+ }
+ }
+ observableCollection1.Add(new Tuple<string, string, string>(" TIPO", description, ""));
+ observableCollection.Add(new Tuple<string, string, string>(" PREFIXO", (string.IsNullOrWhiteSpace(telefone.Prefixo) ? "" : telefone.Prefixo.ToUpper()), ""));
+ observableCollection.Add(new Tuple<string, string, string>(" NÚMERO", (string.IsNullOrWhiteSpace(telefone.Numero) ? "" : telefone.Numero), ""));
+ observableCollection.Add(new Tuple<string, string, string>(" DESCRIÇÃO", (string.IsNullOrWhiteSpace(telefone.Observacao) ? "" : telefone.Observacao), ""));
+ }
+ tupleLists.Add(new TupleList()
+ {
+ Tuples = observableCollection
+ });
+ ObservableCollection<Tuple<string, string, string>> observableCollection2 = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("EMAILS$", "", "")
+ };
+ foreach (AgendaEmail email in this.Emails)
+ {
+ observableCollection2.Add(new Tuple<string, string, string>(string.Format(" EMAIL {0}$", this.Emails.IndexOf(email) + 1), "", ""));
+ observableCollection2.Add(new Tuple<string, string, string>(" ENDEREÇO DE EMAIL", (string.IsNullOrWhiteSpace(email.Email) ? "" : email.Email), ""));
+ }
+ tupleLists.Add(new TupleList()
+ {
+ Tuples = observableCollection2
+ });
+ return tupleLists;
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (string.IsNullOrWhiteSpace(this.Nome))
+ {
+ keyValuePairs.AddValue<string, string>("Nome", Messages.Obrigatorio, true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/AgendaEmail.cs b/Gestor.Model/Model.Domain.Ferramentas/AgendaEmail.cs new file mode 100644 index 0000000..b3cfd4c --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/AgendaEmail.cs @@ -0,0 +1,57 @@ +using Gestor.Model.Domain.Generic;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class AgendaEmail : EmailBase, IDomain
+ {
+ public Gestor.Model.Domain.Ferramentas.Agenda Agenda
+ {
+ get;
+ set;
+ }
+
+ public bool Selecionado
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ AgendaEmail agendaEmail = this;
+ return new Func<List<KeyValuePair<string, string>>>(agendaEmail.Validate);
+ }
+ }
+
+ public AgendaEmail()
+ {
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (string.IsNullOrWhiteSpace(base.Email))
+ {
+ keyValuePairs.AddValue<string, string>("Email", Messages.Obrigatorio, true);
+ }
+ else if (base.Email.Length > 80)
+ {
+ keyValuePairs.AddValue<string, string>("Email", string.Format(Messages.MaiorQueLimite, 80), true);
+ }
+ else if (!base.Email.ValidacaoEmail())
+ {
+ keyValuePairs.AddValue<string, string>("Email", Messages.Invalido, true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/AgendaTelefone.cs b/Gestor.Model/Model.Domain.Ferramentas/AgendaTelefone.cs new file mode 100644 index 0000000..49d2c6d --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/AgendaTelefone.cs @@ -0,0 +1,42 @@ +using Gestor.Model.Domain.Generic;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class AgendaTelefone : TelefoneBase, IDomain
+ {
+ public Gestor.Model.Domain.Ferramentas.Agenda Agenda
+ {
+ get;
+ set;
+ }
+
+ public string Observacao
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ AgendaTelefone agendaTelefone = this;
+ return new Func<List<KeyValuePair<string, string>>>(agendaTelefone.Validate);
+ }
+ }
+
+ public AgendaTelefone()
+ {
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ return base.ValidateBase(true);
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/CategoriaTarefa.cs b/Gestor.Model/Model.Domain.Ferramentas/CategoriaTarefa.cs new file mode 100644 index 0000000..7fbc293 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/CategoriaTarefa.cs @@ -0,0 +1,19 @@ +using Gestor.Model.Domain.Generic;
+using System;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class CategoriaTarefa : DomainBase
+ {
+ public string Descricao
+ {
+ get;
+ set;
+ }
+
+ public CategoriaTarefa()
+ {
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/Credencial.cs b/Gestor.Model/Model.Domain.Ferramentas/Credencial.cs new file mode 100644 index 0000000..a6e7464 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/Credencial.cs @@ -0,0 +1,278 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using System.Text.RegularExpressions;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class Credencial : DomainBase, IDomain
+ {
+ private string _descricao;
+
+ private string _assinatura;
+
+ private string _header;
+
+ private string _cabecalho;
+
+ [Description("ASSINATURA")]
+ [Log(true)]
+ public string Assinatura
+ {
+ get
+ {
+ return this._assinatura;
+ }
+ set
+ {
+ this._assinatura = value ?? "";
+ }
+ }
+
+ public string Cabecalho
+ {
+ get
+ {
+ return this._cabecalho;
+ }
+ set
+ {
+ this._cabecalho = value ?? "";
+ }
+ }
+
+ [Description("DESCRIÇÃO")]
+ [Log(true)]
+ public string Descricao
+ {
+ get
+ {
+ string str = this._descricao;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._descricao = value;
+ }
+ }
+
+ [Description("DOMÍNIO")]
+ [Log(true)]
+ public string Dominio
+ {
+ get;
+ set;
+ }
+
+ [Description("E-MAIL")]
+ [Log(true)]
+ public string Email
+ {
+ get;
+ set;
+ }
+
+ public bool Excluido
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Header
+ {
+ get
+ {
+ return this._header;
+ }
+ set
+ {
+ this._header = value;
+ }
+ }
+
+ public long IdEmpresa
+ {
+ get;
+ set;
+ }
+
+ public long IdUsuario
+ {
+ get;
+ set;
+ }
+
+ [Description("PORTA")]
+ [Log(true)]
+ public int? Porta
+ {
+ get;
+ set;
+ }
+
+ public string Replyto
+ {
+ get;
+ set;
+ }
+
+ [Description("SEGURO")]
+ [Log(true)]
+ public bool Seguro
+ {
+ get;
+ set;
+ }
+
+ [Description("SENHA")]
+ [Log(true)]
+ public string Senha
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public TipoEmail Tipo
+ {
+ get;
+ set;
+ }
+
+ [Description("USUÁRIO")]
+ [Log(true)]
+ public string Usuario
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Credencial credencial = this;
+ return new Func<List<KeyValuePair<string, string>>>(credencial.Validate);
+ }
+ }
+
+ public Credencial()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ string str;
+ List<TupleList> tupleLists = new List<TupleList>();
+ this.Assinatura = (new Regex("<title>.*<\\/title>")).Replace(this.Assinatura, "").Trim();
+ this.Assinatura = (new Regex("(<[^>]*>)|(p\\s?{[^}]*})|(\\r)|(\\n)")).Replace(this.Assinatura, "").Trim();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("DESCRIÇÃO", (string.IsNullOrWhiteSpace(this.Descricao) ? "" : this.Descricao), "")
+ };
+ int? porta = this.Porta;
+ if (!porta.HasValue)
+ {
+ str = "";
+ }
+ else
+ {
+ porta = this.Porta;
+ if (porta.HasValue)
+ {
+ str = porta.GetValueOrDefault().ToString();
+ }
+ else
+ {
+ str = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("PORTA", str, ""));
+ observableCollection.Add(new Tuple<string, string, string>("DOMÍNIO", (string.IsNullOrWhiteSpace(this.Dominio) ? "" : this.Dominio), ""));
+ observableCollection.Add(new Tuple<string, string, string>("E-MAIL", (string.IsNullOrWhiteSpace(this.Email) ? "" : this.Email), ""));
+ observableCollection.Add(new Tuple<string, string, string>("LOGIN", (string.IsNullOrWhiteSpace(this.Usuario) ? "" : this.Usuario), ""));
+ observableCollection.Add(new Tuple<string, string, string>("CERTIFICADO DE SEGURANÇA", (this.Seguro ? "SIM" : "NÃO"), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ASSINATURA", (string.IsNullOrWhiteSpace(this.Assinatura) ? "" : this.Assinatura), ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ return tupleLists;
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (string.IsNullOrEmpty(this.Descricao))
+ {
+ keyValuePairs.AddValue<string, string>("Descricao|DESCRIÇÃO", Messages.Obrigatorio, true);
+ }
+ else if (this.Descricao.Length > 50)
+ {
+ keyValuePairs.AddValue<string, string>("Descricao|DESCRIÇÃO", string.Format(Messages.MaiorQueLimite, 50), true);
+ }
+ if (this.Tipo == TipoEmail.Outros)
+ {
+ if (!this.Porta.HasValue)
+ {
+ keyValuePairs.AddValue<string, string>("Porta", Messages.Invalido, true);
+ }
+ if (string.IsNullOrWhiteSpace(this.Dominio))
+ {
+ keyValuePairs.AddValue<string, string>("Dominio|DOMÍNIO", Messages.Obrigatorio, true);
+ }
+ else if (this.Dominio.Length > 80)
+ {
+ keyValuePairs.AddValue<string, string>("Dominio|DOMÍNIO", string.Format(Messages.MaiorQueLimite, 80), true);
+ }
+ if (string.IsNullOrEmpty(this.Usuario))
+ {
+ keyValuePairs.AddValue<string, string>("Usuario|USUÁRIO", Messages.Obrigatorio, true);
+ }
+ else if (this.Usuario.Length > 50)
+ {
+ keyValuePairs.AddValue<string, string>("Usuario|USUÁRIO", string.Format(Messages.MaiorQueLimite, 50), true);
+ }
+ if (string.IsNullOrEmpty(this.Senha))
+ {
+ keyValuePairs.AddValue<string, string>("Senha", Messages.Obrigatorio, true);
+ }
+ else if (this.Senha.Length > 50)
+ {
+ keyValuePairs.AddValue<string, string>("Senha", string.Format(Messages.MaiorQueLimite, 50), true);
+ }
+ }
+ if (string.IsNullOrWhiteSpace(this.Email))
+ {
+ keyValuePairs.AddValue<string, string>("Email|E-MAIL", Messages.Obrigatorio, true);
+ }
+ else if (this.Email.Length > 80)
+ {
+ keyValuePairs.AddValue<string, string>("Email|E-MAIL", string.Format(Messages.MaiorQueLimite, 80), true);
+ }
+ else if (!this.Email.ValidacaoEmail())
+ {
+ keyValuePairs.AddValue<string, string>("Email|E-MAIL", Messages.Invalido, true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.Replyto) && !this.Replyto.ValidacaoEmail())
+ {
+ keyValuePairs.AddValue<string, string>("Replyto|RESPONDER PARA", Messages.Obrigatorio, true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/Destinatario.cs b/Gestor.Model/Model.Domain.Ferramentas/Destinatario.cs new file mode 100644 index 0000000..c3fad19 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/Destinatario.cs @@ -0,0 +1,63 @@ +using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Generic;
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class Destinatario : DomainBase
+ {
+ public List<ArquivoDigital> Anexos
+ {
+ get;
+ set;
+ }
+
+ public string Assunto
+ {
+ get;
+ set;
+ }
+
+ public string Corpo
+ {
+ get;
+ set;
+ }
+
+ public string Email
+ {
+ get;
+ set;
+ }
+
+ public List<string> Encaminhar
+ {
+ get;
+ set;
+ }
+
+ public List<string> EncaminharOculto
+ {
+ get;
+ set;
+ }
+
+ public string Nome
+ {
+ get;
+ set;
+ }
+
+ public string Sobrenome
+ {
+ get;
+ set;
+ }
+
+ public Destinatario()
+ {
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/Fase.cs b/Gestor.Model/Model.Domain.Ferramentas/Fase.cs new file mode 100644 index 0000000..1694170 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/Fase.cs @@ -0,0 +1,44 @@ +using Gestor.Model.Domain.Generic;
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class Fase : DomainBase
+ {
+ public string Descricao
+ {
+ get;
+ set;
+ }
+
+ public DateTime? Expiracao
+ {
+ get;
+ set;
+ }
+
+ public List<Tarefa> Tarefas
+ {
+ get;
+ set;
+ }
+
+ public string Titulo
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Ferramentas.Trilha Trilha
+ {
+ get;
+ set;
+ }
+
+ public Fase()
+ {
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs b/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs new file mode 100644 index 0000000..7a65e49 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs @@ -0,0 +1,177 @@ +using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class Imposto : DomainBase, IDomain
+ {
+ public bool Ativo
+ {
+ get;
+ set;
+ }
+
+ public decimal Desconto
+ {
+ get;
+ set;
+ }
+
+ public decimal Ir
+ {
+ get;
+ set;
+ }
+
+ public decimal Iss
+ {
+ get;
+ set;
+ }
+
+ public decimal Outros
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Ramo Ramo
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Seguradora Seguradora
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Imposto imposto = this;
+ return new Func<List<KeyValuePair<string, string>>>(imposto.Validate);
+ }
+ }
+
+ public Imposto()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ object nome;
+ object nomeSocial;
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>();
+ Gestor.Model.Domain.Seguros.Ramo ramo = this.Ramo;
+ if (ramo != null)
+ {
+ nome = ramo.Nome;
+ }
+ else
+ {
+ nome = null;
+ }
+ if (nome == null)
+ {
+ nome = "";
+ }
+ observableCollection.Add(new Tuple<string, string, string>("RAMO", nome, ""));
+ Gestor.Model.Domain.Seguros.Seguradora seguradora = this.Seguradora;
+ if (seguradora != null)
+ {
+ nomeSocial = seguradora.NomeSocial;
+ }
+ else
+ {
+ nomeSocial = null;
+ }
+ if (nomeSocial == null)
+ {
+ Gestor.Model.Domain.Seguros.Seguradora seguradora1 = this.Seguradora;
+ if (seguradora1 != null)
+ {
+ nomeSocial = seguradora1.Nome;
+ }
+ else
+ {
+ nomeSocial = null;
+ }
+ if (nomeSocial == null)
+ {
+ nomeSocial = "";
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("SEGURADORA", nomeSocial, ""));
+ decimal ir = this.Ir;
+ observableCollection.Add(new Tuple<string, string, string>("IR", ir.ToString("p"), ""));
+ ir = this.Iss;
+ observableCollection.Add(new Tuple<string, string, string>("ISS", ir.ToString("p"), ""));
+ ir = this.Outros;
+ observableCollection.Add(new Tuple<string, string, string>("OUTROS", ir.ToString("p"), ""));
+ ir = this.Desconto;
+ observableCollection.Add(new Tuple<string, string, string>("DESCONTO", ir.ToString("p"), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ATIVO", (this.Ativo ? "SIM" : "NÃO"), ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ return tupleLists;
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (this.Ir > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM IR", "O VALOR DE IR NÃO PODE SER MAIOR QUE 100%.", true);
+ }
+ if (this.Iss > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Iss|PORCENTAGEM ISS", "O VALOR DE ISS NÃO PODE SER MAIOR QUE 100%.", true);
+ }
+ if (this.Outros > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Outros|PORCENTAGEM OUTROS", "O VALOR DOS OUTROS DESCONTOS NÃO PODE SER MAIOR QUE 100%.", true);
+ }
+ if (this.Desconto > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Desconto|PORCENTAGEM DESCONTO", "O VALOR DE DESCONTO NÃO PODE SER MAIOR QUE 100%.", true);
+ }
+ if (this.Ir < decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM IR", "O VALOR DE IR NÃO PODE SER MENOR QUE 0%.", true);
+ }
+ if (this.Iss < decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Iss|PORCENTAGEM ISS", "O VALOR DE ISS NÃO PODE SER MENOR QUE 0%.", true);
+ }
+ if (this.Outros < decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Outros|PORCENTAGEM OUTROS", "O VALOR DOS OUTROS DESCONTOS NÃO PODE SER MENOR QUE 0%.", true);
+ }
+ if (this.Desconto < decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Desconto|PORCENTAGEM DESCONTO", "O VALOR DE DESCONTO NÃO PODE SER MENOR QUE 0%.", true);
+ }
+ if ((((this.Ir + this.Iss) + this.Outros) + this.Desconto) > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM TOTAL", "NÃO É POSSÍVEL DEDUZIR MAIS QUE 100% DO TOTAL RECEBIDO.", true);
+ }
+ if ((((this.Ir + this.Iss) + this.Outros) + this.Desconto) == decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM TOTAL", "A SOMA DOS IMPOSTOS DEVEM SER MAIOR QUE 0 (ZERO).", true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/LogEmail.cs b/Gestor.Model/Model.Domain.Ferramentas/LogEmail.cs new file mode 100644 index 0000000..a884b02 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/LogEmail.cs @@ -0,0 +1,157 @@ +using Gestor.Model.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Validation;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.CompilerServices;
+using System.Text.RegularExpressions;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class LogEmail : DomainBase
+ {
+ public string Anexos
+ {
+ get;
+ set;
+ }
+
+ public string Assunto
+ {
+ get;
+ set;
+ }
+
+ public string Cco
+ {
+ get;
+ set;
+ }
+
+ public string Corpo
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Ferramentas.Credencial Credencial
+ {
+ get;
+ set;
+ }
+
+ public DateTime Data
+ {
+ get;
+ set;
+ }
+
+ public string Destinatarios
+ {
+ get;
+ set;
+ }
+
+ public long EntityId
+ {
+ get;
+ set;
+ }
+
+ public string Ip
+ {
+ get;
+ set;
+ }
+
+ public string NomeMaquina
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Common.Relatorio Relatorio
+ {
+ get;
+ set;
+ }
+
+ public TipoTela Tela
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Usuario Usuario
+ {
+ get;
+ set;
+ }
+
+ public string UsuarioMaquina
+ {
+ get;
+ set;
+ }
+
+ public string Versao
+ {
+ get;
+ set;
+ }
+
+ public LogEmail()
+ {
+ }
+
+ public List<TupleList> CriarLogEmail()
+ {
+ string email;
+ string str;
+ this.Corpo = (new Regex("<title>.*<\\/title>")).Replace(this.Corpo, "").Trim();
+ this.Corpo = (new Regex("(<[^>]*>)|(p\\s?{[^}]*})|(\\r)|(\\n)")).Replace(this.Corpo, "").Trim();
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("ASSUNTO", (string.IsNullOrWhiteSpace(this.Assunto) ? "" : this.Assunto), ""),
+ new Tuple<string, string, string>("CORPO", (string.IsNullOrWhiteSpace(this.Corpo) ? "" : this.Corpo), "")
+ };
+ Gestor.Model.Domain.Ferramentas.Credencial credencial = this.Credencial;
+ if (credencial != null)
+ {
+ email = credencial.Email;
+ }
+ else
+ {
+ email = null;
+ }
+ if (string.IsNullOrWhiteSpace(email))
+ {
+ str = "";
+ }
+ else
+ {
+ Gestor.Model.Domain.Ferramentas.Credencial credencial1 = this.Credencial;
+ if (credencial1 != null)
+ {
+ str = credencial1.Email;
+ }
+ else
+ {
+ str = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("E-MAIL DE ENVIO", str, ""));
+ observableCollection.Add(new Tuple<string, string, string>("DESTINATÁRIOS", (string.IsNullOrWhiteSpace(this.Destinatarios) ? "" : this.Destinatarios), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ANEXOS", (string.IsNullOrWhiteSpace(this.Anexos) ? "" : this.Anexos), ""));
+ observableCollection.Add(new Tuple<string, string, string>("CCO", (string.IsNullOrWhiteSpace(this.Cco) ? "" : this.Cco), ""));
+ observableCollection.Add(new Tuple<string, string, string>("RELATORIO", (string.IsNullOrWhiteSpace(this.Relatorio.GetDescription()) ? "" : this.Relatorio.GetDescription()), ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ return tupleLists;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/LogEnvio.cs b/Gestor.Model/Model.Domain.Ferramentas/LogEnvio.cs new file mode 100644 index 0000000..c01bfee --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/LogEnvio.cs @@ -0,0 +1,36 @@ +using System;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class LogEnvio
+ {
+ public Gestor.Model.Domain.Ferramentas.Credencial Credencial
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Ferramentas.Destinatario Destinatario
+ {
+ get;
+ set;
+ }
+
+ public bool Enviado
+ {
+ get;
+ set;
+ }
+
+ public string Erro
+ {
+ get;
+ set;
+ }
+
+ public LogEnvio()
+ {
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/ManutencaoPagamentos.cs b/Gestor.Model/Model.Domain.Ferramentas/ManutencaoPagamentos.cs new file mode 100644 index 0000000..5690621 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/ManutencaoPagamentos.cs @@ -0,0 +1,361 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Common;
+using System;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using System.Threading;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class ManutencaoPagamentos : INotifyPropertyChanged
+ {
+ private bool _isExpanded;
+
+ private bool _selecionado;
+
+ private string _nome;
+
+ private string _empresa;
+
+ private string _apolice;
+
+ private string _endosso;
+
+ private string _seguradora;
+
+ private string _ramo;
+
+ private string _produto;
+
+ private SubTipo _tipo;
+
+ private decimal _valorRepasse;
+
+ private DateTime _pagamento;
+
+ private DateTime _previsaoPagamento;
+
+ private string _vendedor;
+
+ private decimal _valor;
+
+ private DateTime? _recebimento;
+
+ private int _parcela;
+
+ [Description("APÓLICE")]
+ public string Apolice
+ {
+ get
+ {
+ string str = this._apolice;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._apolice = value;
+ this.OnPropertyChanged("Apolice");
+ }
+ }
+
+ [Description("EMPRESA")]
+ public string Empresa
+ {
+ get
+ {
+ string str = this._empresa;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._empresa = value;
+ this.OnPropertyChanged("Empresa");
+ }
+ }
+
+ [Description("ENDOSSO")]
+ public string Endosso
+ {
+ get
+ {
+ string str = this._endosso;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._endosso = value;
+ this.OnPropertyChanged("Endosso");
+ }
+ }
+
+ [Tipo("INVALID")]
+ public long Id
+ {
+ get;
+ set;
+ }
+
+ [Tipo("INVALID")]
+ public long IdDocumento
+ {
+ get;
+ set;
+ }
+
+ [Tipo("INVALID")]
+ public long IdParcela
+ {
+ get;
+ set;
+ }
+
+ [Tipo("INVALID")]
+ public bool IsExpanded
+ {
+ get
+ {
+ return this._isExpanded;
+ }
+ set
+ {
+ this._isExpanded = value;
+ this.OnPropertyChanged("IsExpanded");
+ }
+ }
+
+ [Description("CLIENTE")]
+ public string Nome
+ {
+ get
+ {
+ string str = this._nome;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._nome = value;
+ this.OnPropertyChanged("Nome");
+ }
+ }
+
+ [Description("DATA DE PAGAMENTO")]
+ public DateTime Pagamento
+ {
+ get
+ {
+ return this._pagamento;
+ }
+ set
+ {
+ this._pagamento = value;
+ this.OnPropertyChanged("Pagamento");
+ }
+ }
+
+ [Description("PARCELA")]
+ public int Parcela
+ {
+ get
+ {
+ return this._parcela;
+ }
+ set
+ {
+ this._parcela = value;
+ this.OnPropertyChanged("Parcela");
+ }
+ }
+
+ [Description("PREVISÃO DE PAGAMENTO")]
+ public DateTime PrevisaoPagamento
+ {
+ get
+ {
+ return this._previsaoPagamento;
+ }
+ set
+ {
+ this._previsaoPagamento = value;
+ this.OnPropertyChanged("PrevisaoPagamento");
+ }
+ }
+
+ [Description("PRODUTO")]
+ public string Produto
+ {
+ get
+ {
+ string str = this._produto;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._produto = value;
+ this.OnPropertyChanged("Produto");
+ }
+ }
+
+ [Description("RAMO")]
+ public string Ramo
+ {
+ get
+ {
+ string str = this._ramo;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._ramo = value;
+ this.OnPropertyChanged("Ramo");
+ }
+ }
+
+ [Description("RECEBIMENTO")]
+ public DateTime? Recebimento
+ {
+ get
+ {
+ return this._recebimento;
+ }
+ set
+ {
+ this._recebimento = value;
+ this.OnPropertyChanged("Recebimento");
+ }
+ }
+
+ [Description("SEGURADORA")]
+ public string Seguradora
+ {
+ get
+ {
+ string str = this._seguradora;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._seguradora = value;
+ this.OnPropertyChanged("Seguradora");
+ }
+ }
+
+ [Tipo("INVALID")]
+ public bool Selecionado
+ {
+ get
+ {
+ return this._selecionado;
+ }
+ set
+ {
+ this._selecionado = value;
+ this.OnPropertyChanged("Selecionado");
+ }
+ }
+
+ [Description("TIPO DA PARCELA")]
+ public SubTipo Tipo
+ {
+ get
+ {
+ return this._tipo;
+ }
+ set
+ {
+ this._tipo = value;
+ this.OnPropertyChanged("Tipo");
+ }
+ }
+
+ [Description("VALOR DA PARCELA")]
+ public decimal Valor
+ {
+ get
+ {
+ return this._valor;
+ }
+ set
+ {
+ this._valor = value;
+ this.OnPropertyChanged("Valor");
+ }
+ }
+
+ [Description("VALOR DE REPASSE")]
+ public decimal ValorRepasse
+ {
+ get
+ {
+ return this._valorRepasse;
+ }
+ set
+ {
+ this._valorRepasse = value;
+ this.OnPropertyChanged("ValorRepasse");
+ }
+ }
+
+ [Description("VENDEDOR")]
+ public string Vendedor
+ {
+ get
+ {
+ string str = this._vendedor;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._vendedor = value;
+ this.OnPropertyChanged("Vendedor");
+ }
+ }
+
+ public ManutencaoPagamentos()
+ {
+ }
+
+ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged;
+ if (propertyChangedEventHandler == null)
+ {
+ return;
+ }
+ propertyChangedEventHandler(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/NotaFiscal.cs b/Gestor.Model/Model.Domain.Ferramentas/NotaFiscal.cs new file mode 100644 index 0000000..40d9e92 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/NotaFiscal.cs @@ -0,0 +1,217 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Threading;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class NotaFiscal : DomainBase
+ {
+ private bool _selecionado;
+
+ [Description("DATA")]
+ [Log(true)]
+ public DateTime? Data
+ {
+ get;
+ set;
+ }
+
+ [Description("ESTIPULANTE")]
+ [Log(true)]
+ public Gestor.Model.Domain.Seguros.Estipulante Estipulante
+ {
+ get;
+ set;
+ }
+
+ [Description("EXTRATO")]
+ [Log(true)]
+ public string Extrato
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public long? IdExtrato
+ {
+ get;
+ set;
+ }
+
+ [Description("IR")]
+ [Log(true)]
+ public decimal Ir
+ {
+ get;
+ set;
+ }
+
+ [Description("ISS")]
+ [Log(true)]
+ public decimal Iss
+ {
+ get;
+ set;
+ }
+
+ [Description("OBS")]
+ [Log(true)]
+ public string Obs
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public Gestor.Model.Domain.Seguros.Seguradora Seguradora
+ {
+ get;
+ set;
+ }
+
+ public bool Selecionado
+ {
+ get
+ {
+ return this._selecionado;
+ }
+ set
+ {
+ if (value == this._selecionado)
+ {
+ return;
+ }
+ this._selecionado = value;
+ this.OnPropertyChanged("Selecionado");
+ }
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ return new Func<List<KeyValuePair<string, string>>>(this.Validate);
+ }
+ }
+
+ [Description("VALOR BRUTO")]
+ [Log(true)]
+ public decimal ValorBruto
+ {
+ get;
+ set;
+ }
+
+ [Description("VALOR LÍQUIDO")]
+ [Log(true)]
+ public decimal ValorLiquido
+ {
+ get;
+ set;
+ }
+
+ public NotaFiscal()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ string nome;
+ string str;
+ string shortDateString;
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("SEGURADORA", (string.IsNullOrWhiteSpace(this.Seguradora.Nome) ? "" : this.Seguradora.Nome), "")
+ };
+ Gestor.Model.Domain.Seguros.Estipulante estipulante = this.Estipulante;
+ if (estipulante != null)
+ {
+ nome = estipulante.Nome;
+ }
+ else
+ {
+ nome = null;
+ }
+ if (string.IsNullOrWhiteSpace(nome))
+ {
+ str = "";
+ }
+ else
+ {
+ Gestor.Model.Domain.Seguros.Estipulante estipulante1 = this.Estipulante;
+ if (estipulante1 != null)
+ {
+ str = estipulante1.Nome;
+ }
+ else
+ {
+ str = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("ESTIPULANTE", str, ""));
+ decimal iss = this.Iss;
+ observableCollection.Add(new Tuple<string, string, string>("ISS", iss.ToString("C", new CultureInfo("pt-BR", false)), ""));
+ iss = this.ValorLiquido;
+ observableCollection.Add(new Tuple<string, string, string>("VALOR LÍQUIDO", iss.ToString("C", new CultureInfo("pt-BR", false)), ""));
+ iss = this.ValorBruto;
+ observableCollection.Add(new Tuple<string, string, string>("VALOR BRUTO", iss.ToString("C", new CultureInfo("pt-BR", false)), ""));
+ DateTime? data = this.Data;
+ if (!data.HasValue)
+ {
+ shortDateString = "";
+ }
+ else
+ {
+ data = this.Data;
+ if (data.HasValue)
+ {
+ shortDateString = data.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ shortDateString = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("DATA", shortDateString, ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ return tupleLists;
+ }
+
+ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged;
+ if (propertyChangedEventHandler == null)
+ {
+ return;
+ }
+ propertyChangedEventHandler(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (this.Seguradora == null || string.IsNullOrEmpty(this.Seguradora.Nome))
+ {
+ keyValuePairs.AddValue<string, string>("Seguradora", Messages.Obrigatorio, true);
+ }
+ return keyValuePairs;
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/OrigemCliente.cs b/Gestor.Model/Model.Domain.Ferramentas/OrigemCliente.cs new file mode 100644 index 0000000..dc47d63 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/OrigemCliente.cs @@ -0,0 +1,35 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using System;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class OrigemCliente : DomainBase
+ {
+ public Gestor.Model.Domain.Seguros.Cliente Cliente
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ [Name(true)]
+ public string Nome
+ {
+ get;
+ set;
+ }
+
+ public long TipoOrigem
+ {
+ get;
+ set;
+ }
+
+ public OrigemCliente()
+ {
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/Recibo.cs b/Gestor.Model/Model.Domain.Ferramentas/Recibo.cs new file mode 100644 index 0000000..c598a07 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/Recibo.cs @@ -0,0 +1,202 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Gestor.Model.Validation;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class Recibo : DomainBase, IDomain
+ {
+ [Description("DATA DO RECIBO")]
+ [Log(true)]
+ public DateTime? DataRecibo
+ {
+ get;
+ set;
+ }
+
+ [Description("DOCUMENTO PAGANTE")]
+ [Log(true)]
+ public string DocumentoPagante
+ {
+ get;
+ set;
+ }
+
+ [Description("DOCUMENTO RECEBEDOR")]
+ [Log(true)]
+ public string DocumentoRecebedor
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public TipoPagamento? Pagamento
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Pagante
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Recebedor
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public string Referente
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ public TipoRecibo? Tipo
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Recibo recibo = this;
+ return new Func<List<KeyValuePair<string, string>>>(recibo.Validate);
+ }
+ }
+
+ [Log(true)]
+ public decimal Valor
+ {
+ get;
+ set;
+ }
+
+ public Recibo()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ string description;
+ string shortDateString;
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("PAGANTE", (string.IsNullOrWhiteSpace(this.Pagante) ? "" : this.Pagante), ""),
+ new Tuple<string, string, string>("DOCUMENTO PAGANTE", (string.IsNullOrWhiteSpace(this.DocumentoPagante) ? "" : this.DocumentoPagante), ""),
+ new Tuple<string, string, string>("RECEBEDOR", (string.IsNullOrWhiteSpace(this.Recebedor) ? "" : this.Recebedor), ""),
+ new Tuple<string, string, string>("DOCUMENTO", (string.IsNullOrWhiteSpace(this.DocumentoRecebedor) ? "" : this.DocumentoRecebedor), ""),
+ new Tuple<string, string, string>("TIPO DO RECIBO", this.Tipo.GetDescription(), "")
+ };
+ TipoPagamento? pagamento = this.Pagamento;
+ if (!pagamento.HasValue)
+ {
+ description = "";
+ }
+ else
+ {
+ pagamento = this.Pagamento;
+ if (pagamento.HasValue)
+ {
+ description = pagamento.GetValueOrDefault().GetDescription();
+ }
+ else
+ {
+ description = null;
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("PAGAMENTO", description, ""));
+ decimal valor = this.Valor;
+ observableCollection.Add(new Tuple<string, string, string>("VALOR", valor.ToString(new CultureInfo("pt-BR")), ""));
+ DateTime? dataRecibo = this.DataRecibo;
+ if (dataRecibo.HasValue)
+ {
+ shortDateString = dataRecibo.GetValueOrDefault().ToShortDateString();
+ }
+ else
+ {
+ shortDateString = null;
+ }
+ observableCollection.Add(new Tuple<string, string, string>("DATA DO RECIBO", shortDateString, ""));
+ observableCollection.Add(new Tuple<string, string, string>("PAGANTE", (string.IsNullOrWhiteSpace(this.Pagante) ? "" : this.Pagante), ""));
+ observableCollection.Add(new Tuple<string, string, string>("RECEBEDOR", (string.IsNullOrWhiteSpace(this.Recebedor) ? "" : this.Recebedor), ""));
+ observableCollection.Add(new Tuple<string, string, string>("REFERENTE", (string.IsNullOrWhiteSpace(this.Referente) ? "" : this.Referente), ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ return tupleLists;
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (string.IsNullOrWhiteSpace(this.Referente))
+ {
+ keyValuePairs.AddValue<string, string>("Referente|REFERENTE À(AO)", Messages.Obrigatorio, true);
+ }
+ if (this.DataRecibo.HasValue && (DateTime.Compare(this.DataRecibo.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.DataRecibo.Value, new DateTime(9999, 12, 31)) > 0))
+ {
+ keyValuePairs.AddValue<string, string>("DataRecibo|DATA DO RECIBO", Messages.Obrigatorio, true);
+ }
+ if (!this.DataRecibo.HasValue)
+ {
+ keyValuePairs.AddValue<string, string>("DataRecibo|DATA DO RECIBO", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrWhiteSpace(this.DocumentoPagante))
+ {
+ keyValuePairs.AddValue<string, string>("DocumentoPagante|DOCUMENTO DO PAGANTE", Messages.Obrigatorio, true);
+ }
+ else if (!this.DocumentoPagante.ValidacaoDocumento())
+ {
+ keyValuePairs.AddValue<string, string>("DocumentoPagante|DOCUMENTO DO PAGANTE", Messages.Invalido, true);
+ }
+ if (string.IsNullOrWhiteSpace(this.DocumentoRecebedor))
+ {
+ keyValuePairs.AddValue<string, string>("DocumentoRecebedor|DOCUMENTO DO RECEBEDOR", Messages.Obrigatorio, true);
+ }
+ else if (!this.DocumentoRecebedor.ValidacaoDocumento())
+ {
+ keyValuePairs.AddValue<string, string>("DocumentoRecebedor|DOCUMENTO DO RECEBEDOR", Messages.Invalido, true);
+ }
+ if (string.IsNullOrWhiteSpace(this.Recebedor))
+ {
+ keyValuePairs.AddValue<string, string>("Recebedor", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrWhiteSpace(this.Pagante))
+ {
+ keyValuePairs.AddValue<string, string>("Pagante", Messages.Obrigatorio, true);
+ }
+ if (!this.Pagamento.HasValue)
+ {
+ keyValuePairs.AddValue<string, string>("Pagamento|FORMA DE PAGAMENTO", Messages.Obrigatorio, true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.Referente) && this.Referente.Length >= 255)
+ {
+ keyValuePairs.AddValue<string, string>("Referente|REFERENTE À(AO)", string.Format(Messages.MaiorQueLimite, 255), true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/ResponsavelTarefa.cs b/Gestor.Model/Model.Domain.Ferramentas/ResponsavelTarefa.cs new file mode 100644 index 0000000..1418879 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/ResponsavelTarefa.cs @@ -0,0 +1,54 @@ +using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class ResponsavelTarefa : DomainBase, IDomain
+ {
+ public long IdTarefa
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Usuario Usuario
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ ResponsavelTarefa responsavelTarefa = this;
+ return new Func<List<KeyValuePair<string, string>>>(responsavelTarefa.Validate);
+ }
+ }
+
+ public ResponsavelTarefa()
+ {
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (this.Usuario == null || this.Usuario.Id == 0)
+ {
+ keyValuePairs.AddValue<string, string>("Usuario", Messages.Obrigatorio, true);
+ }
+ if (this.IdTarefa == 0)
+ {
+ keyValuePairs.AddValue<string, string>("IdTarefa", Messages.Obrigatorio, true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/StatusDeProspeccao.cs b/Gestor.Model/Model.Domain.Ferramentas/StatusDeProspeccao.cs new file mode 100644 index 0000000..6c258c7 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/StatusDeProspeccao.cs @@ -0,0 +1,103 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class StatusDeProspeccao : DomainBase
+ {
+ private string _nome;
+
+ [Log(true)]
+ public bool Ativo
+ {
+ get;
+ set;
+ }
+
+ [Description("DESCRIÇÃO")]
+ [Log(true)]
+ public string Descricao
+ {
+ get;
+ set;
+ }
+
+ public bool Excluido
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ [Name(true)]
+ public string Nome
+ {
+ get
+ {
+ string str = this._nome;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._nome = value;
+ }
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ return new Func<List<KeyValuePair<string, string>>>(this.Validate);
+ }
+ }
+
+ public StatusDeProspeccao()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ return new List<TupleList>()
+ {
+ new TupleList()
+ {
+ Tuples = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("NOME", (string.IsNullOrWhiteSpace(this.Nome) ? "" : this.Nome), ""),
+ new Tuple<string, string, string>("DESCRIÇÃO", (string.IsNullOrWhiteSpace(this.Descricao) ? "" : this.Descricao), ""),
+ new Tuple<string, string, string>("ATIVO", (this.Ativo ? "SIM" : "NÃO"), ""),
+ new Tuple<string, string, string>("EXCLUÍDO", (this.Excluido ? "SIM" : "NÃO"), "")
+ }
+ }
+ };
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (string.IsNullOrWhiteSpace(this.Nome))
+ {
+ keyValuePairs.AddValue<string, string>("Nome", Messages.Obrigatorio, true);
+ }
+ else if (this.Nome.Length > 60)
+ {
+ keyValuePairs.AddValue<string, string>("Nome", string.Format(Messages.MaiorQueLimite, 60), true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/Tarefa.cs b/Gestor.Model/Model.Domain.Ferramentas/Tarefa.cs new file mode 100644 index 0000000..165b244 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/Tarefa.cs @@ -0,0 +1,264 @@ +using Gestor.Model.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Gestor.Model.Validation;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.CompilerServices;
+using System.Text.RegularExpressions;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class Tarefa : DomainBase, IDomain
+ {
+ public bool Aberto
+ {
+ get;
+ set;
+ }
+
+ public DateTime Agendamento
+ {
+ get;
+ set;
+ }
+
+ public bool AgendamentoRetroativo
+ {
+ get;
+ set;
+ }
+
+ public string Anotacoes
+ {
+ get;
+ set;
+ }
+
+ public string AnotacoesInternas
+ {
+ get;
+ set;
+ }
+
+ public CategoriaTarefa Categoria
+ {
+ get;
+ set;
+ }
+
+ public string Cliente
+ {
+ get;
+ set;
+ }
+
+ public DateTime? Conclusao
+ {
+ get;
+ set;
+ }
+
+ public string Descricao
+ {
+ get;
+ set;
+ }
+
+ public string DescricaoInterna
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Documento Documento
+ {
+ get;
+ set;
+ }
+
+ public TipoTarefa Entidade
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Ferramentas.Fase Fase
+ {
+ get;
+ set;
+ }
+
+ public bool HabilitarPublica
+ {
+ get;
+ set;
+ }
+
+ public long IdCliente
+ {
+ get;
+ set;
+ }
+
+ public long IdEntidade
+ {
+ get;
+ set;
+ }
+
+ public bool Publica
+ {
+ get;
+ set;
+ }
+
+ public string Referencia
+ {
+ get;
+ set;
+ }
+
+ public List<ResponsavelTarefa> Responsaveis
+ {
+ get;
+ set;
+ }
+
+ public bool? Restrito
+ {
+ get;
+ set;
+ }
+
+ public StatusTarefa Status
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Ferramentas.TipoDeTarefa TipoDeTarefa
+ {
+ get;
+ set;
+ }
+
+ public string Titulo
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Ferramentas.Trilha Trilha
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Usuario Usuario
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Usuario UsuarioCadastro
+ {
+ get;
+ set;
+ }
+
+ public List<Gestor.Model.Domain.Seguros.Usuario> UsuariosVinculados
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Tarefa tarefa = this;
+ return new Func<List<KeyValuePair<string, string>>>(tarefa.Validate);
+ }
+ }
+
+ public Tarefa()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ string nome;
+ this.Descricao = (new Regex("<title>.*<\\/title>")).Replace(this.Descricao, "").Trim();
+ this.Descricao = (new Regex("(<[^>]*>)|(p\\s?{[^}]*})|(\\r)|(\\n)")).Replace(this.Descricao, "").Trim();
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("TÍTULO", (string.IsNullOrWhiteSpace(this.Titulo) ? "" : this.Titulo), "")
+ };
+ DateTime agendamento = this.Agendamento;
+ observableCollection.Add(new Tuple<string, string, string>("AGENDAMENTO", agendamento.ToShortDateString(), ""));
+ agendamento = this.Agendamento;
+ observableCollection.Add(new Tuple<string, string, string>("HORA", agendamento.ToShortTimeString(), ""));
+ observableCollection.Add(new Tuple<string, string, string>("RESPONSÁVEL", (string.IsNullOrWhiteSpace(this.Usuario.Nome) ? "" : this.Usuario.Nome), ""));
+ observableCollection.Add(new Tuple<string, string, string>("STATUS", this.Status.GetDescription(), ""));
+ Gestor.Model.Domain.Ferramentas.TipoDeTarefa tipoDeTarefa = this.TipoDeTarefa;
+ if (tipoDeTarefa != null)
+ {
+ nome = tipoDeTarefa.Nome;
+ }
+ else
+ {
+ nome = null;
+ }
+ observableCollection.Add(new Tuple<string, string, string>("TIPO DE TAREFA", nome, ""));
+ observableCollection.Add(new Tuple<string, string, string>("ANOTAÇÕES", (string.IsNullOrWhiteSpace(this.Descricao) ? "" : this.Descricao), ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ return tupleLists;
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (this.Entidade != TipoTarefa.Notas)
+ {
+ if (this.IdEntidade == 0 && this.Trilha == null)
+ {
+ keyValuePairs.AddValue<string, string>("IdEntidade", Messages.Obrigatorio, true);
+ }
+ if (!this.AgendamentoRetroativo && this.Status != StatusTarefa.Realizado && this.Agendamento < Funcoes.GetNetworkTime().AddMinutes(-15) && this.Trilha == null)
+ {
+ keyValuePairs.AddValue<string, string>("Agendamento", Messages.Invalido, true);
+ }
+ }
+ if (this.Usuario == null)
+ {
+ keyValuePairs.AddValue<string, string>("Usuario|RESPONSÁVEL", Messages.Obrigatorio, true);
+ }
+ if (string.IsNullOrWhiteSpace(this.Titulo))
+ {
+ keyValuePairs.AddValue<string, string>("Titulo|TÍTULO", Messages.Obrigatorio, true);
+ }
+ if (DateTime.Compare(this.Agendamento, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.Agendamento, new DateTime(9999, 12, 31)) > 0)
+ {
+ keyValuePairs.AddValue<string, string>("Agendamento", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ if (this.Conclusao.HasValue && (DateTime.Compare(this.Conclusao.Value, new DateTime(1753, 1, 1)) < 0 || DateTime.Compare(this.Conclusao.Value, new DateTime(9999, 12, 31)) > 0))
+ {
+ keyValuePairs.AddValue<string, string>("Conclusao|CONCLUSÃO", string.Format(Messages.DataInvalida, Array.Empty<object>()), true);
+ }
+ if (this.Status == StatusTarefa.Realizado && !this.Conclusao.HasValue)
+ {
+ keyValuePairs.AddValue<string, string>("Conclusao|CONCLUSÃO", Messages.Obrigatorio, true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/TipoDeTarefa.cs b/Gestor.Model/Model.Domain.Ferramentas/TipoDeTarefa.cs new file mode 100644 index 0000000..16a0d2a --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/TipoDeTarefa.cs @@ -0,0 +1,103 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class TipoDeTarefa : DomainBase
+ {
+ private string _nome;
+
+ [Log(true)]
+ public bool Ativo
+ {
+ get;
+ set;
+ }
+
+ [Description("DESCRIÇÃO")]
+ [Log(true)]
+ public string Descricao
+ {
+ get;
+ set;
+ }
+
+ public bool Excluido
+ {
+ get;
+ set;
+ }
+
+ [Log(true)]
+ [Name(true)]
+ public string Nome
+ {
+ get
+ {
+ string str = this._nome;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._nome = value;
+ }
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ return new Func<List<KeyValuePair<string, string>>>(this.Validate);
+ }
+ }
+
+ public TipoDeTarefa()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ return new List<TupleList>()
+ {
+ new TupleList()
+ {
+ Tuples = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("NOME", (string.IsNullOrWhiteSpace(this.Nome) ? "" : this.Nome), ""),
+ new Tuple<string, string, string>("DESCRIÇÃO", (string.IsNullOrWhiteSpace(this.Descricao) ? "" : this.Descricao), ""),
+ new Tuple<string, string, string>("ATIVO", (this.Ativo ? "SIM" : "NÃO"), ""),
+ new Tuple<string, string, string>("EXCLUÍDO", (this.Excluido ? "SIM" : "NÃO"), "")
+ }
+ }
+ };
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (string.IsNullOrWhiteSpace(this.Nome))
+ {
+ keyValuePairs.AddValue<string, string>("Nome", Messages.Obrigatorio, true);
+ }
+ else if (this.Nome.Length > 60)
+ {
+ keyValuePairs.AddValue<string, string>("Nome", string.Format(Messages.MaiorQueLimite, 60), true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Ferramentas/Trilha.cs b/Gestor.Model/Model.Domain.Ferramentas/Trilha.cs new file mode 100644 index 0000000..cf4e075 --- /dev/null +++ b/Gestor.Model/Model.Domain.Ferramentas/Trilha.cs @@ -0,0 +1,122 @@ +using Gestor.Model.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using Gestor.Model.Validation;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class Trilha : DomainBase, IDomain
+ {
+ public bool Ativo
+ {
+ get;
+ set;
+ }
+
+ public string Descricao
+ {
+ get;
+ set;
+ }
+
+ public List<Fase> Fases
+ {
+ get;
+ set;
+ }
+
+ public TipoTrilha Tipo
+ {
+ get;
+ set;
+ }
+
+ public string Titulo
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Trilha trilha = this;
+ return new Func<List<KeyValuePair<string, string>>>(trilha.Validate);
+ }
+ }
+
+ public Trilha()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ List<TupleList> tupleLists = new List<TupleList>()
+ {
+ new TupleList()
+ {
+ Tuples = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("TÍTULO DA TRILHA", (string.IsNullOrWhiteSpace(this.Titulo) ? "" : this.Titulo), ""),
+ new Tuple<string, string, string>("DESCRIÇÃO DA TRILHA", (string.IsNullOrWhiteSpace(this.Descricao) ? "" : this.Descricao), ""),
+ new Tuple<string, string, string>("ATIVO", (this.Ativo ? "SIM" : "NÃO"), "")
+ }
+ }
+ };
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
+ {
+ new Tuple<string, string, string>("FASES$", "", "")
+ };
+ if (this.Fases != null)
+ {
+ foreach (Fase fase in this.Fases)
+ {
+ observableCollection.Add(new Tuple<string, string, string>(string.Format(" FASE {0}$", this.Fases.IndexOf(fase) + 1), "", ""));
+ observableCollection.Add(new Tuple<string, string, string>(" TÍTULO DA FASE", (string.IsNullOrWhiteSpace(fase.Titulo) ? "" : fase.Titulo), ""));
+ observableCollection.Add(new Tuple<string, string, string>(" DESCRIÇÃO DA FASE", (string.IsNullOrWhiteSpace(fase.Descricao) ? "" : fase.Descricao), ""));
+ foreach (Tarefa tarefa in fase.Tarefas)
+ {
+ observableCollection.Add(new Tuple<string, string, string>(string.Format(" TAREFA {0}$", fase.Tarefas.IndexOf(tarefa) + 1), "", ""));
+ observableCollection.Add(new Tuple<string, string, string>(" TÍTULO DA TAREFA", (string.IsNullOrWhiteSpace(tarefa.Titulo) ? "" : tarefa.Titulo), ""));
+ DateTime agendamento = tarefa.Agendamento;
+ DateTime dateTime = tarefa.Agendamento;
+ observableCollection.Add(new Tuple<string, string, string>(" AGENDAMENTO DA TAREFA", dateTime.ToShortDateString(), ""));
+ DateTime agendamento1 = tarefa.Agendamento;
+ dateTime = tarefa.Agendamento;
+ observableCollection.Add(new Tuple<string, string, string>(" HORA DA TAREFA", dateTime.ToShortTimeString(), ""));
+ observableCollection.Add(new Tuple<string, string, string>(" ANOTAÇÕES DA TAREFA", (string.IsNullOrWhiteSpace(tarefa.Anotacoes) ? "" : tarefa.Anotacoes), ""));
+ observableCollection.Add(new Tuple<string, string, string>(" STATUS DA TAREFA", tarefa.Status.GetDescription(), ""));
+ }
+ }
+ tupleLists.Add(new TupleList()
+ {
+ Tuples = observableCollection
+ });
+ }
+ return tupleLists;
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (string.IsNullOrWhiteSpace(this.Titulo))
+ {
+ keyValuePairs.AddValue<string, string>("Titulo", Messages.Obrigatorio, true);
+ }
+ if (this.Fases == null || this.Fases.Count == 0)
+ {
+ keyValuePairs.AddValue<string, string>("Fases", Messages.Obrigatorio, true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file |