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.
92 lines
3.5 KiB
92 lines
3.5 KiB
|
|
using System.Runtime.CompilerServices;
|
|
|
|
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 float Taille { get; set; }
|
|
public float Poids { get; set; }
|
|
public string Alimentation { get; set; }
|
|
|
|
|
|
public Animal(string nom = "Nom inconnu", string dateNaissance = "Date inconnue", string sexe = "Sexe inconnu", string dateAdpotion = "Date incconue", float taille = 0, float poids = 0, string alimentation = "Alimentation inconnue")
|
|
{
|
|
Nom = nom;
|
|
DateNaissance = dateNaissance;
|
|
Sexe = sexe;
|
|
DateAdoption = dateAdpotion;
|
|
Taille = taille;
|
|
Poids = poids;
|
|
Alimentation = alimentation;
|
|
}
|
|
|
|
public void afficherInfo()
|
|
{
|
|
Console.WriteLine("Nom : " + Nom);
|
|
Console.WriteLine("Date de naissance : " + DateNaissance);
|
|
Console.WriteLine("Sexe : " + Sexe);
|
|
Console.WriteLine("Date d'adoption : " + DateAdoption);
|
|
Console.WriteLine("Taille : " + Taille);
|
|
Console.WriteLine("Poids : " + Poids);
|
|
Console.WriteLine("Alimentation : " + Alimentation);
|
|
}
|
|
|
|
void modifierInfo()
|
|
{
|
|
Console.WriteLine("1- Nom : " + Nom);
|
|
Console.WriteLine("2- Date de naissance : " + DateNaissance);
|
|
Console.WriteLine("3- Sexe : " + Sexe);
|
|
Console.WriteLine("4- Date d'adoption : " + DateAdoption);
|
|
Console.WriteLine("5- Taille : " + Taille);
|
|
Console.WriteLine("6- Poids : " + Poids);
|
|
Console.WriteLine("7- Alimentation : " + Alimentation);
|
|
Console.WriteLine("9- Retour");
|
|
|
|
Console.Write("Entrer le numéro de l'information à modifier : ");
|
|
int choix = Convert.ToInt32(Console.ReadLine());
|
|
|
|
switch (choix)
|
|
{
|
|
case 1:
|
|
Console.Write("Entrer le nouveau nom : ");
|
|
this.Nom = Console.ReadLine();
|
|
break;
|
|
case 2:
|
|
Console.Write("Entrer la nouvelle date de naissance : ");
|
|
this.DateNaissance = Console.ReadLine();
|
|
break;
|
|
case 3:
|
|
Console.Write("Entrer le nouveau sexe : ");
|
|
this.Sexe = Console.ReadLine();
|
|
break;
|
|
case 4:
|
|
Console.Write("Entrer la nouvelle date d'adoption : ");
|
|
this.DateAdoption = Console.ReadLine();
|
|
break;
|
|
case 5:
|
|
Console.Write("Entrer la nouvelle taille : ");
|
|
this.Taille = Convert.ToInt32(Console.ReadLine());
|
|
break;
|
|
case 6:
|
|
Console.Write("Entrer le nouveau poids : ");
|
|
this.Poids = Convert.ToInt32(Console.ReadLine());
|
|
break;
|
|
case 7:
|
|
Console.Write("Entrer la nouvelle alimentation : ");
|
|
this.Alimentation = Console.ReadLine();
|
|
break;
|
|
case 9:
|
|
return;
|
|
default:
|
|
Console.WriteLine("Choix incorrect");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|