54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Hermes
|
|
{
|
|
public class Citoyen
|
|
{
|
|
public int Id { get; set; }
|
|
public string Nom { get; set; }
|
|
public string Prenom { get; set; }
|
|
public DateTime DateNaissance { get; set; }
|
|
public string Adresse { get; set; }
|
|
public string Profession { get; set; }
|
|
public int TypeResidence { get; set; }
|
|
public string Mail { get; set; }
|
|
public string Tel { get; set; }
|
|
|
|
public string TypeResidenceLabel {
|
|
get
|
|
{
|
|
return TypeResidence == 0 ? "Principale" : "Secondaire";
|
|
}
|
|
}
|
|
|
|
public int Age {
|
|
get
|
|
{
|
|
return DateTime.Now.Year - DateNaissance.Year;
|
|
}
|
|
set
|
|
{
|
|
DateNaissance = new DateTime(DateTime.Now.Year - value, 1, 1);
|
|
}
|
|
}
|
|
|
|
public Citoyen() {}
|
|
|
|
public Citoyen(int id, string nom, string prenom, DateTime dateNaissance, string adresse, string profession, int typeResidence, string mail, string tel) {
|
|
Id = id;
|
|
Nom = nom;
|
|
Prenom = prenom;
|
|
DateNaissance = dateNaissance;
|
|
Adresse = adresse;
|
|
Profession = profession;
|
|
TypeResidence = typeResidence;
|
|
Mail = mail;
|
|
Tel = tel;
|
|
}
|
|
}
|
|
}
|