Controlli finali
This commit is contained in:
43
Program.cs
43
Program.cs
@@ -26,26 +26,51 @@ class Program {
|
|||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
StampaMenu(ristorante);
|
if (ristorante.GetMenu().Length == 0) {
|
||||||
|
Console.WriteLine("Creare almeno un piatto prima di mostrare il menù");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
StampaMenu(ristorante);
|
||||||
|
}
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
AggiungiOrdine(ristorante);
|
if (ristorante.GetMenu().Length == 0) {
|
||||||
Console.WriteLine("Ordine aggiunto con successo");
|
Console.WriteLine("Creare almeno un piatto prima di creare un ordine");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
AggiungiOrdine(ristorante);
|
||||||
|
Console.WriteLine("Ordine aggiunto con successo");
|
||||||
|
}
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
AnnullaOrdine(ristorante);
|
if (ristorante.GetOrdini().Length == 0) {
|
||||||
Console.WriteLine("Ordine annullato con successo.");
|
Console.WriteLine("Creare almeno un ordine prima di annullarlo");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
AnnullaOrdine(ristorante);
|
||||||
|
Console.WriteLine("Ordine annullato con successo.");
|
||||||
|
}
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
PagaOrdine(ristorante);
|
if (ristorante.GetOrdini().Length == 0) {
|
||||||
Console.WriteLine("Ordine pagato con successo");
|
Console.WriteLine("Creare almeno un ordine prima di pagarlo");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
PagaOrdine(ristorante);
|
||||||
|
Console.WriteLine("Ordine pagato con successo");
|
||||||
|
}
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
StampaOrdini(ristorante);
|
if (ristorante.GetOrdini().Length == 0) {
|
||||||
|
Console.WriteLine("Creare almeno un ordine prima di mostrarli tutti");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
StampaOrdini(ristorante);
|
||||||
|
}
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -176,6 +201,7 @@ class Program {
|
|||||||
static void AnnullaOrdine(Ristorante p_ristorante) {
|
static void AnnullaOrdine(Ristorante p_ristorante) {
|
||||||
int scelta = -1;
|
int scelta = -1;
|
||||||
bool exit = true;
|
bool exit = true;
|
||||||
|
Console.Write("Codici identificativi degli ordini: ");
|
||||||
for (int i = 0; i < p_ristorante.GetOrdini().Length; i++) {
|
for (int i = 0; i < p_ristorante.GetOrdini().Length; i++) {
|
||||||
Console.WriteLine(p_ristorante.GetOrdini()[i].GetCodiceOrdine());
|
Console.WriteLine(p_ristorante.GetOrdini()[i].GetCodiceOrdine());
|
||||||
}
|
}
|
||||||
@@ -210,6 +236,7 @@ class Program {
|
|||||||
static void PagaOrdine(Ristorante p_ristorante) {
|
static void PagaOrdine(Ristorante p_ristorante) {
|
||||||
int scelta = -1;
|
int scelta = -1;
|
||||||
bool exit = true;
|
bool exit = true;
|
||||||
|
Console.Write("Codici identificativi degli ordini: ");
|
||||||
for (int i = 0; i < p_ristorante.GetOrdini().Length; i++) {
|
for (int i = 0; i < p_ristorante.GetOrdini().Length; i++) {
|
||||||
Console.WriteLine(p_ristorante.GetOrdini()[i].GetCodiceOrdine());
|
Console.WriteLine(p_ristorante.GetOrdini()[i].GetCodiceOrdine());
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("ordini_ristorante")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("ordini_ristorante")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[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.AssemblyProductAttribute("ordini_ristorante")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("ordini_ristorante")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("ordini_ristorante")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
b3a63bd86fc6fad1ffe10f51f798240b88be0bc8e79cda50983e1c878f1df28b
|
b1470357a9001fb19e3b1fe2c265734c0e56a36095a90d27b2fa10117c6660a4
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user