Aggiunta pulsante "Ingredienti"

This commit is contained in:
2026-02-12 09:18:22 +01:00
parent 2b6ee05a67
commit de1c6821c1

View File

@@ -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, _btnNuovaPizza;
private readonly Button _btnAggiungi, _btnAggiorna, _btnElimina, _btnElenco, _btnIngredienti, _btnNuovaPizza;
public GestionePizzeForm()
{
@@ -48,16 +48,16 @@ namespace PizzaExpress_Client
AutoSize = true
};
_btnCosto = new Button
_btnIngredienti = new Button
{
Text = "Costo",
Location = new Point(900, 15),
Size = new Size(70, 30)
Text = "Ingredienti",
Location = new Point(870, 15),
Size = new Size(104, 30)
};
_btnCosto.Click += BtnCosto_Click;
_btnIngredienti.Click += BtnIngredienti_Click;
pnlTop.Controls.Add(lblTitolo);
pnlTop.Controls.Add(_btnCosto);
pnlTop.Controls.Add(_btnIngredienti);
// ======================================================
// PANNELLO SINISTRO
@@ -361,7 +361,7 @@ namespace PizzaExpress_Client
}
// ======================================================================
private void BtnCosto_Click(object? sender, EventArgs e)
private void BtnIngredienti_Click(object? sender, EventArgs e)
{
if (_lstPizze.SelectedItem == null)
{
@@ -369,15 +369,7 @@ namespace PizzaExpress_Client
return;
}
var s = _lstPizze.SelectedItem.ToString();
var parts = s.Split('-');
if (parts.Length >= 3)
{
string nome = parts[1].Trim();
string prezzo = parts[2].Replace("€", "").Trim();
MessageBox.Show($"La pizza {nome} costa {prezzo}€.");
}
MessageBox.Show("Funzionalità Ingredienti non ancora implementata.");
}
private void PulisciCampi()