From 42878bfeaf99096a115d775596ffc3b8e4bd64f3 Mon Sep 17 00:00:00 2001 From: AndreStork Date: Thu, 29 Jan 2026 09:18:46 +0100 Subject: [PATCH] Aggiunta pulsante "Nuova Pizza" --- GestionePizzeForm.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/GestionePizzeForm.cs b/GestionePizzeForm.cs index f70f2fa..4cacc68 100644 --- a/GestionePizzeForm.cs +++ b/GestionePizzeForm.cs @@ -12,7 +12,7 @@ namespace PizzaExpress_Client private readonly TextBox _txtId, _txtNome, _txtPrezzo, _txtRicerca, _txtNote; private readonly ComboBox _cmbCategoria, _cmbStato; - private readonly Button _btnAggiungi, _btnAggiorna, _btnElimina, _btnElenco, _btnCosto; + private readonly Button _btnAggiungi, _btnAggiorna, _btnElimina, _btnElenco, _btnCosto, _btnNuovaPizza; public GestionePizzeForm() { @@ -92,9 +92,17 @@ namespace PizzaExpress_Client }; _lstPizze.SelectedIndexChanged += LstPizze_SelectedIndexChanged; + _btnNuovaPizza = new Button + { + Text = "Nuova pizza", + Dock = DockStyle.Bottom, + Height = 35 + }; + pnlLeft.Controls.Add(_lstPizze); pnlLeft.Controls.Add(_btnElenco); pnlLeft.Controls.Add(_txtRicerca); + pnlLeft.Controls.Add(_btnNuovaPizza); // ====================================================== // PANNELLO DESTRO — ALLINEAMENTO PERFETTO A SINISTRA @@ -195,6 +203,7 @@ namespace PizzaExpress_Client _btnAggiungi.Click += async (s, e) => await AggiungiPizza(); _btnAggiorna.Click += async (s, e) => await AggiornaPizza(); _btnElimina.Click += async (s, e) => await EliminaPizza(); + _btnNuovaPizza.Click += (s, e) => PulisciCampi(); pnlButtons.Controls.Add(_btnAggiungi); pnlButtons.Controls.Add(_btnAggiorna); @@ -365,5 +374,15 @@ namespace PizzaExpress_Client MessageBox.Show($"La pizza {nome} costa {prezzo}€."); } } + + private void PulisciCampi() + { + _txtId.Clear(); + _txtNome.Clear(); + _txtPrezzo.Clear(); + _txtNote.Clear(); + _cmbCategoria.SelectedIndex = -1; + _cmbStato.SelectedIndex = -1; + } } }