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, "");
                        }
                    }
                }
            }
        }
示例#2
0
        private void cmbNumPe_SelectedIndexChanged(object sender, EventArgs e)
        {
            dtgvPlatillo.Rows.Clear();
            numPe   = Convert.ToInt32(cmbNumPe.SelectedItem.ToString());
            numMesa = dPedidos.PedidoMesa(numPe);
            string nombreC = admMesa.RegresaNombreCliente(numMesa);

            lblNombre.Text = nombreC;

            string[] Aclave   = lPLaPedidos.RegresaPlatilloClaves(numPe);
            string[] Adesc    = lPLaPedidos.RegresaPlatilloDescripcion(numPe);
            string[] Aimporte = lPLaPedidos.RegresaPlatilloImporte(numPe);
            string[] Atiempo  = lPLaPedidos.RegresaPlatilloTiempo(numPe);
            for (int i = 0; i < Aclave.Length; i++)
            {
                dtgvPlatillo.Rows.Add(Aclave[i], Adesc[i], Aimporte[i], Atiempo[i]);
            }
        }
        private void cmbNumMesa_SelectedIndexChanged(object sender, EventArgs e)
        {
            dgvMesas.Rows.Clear();
            int    numM    = Convert.ToInt32(cmbNumMesa.SelectedItem.ToString());
            string desc    = admMesa.RegresaDescripcion(numM);
            string estatus = admMesa.RegresaEstatus(numM);
            string nombreC = admMesa.RegresaNombreCliente(numM);
            int    numP    = admMesa.RegresaNumPersonas(numM);

            dgvMesas.Rows.Add(numM, nombreC, desc, numP, estatus);
        }