diff options
Diffstat (limited to 'Gestor.Model/Gestor.Model.CalculoWeb/Segurado.cs')
| -rw-r--r-- | Gestor.Model/Gestor.Model.CalculoWeb/Segurado.cs | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/Gestor.Model/Gestor.Model.CalculoWeb/Segurado.cs b/Gestor.Model/Gestor.Model.CalculoWeb/Segurado.cs new file mode 100644 index 0000000..518f588 --- /dev/null +++ b/Gestor.Model/Gestor.Model.CalculoWeb/Segurado.cs @@ -0,0 +1,105 @@ +using System; + +namespace Gestor.Model.CalculoWeb; + +public class Segurado +{ + private string _estadoCivil; + + private string _sexo; + + public string Email { get; set; } + + public Telefone TelefoneResidencial { get; set; } + + public Telefone TelefoneCelular { get; set; } + + public string Cep { get; set; } = string.Empty; + + + public string RelacaoSeguradoCondutor { get; set; } + + public bool Perfil { get; set; } + + public string Uf { get; set; } + + public string NomeCompleto { get; set; } + + public string CpfCnpj { get; set; } + + public DateTime? DataNascimento { get; set; } = DateTime.MinValue; + + + public string Sexo + { + get + { + return _sexo; + } + set + { + _sexo = value; + _sexo = ConvertSexoCalculo(_sexo); + value = _sexo; + } + } + + public DateTime? DataHabilitacao { get; set; } = DateTime.MinValue; + + + public string TempoHabilitacao { get; set; } + + public string EstadoCivil + { + get + { + return _estadoCivil; + } + set + { + _estadoCivil = value; + _estadoCivil = ConvertEstCivCalculo(value); + } + } + + public string NumeroHabilitacao { get; set; } + + public long Id { get; set; } + + private string ConvertSexoCalculo(string sexo) + { + if (!(sexo == "0")) + { + return "2"; + } + return "1"; + } + + private string ConvertEstCivCalculo(string estadoCivil) + { + if (estadoCivil != null) + { + int length = estadoCivil.Length; + if (length == 1) + { + switch (estadoCivil[0]) + { + case '0': + return "1"; + case '1': + return "2"; + case '2': + return "3"; + case '3': + case '5': + case '6': + case '7': + return "4"; + case '4': + return "5"; + } + } + } + return string.Empty; + } +} |