Compare commits

3 Commits

View File

@@ -52,7 +52,8 @@ namespace PizzaExpress_Client
{ {
Text = "Costo", Text = "Costo",
Location = new Point(900, 15), Location = new Point(900, 15),
Size = new Size(70, 30) Size = new Size(70, 30),
Enabled = false
}; };
_btnCosto.Click += BtnCosto_Click; _btnCosto.Click += BtnCosto_Click;
@@ -196,9 +197,9 @@ namespace PizzaExpress_Client
Padding = new Padding(0, 10, 0, 0) Padding = new Padding(0, 10, 0, 0)
}; };
_btnAggiungi = new Button { Text = "Aggiungi", Width = 120 }; _btnAggiungi = new Button { Text = "Aggiungi", Width = 120, Enabled = false };
_btnAggiorna = new Button { Text = "Aggiorna", Width = 120 }; _btnAggiorna = new Button { Text = "Aggiorna", Width = 120, Enabled = false };
_btnElimina = new Button { Text = "Elimina", Width = 120 }; _btnElimina = new Button { Text = "Elimina", Width = 120, Enabled = false };
_btnAggiungi.Click += async (s, e) => await AggiungiPizza(); _btnAggiungi.Click += async (s, e) => await AggiungiPizza();
_btnAggiorna.Click += async (s, e) => await AggiornaPizza(); _btnAggiorna.Click += async (s, e) => await AggiornaPizza();
@@ -209,7 +210,7 @@ namespace PizzaExpress_Client
pnlButtons.Controls.Add(_btnAggiorna); pnlButtons.Controls.Add(_btnAggiorna);
pnlButtons.Controls.Add(_btnElimina); pnlButtons.Controls.Add(_btnElimina);
pnlRight.Controls.Add(pnlButtons, 1, 6); pnlRight.Controls.Add(pnlButtons, 1, 7);
// ====================================================== // ======================================================
Controls.Add(pnlRight); Controls.Add(pnlRight);
@@ -268,6 +269,12 @@ namespace PizzaExpress_Client
_txtPrezzo.Text = p.Prezzo.ToString(); _txtPrezzo.Text = p.Prezzo.ToString();
_cmbCategoria.Text = p.Categoria; _cmbCategoria.Text = p.Categoria;
_txtNote.Text = p.Note; _txtNote.Text = p.Note;
_cmbStato.Text = p.Stato;
_btnAggiungi.Enabled = false;
_btnElimina.Enabled = true;
_btnAggiorna.Enabled = true;
_btnCosto.Enabled = true;
} }
// ====================================================================== // ======================================================================
@@ -387,6 +394,11 @@ namespace PizzaExpress_Client
_txtNote.Clear(); _txtNote.Clear();
_cmbCategoria.SelectedIndex = -1; _cmbCategoria.SelectedIndex = -1;
_cmbStato.SelectedIndex = -1; _cmbStato.SelectedIndex = -1;
_btnAggiungi.Enabled = true;
_btnElimina.Enabled = false;
_btnAggiorna.Enabled = false;
_btnCosto.Enabled = false;
} }
} }
} }