private void btnAgregar_Click_1(object sender, EventArgs e) { try { if (this.cmboBoxOpcionPedido.SelectedItem == null) { throw new InvalidOpcionException(); } if (this.chckBoxDelivery.Checked && this.txtBoxInfoDelivery.Text != string.Empty) { Negocio.AgregarPedido(new Pedido((EOpciones)this.cmboBoxOpcionPedido.SelectedItem, this.txtBoxInfoDelivery.Text)); } else { Negocio.AgregarPedido(new Pedido((EOpciones)this.cmboBoxOpcionPedido.SelectedItem)); } } catch (InvalidOpcionException opcionExcp) { MessageBox.Show(opcionExcp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception excp) { MessageBox.Show(excp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } this.lblNumero.Text = $"El siguiente pedido sera el N°{Pedido.IdPedidoClase}"; this.txtBoxInfoDelivery.Text = string.Empty; this.txtBoxInfoDelivery.Enabled = false; this.chckBoxDelivery.Checked = false; enviarRefresh?.Invoke(); }