Aggiunta pulsante "Ingredienti"
This commit is contained in:
@@ -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,16 +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)
|
||||||
};
|
};
|
||||||
_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
|
||||||
@@ -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)
|
if (_lstPizze.SelectedItem == null)
|
||||||
{
|
{
|
||||||
@@ -369,15 +369,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()
|
||||||
|
|||||||
Reference in New Issue
Block a user