private void btnAgregaPlatillo_Click(object sender, EventArgs e) { bool agregar = true; if (ValidarVacio()) { if (ValidarMESA()) { if (ValidarVacioPedido()) { int numPe = Convert.ToInt32(txtNumPe.Text.ToString()); if (lPLaPedidos.numPExiste(numPe)) { ErrorPPedido.SetError(txtNumPe, "Numero De Pedido Invalido"); txtNumPe.Focus(); agregar = false; } int numM = Convert.ToInt32(cmbNumMesa.SelectedItem); if (admMesa.RegresaNombreCliente(numM).Equals("NO ASIGNADA")) { MessageBox.Show("MESA SIN ASIGNAR!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); //limpiar errorprovider ErrorPPedido.SetError(cmbNumMesa, ""); ErrorPPedido.SetError(txtNumPe, ""); agregar = false; } if (listPlatillos.ListVacio()) { MessageBox.Show("NO HAY PLATILLOS AGREGADOS!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); agregar = false; } if (agregar != false) { int numBe = Convert.ToInt32(numUpBebidas.Value); dPedidos.AgregaPedido(numPe, numM, numBe); frmAgregaPlatilloV2 agrega = new frmAgregaPlatilloV2(listPlatillos, dPedidos, lPLaPedidos, admMesa, numPe, numM, 2); agrega.ShowDialog(); txtNumPe.Enabled = false; cmbNumMesa.Enabled = false; //limpiar errorprovider ErrorPPedido.SetError(cmbNumMesa, ""); ErrorPPedido.SetError(txtNumPe, ""); } } } } }
private void agregaPlatilloToolStripMenuItem_Click(object sender, EventArgs e) { frmAgregaPlatilloV2 agrega = new frmAgregaPlatilloV2(LPlatillos, dPedidos, lPlaPe, admMesas); agrega.ShowDialog(); }