Opzione 6
This commit is contained in:
parent
4dd44238f1
commit
d78b3c74cc
41
Program.cs
41
Program.cs
@ -749,6 +749,7 @@ class Program {
|
|||||||
Console.WriteLine("3. Mostra informazioni cliente");
|
Console.WriteLine("3. Mostra informazioni cliente");
|
||||||
Console.WriteLine("4. Cancella prenotazione");
|
Console.WriteLine("4. Cancella prenotazione");
|
||||||
Console.WriteLine("5. Mostra tutte le prenotazioni");
|
Console.WriteLine("5. Mostra tutte le prenotazioni");
|
||||||
|
Console.WriteLine("6. Aggiungi prenotazione");
|
||||||
Console.WriteLine("0. Esci");
|
Console.WriteLine("0. Esci");
|
||||||
Console.Write("Scelta: ");
|
Console.Write("Scelta: ");
|
||||||
|
|
||||||
@ -1010,6 +1011,46 @@ class Program {
|
|||||||
}
|
}
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
|
case 6:
|
||||||
|
do {
|
||||||
|
Console.WriteLine("Aggiungere una prenotazione a quale cliente? ");
|
||||||
|
for (int i = 0; i < clienti.Length; i++) {
|
||||||
|
Console.WriteLine(i + 1);
|
||||||
|
}
|
||||||
|
Console.Write("Scelta: ");
|
||||||
|
|
||||||
|
eccezione = false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
input = Convert.ToInt32(Console.ReadLine());
|
||||||
|
}
|
||||||
|
catch (FormatException) {
|
||||||
|
Console.WriteLine("Opzione non valida");
|
||||||
|
eccezione = true;
|
||||||
|
Pausa();
|
||||||
|
}
|
||||||
|
if (!eccezione) {
|
||||||
|
if (input <= 0 || input > numeroClienti) {
|
||||||
|
Console.WriteLine("Opzione non valida");
|
||||||
|
Pausa();
|
||||||
|
}
|
||||||
|
else if (clienti[input - 1] == null) {
|
||||||
|
Console.WriteLine("I dati di questo cliente non sono ancora stati inseriti.");
|
||||||
|
Pausa();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (eccezione || input <= 0 || input > numeroClienti || clienti[input - 1] == null);
|
||||||
|
|
||||||
|
Prenotazione[] precedente = clienti[input - 1].GetPrenotazioni();
|
||||||
|
Prenotazione[] nuovo = new Prenotazione[precedente.Length + 1];
|
||||||
|
for (int i = 0; i < precedente.Length; i++) {
|
||||||
|
nuovo[i] = precedente[i];
|
||||||
|
}
|
||||||
|
clienti[input - 1].SetPrenotazioni(nuovo);
|
||||||
|
Console.WriteLine("Prenotazione aggiunta con successo");
|
||||||
|
Pausa();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Console.WriteLine("Opzione non valida");
|
Console.WriteLine("Opzione non valida");
|
||||||
Pausa();
|
Pausa();
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("agenzia_viaggi")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("agenzia_viaggi")]
|
||||||
[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+7d0e2d2a20832c08fee6ed8e5c82929ee4b7ef6e")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4dd44238f18c5c584ff4ebd96a7111c406880bdb")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("agenzia_viaggi")]
|
[assembly: System.Reflection.AssemblyProductAttribute("agenzia_viaggi")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("agenzia_viaggi")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("agenzia_viaggi")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
26fd656d6612597d0a6de6b43658ea976dd067e7afd7d8ca4033dcfa8783659c
|
2a7dc145931764cff965068fab78fe77e949894ad5284855228257b3af6943c7
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user