2 Commits

Author SHA1 Message Date
248b12a6b0 Fix conflitto SCANDALOSO 2026-02-12 09:23:01 +01:00
de1c6821c1 Aggiunta pulsante "Ingredienti" 2026-02-12 09:18:22 +01:00

View File

@@ -12,7 +12,7 @@ namespace PizzaExpress_Client
private readonly TextBox _txtId, _txtNome, _txtPrezzo, _txtRicerca, _txtNote; private readonly TextBox _txtId, _txtNome, _txtPrezzo, _txtRicerca, _txtNote;
private readonly ComboBox _cmbCategoria, _cmbStato; 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() public GestionePizzeForm()
{ {
@@ -48,17 +48,16 @@ namespace PizzaExpress_Client
AutoSize = true AutoSize = true
}; };
_btnCosto = new Button _btnIngredienti = new Button
{ {
Text = "Costo", Text = "Ingredienti",
Location = new Point(900, 15), Location = new Point(870, 15),
Size = new Size(70, 30), Size = new Size(104, 30)
Enabled = false
}; };
_btnCosto.Click += BtnCosto_Click; _btnIngredienti.Click += BtnIngredienti_Click;
pnlTop.Controls.Add(lblTitolo); pnlTop.Controls.Add(lblTitolo);
pnlTop.Controls.Add(_btnCosto); pnlTop.Controls.Add(_btnIngredienti);
// ====================================================== // ======================================================
// PANNELLO SINISTRO // PANNELLO SINISTRO
@@ -367,7 +366,7 @@ namespace PizzaExpress_Client
} }
// ====================================================================== // ======================================================================
private void BtnCosto_Click(object? sender, EventArgs e) private void BtnIngredienti_Click(object? sender, EventArgs e)
{ {
if (_lstPizze.SelectedItem == null) if (_lstPizze.SelectedItem == null)
{ {
@@ -375,15 +374,7 @@ namespace PizzaExpress_Client
return; return;
} }
var s = _lstPizze.SelectedItem.ToString(); MessageBox.Show("Funzionalità Ingredienti non ancora implementata.");
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}€.");
}
} }
private void PulisciCampi() private void PulisciCampi()