You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.5 KiB
72 lines
2.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Model
|
|
{
|
|
public class Animal
|
|
{
|
|
public string Nom { get; set; }
|
|
public string DateNaissance { get; set; }
|
|
public string Sexe { get; set; }
|
|
public string DateAdoption { get; set; }
|
|
public string Taille { get; set; }
|
|
public string Poids { get; set; }
|
|
public string Alimentation { get; set; }
|
|
public Espece Espece { get; set; }
|
|
public Race? Race { get; set; }
|
|
|
|
public Animal(Espece espece, string nom = "Inconnu", string dateNaissance = "Inconnue", string sexe = "Inconnu", string dateAdpotion = "Inconnue", string taille = "Inconnue", string poids = "Iconnu", string alimentation = "Inconnue", Race? race = null)
|
|
{
|
|
Espece = espece;
|
|
Nom = nom;
|
|
DateNaissance = dateNaissance;
|
|
Sexe = sexe;
|
|
DateAdoption = dateAdpotion;
|
|
Taille = taille;
|
|
Poids = poids;
|
|
Alimentation = alimentation;
|
|
Race = race;
|
|
}
|
|
|
|
public void AfficherAnimal(Zootheque zootheque)
|
|
{
|
|
Console.WriteLine("\n" + Nom);
|
|
Console.WriteLine("\tDate de naissance : " + DateNaissance);
|
|
Console.WriteLine("\tSexe : " + Sexe);
|
|
Console.WriteLine("\tDate d'adoption : " + DateAdoption);
|
|
Console.WriteLine("\tTaille : " + Taille);
|
|
Console.WriteLine("\tPoids : " + Poids);
|
|
Console.WriteLine("\tAlimentation : " + Alimentation);
|
|
Console.WriteLine("\tEspece : " + Espece.Nom);
|
|
if(Race != null) Console.WriteLine("\tRace : " + Race.Nom);
|
|
|
|
while (true)
|
|
{
|
|
Console.WriteLine("\n\t1- Modifier");
|
|
Console.WriteLine("\n\t1- Supprimer");
|
|
Console.WriteLine("\t9- Retour");
|
|
|
|
Console.Write("\n\tEntrer votre choix : ");
|
|
int decision = Convert.ToInt32(Console.ReadLine());
|
|
|
|
switch (decision)
|
|
{
|
|
case 1:
|
|
zootheque.SupprimerAnimal(this);
|
|
break;
|
|
case 2:
|
|
break;
|
|
case 9:
|
|
return;
|
|
default:
|
|
Console.WriteLine("\tChoix incorrect\n");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|