diff --git a/Program.cs b/Program.cs index 363987a..32a6d05 100644 --- a/Program.cs +++ b/Program.cs @@ -26,26 +26,51 @@ class Program { Pausa(); break; case 2: - StampaMenu(ristorante); + if (ristorante.GetMenu().Length == 0) { + Console.WriteLine("Creare almeno un piatto prima di mostrare il menĂ¹"); + } + else { + StampaMenu(ristorante); + } Pausa(); break; case 3: - AggiungiOrdine(ristorante); - Console.WriteLine("Ordine aggiunto con successo"); + if (ristorante.GetMenu().Length == 0) { + Console.WriteLine("Creare almeno un piatto prima di creare un ordine"); + } + else { + AggiungiOrdine(ristorante); + Console.WriteLine("Ordine aggiunto con successo"); + } Pausa(); break; case 4: - AnnullaOrdine(ristorante); - Console.WriteLine("Ordine annullato con successo."); + if (ristorante.GetOrdini().Length == 0) { + Console.WriteLine("Creare almeno un ordine prima di annullarlo"); + } + else { + AnnullaOrdine(ristorante); + Console.WriteLine("Ordine annullato con successo."); + } Pausa(); break; case 5: - PagaOrdine(ristorante); - Console.WriteLine("Ordine pagato con successo"); + if (ristorante.GetOrdini().Length == 0) { + Console.WriteLine("Creare almeno un ordine prima di pagarlo"); + } + else { + PagaOrdine(ristorante); + Console.WriteLine("Ordine pagato con successo"); + } Pausa(); break; case 6: - StampaOrdini(ristorante); + if (ristorante.GetOrdini().Length == 0) { + Console.WriteLine("Creare almeno un ordine prima di mostrarli tutti"); + } + else { + StampaOrdini(ristorante); + } Pausa(); break; default: @@ -176,6 +201,7 @@ class Program { static void AnnullaOrdine(Ristorante p_ristorante) { int scelta = -1; bool exit = true; + Console.Write("Codici identificativi degli ordini: "); for (int i = 0; i < p_ristorante.GetOrdini().Length; i++) { Console.WriteLine(p_ristorante.GetOrdini()[i].GetCodiceOrdine()); } @@ -210,6 +236,7 @@ class Program { static void PagaOrdine(Ristorante p_ristorante) { int scelta = -1; bool exit = true; + Console.Write("Codici identificativi degli ordini: "); for (int i = 0; i < p_ristorante.GetOrdini().Length; i++) { Console.WriteLine(p_ristorante.GetOrdini()[i].GetCodiceOrdine()); } diff --git a/bin/Debug/net9.0/ordini_ristorante.dll b/bin/Debug/net9.0/ordini_ristorante.dll index 48f0a54..6e96094 100644 Binary files a/bin/Debug/net9.0/ordini_ristorante.dll and b/bin/Debug/net9.0/ordini_ristorante.dll differ diff --git a/bin/Debug/net9.0/ordini_ristorante.pdb b/bin/Debug/net9.0/ordini_ristorante.pdb index ba3ce9f..fae993e 100644 Binary files a/bin/Debug/net9.0/ordini_ristorante.pdb and b/bin/Debug/net9.0/ordini_ristorante.pdb differ diff --git a/obj/Debug/net9.0/ordini_ristorante.AssemblyInfo.cs b/obj/Debug/net9.0/ordini_ristorante.AssemblyInfo.cs index 09f5be3..4864a88 100644 --- a/obj/Debug/net9.0/ordini_ristorante.AssemblyInfo.cs +++ b/obj/Debug/net9.0/ordini_ristorante.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("ordini_ristorante")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a275e915843af2c05a1cebecfa40f24f9324cc74")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b609104b184a27ab297f47c9b282bf7fbfd30c9d")] [assembly: System.Reflection.AssemblyProductAttribute("ordini_ristorante")] [assembly: System.Reflection.AssemblyTitleAttribute("ordini_ristorante")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net9.0/ordini_ristorante.AssemblyInfoInputs.cache b/obj/Debug/net9.0/ordini_ristorante.AssemblyInfoInputs.cache index 39a9d8a..05cb678 100644 --- a/obj/Debug/net9.0/ordini_ristorante.AssemblyInfoInputs.cache +++ b/obj/Debug/net9.0/ordini_ristorante.AssemblyInfoInputs.cache @@ -1 +1 @@ -b3a63bd86fc6fad1ffe10f51f798240b88be0bc8e79cda50983e1c878f1df28b +b1470357a9001fb19e3b1fe2c265734c0e56a36095a90d27b2fa10117c6660a4 diff --git a/obj/Debug/net9.0/ordini_ristorante.dll b/obj/Debug/net9.0/ordini_ristorante.dll index 48f0a54..6e96094 100644 Binary files a/obj/Debug/net9.0/ordini_ristorante.dll and b/obj/Debug/net9.0/ordini_ristorante.dll differ diff --git a/obj/Debug/net9.0/ordini_ristorante.pdb b/obj/Debug/net9.0/ordini_ristorante.pdb index ba3ce9f..fae993e 100644 Binary files a/obj/Debug/net9.0/ordini_ristorante.pdb and b/obj/Debug/net9.0/ordini_ristorante.pdb differ diff --git a/obj/Debug/net9.0/ref/ordini_ristorante.dll b/obj/Debug/net9.0/ref/ordini_ristorante.dll index be0e2dc..846108e 100644 Binary files a/obj/Debug/net9.0/ref/ordini_ristorante.dll and b/obj/Debug/net9.0/ref/ordini_ristorante.dll differ diff --git a/obj/Debug/net9.0/refint/ordini_ristorante.dll b/obj/Debug/net9.0/refint/ordini_ristorante.dll index be0e2dc..846108e 100644 Binary files a/obj/Debug/net9.0/refint/ordini_ristorante.dll and b/obj/Debug/net9.0/refint/ordini_ristorante.dll differ