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.
113 lines
3.3 KiB
113 lines
3.3 KiB
using Model;
|
|
using System.IO;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace MyProject;
|
|
class Program
|
|
{
|
|
static public Theque Theque { get; set; } = new ();
|
|
static void Main(string[] args)
|
|
{
|
|
MenusPrincipal();
|
|
}
|
|
|
|
private static void MenusPrincipal()
|
|
{
|
|
while (true)
|
|
{
|
|
Console.WriteLine("MENUS PRINCIPAL");
|
|
Console.WriteLine("\t1- Les espèces");
|
|
Console.WriteLine("\t2- Vos animaux");
|
|
Console.WriteLine("\t9- Quitter");
|
|
|
|
Console.Write("\n\tEntrer votre choix : ");
|
|
int choix = Convert.ToInt32(Console.ReadLine());
|
|
|
|
switch (choix)
|
|
{
|
|
case 1:
|
|
Console.Clear();
|
|
MenusEspece();
|
|
break;
|
|
case 2:
|
|
Console.Clear();
|
|
MenusAnimal();
|
|
break;
|
|
case 9:
|
|
return;
|
|
default:
|
|
Console.WriteLine("\tChoix incorrect\n");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
private static void MenusEspece()
|
|
{
|
|
while (true)
|
|
{
|
|
Console.WriteLine("LES ESPECES");
|
|
Console.WriteLine("\t1- Afficher les espèces");
|
|
Console.WriteLine("\t2- Sélectionner une espèce");
|
|
Console.WriteLine("\t9- Retour");
|
|
|
|
Console.Write("\n\tEntrer votre choix : ");
|
|
int choix = Convert.ToInt32(Console.ReadLine());
|
|
|
|
switch (choix)
|
|
{
|
|
case 1:
|
|
Console.Clear();
|
|
Theque.Especetheque.AfficherListeEspece();
|
|
break;
|
|
case 2:
|
|
Console.Clear();
|
|
Theque.Especetheque.SelectionnerEspece();
|
|
break;
|
|
case 9:
|
|
Console.Clear();
|
|
return;
|
|
default:
|
|
Console.WriteLine("\tChoix incorrect\n");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
private static void MenusAnimal()
|
|
{
|
|
while (true)
|
|
{
|
|
Console.WriteLine("LES ANIMAUX");
|
|
Console.WriteLine("\t1- Afficher les animaux");
|
|
Console.WriteLine("\t2- Ajouter un animal");
|
|
Console.WriteLine("\t3- Sélectionner un animal");
|
|
Console.WriteLine("\t9- Retour");
|
|
|
|
Console.Write("\n\tEntrer votre choix : ");
|
|
int choix = Convert.ToInt32(Console.ReadLine());
|
|
|
|
switch (choix)
|
|
{
|
|
case 1:
|
|
Console.Clear();
|
|
Theque.Zootheque.AfficherListeAnimaux();
|
|
break;
|
|
case 2:
|
|
Console.Clear();
|
|
Theque.Zootheque.AjouterAnimal();
|
|
break;
|
|
case 3:
|
|
Theque.Zootheque.SelectionnerAnimal(Theque.Especetheque);
|
|
break;
|
|
case 9:
|
|
Console.Clear();
|
|
return;
|
|
default:
|
|
Console.WriteLine("\tChoix incorrect\n");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} |