private void btnIngresar_Click(object sender, EventArgs e) { try { if (txtNombre.Text != "") { if (txtPrecio.Text != "") { string nombre = txtNombre.Text; double precio = double.Parse(txtPrecio.Text); Plato p = new Plato(0, nombre, "", precio); Persistencia.AgregarPlato(p); MessageBox.Show("Se ingreso el Plato correctamente!", "Nuevo Plato", MessageBoxButtons.OK, MessageBoxIcon.Information); //Restauro boxs txtNombre.Text = ""; txtPrecio.Text = ""; lblidResultado.Text = "?"; btnEliminar.Enabled = false; btnModificar.Enabled = false; } else { MessageBox.Show("Debe ingresar el precio para el Plato!", "ERROR!!!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Debe ingresar el nombre para el Plato!", "ERROR!!!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show("No se pudo ingresar el Plato!", "ERROR!!!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } //Ingresa un nuevo Plato