public string[] RegresaPlatilloTiempo(int numP)
        {
            int numPlatillos = this.CalcularNumPlatillos(numP);

            int[]    claves = this.RetornaClavesP();
            string[] cadena = new string[numPlatillos];
            int      pos    = 0;

            int clavePla = 0, cant = 0, tiempo = 0;

            for (int j = 0; j < lPlatillosPedidos.Count; j++)
            {
                if (lPlatillosPedidos.ElementAt(j).pNumP == numP)
                {
                    clavePla = lPlatillosPedidos.ElementAt(j).pClaveP;
                    cant     = lPlatillosPedidos.ElementAt(j).pCantidad;
                    for (int k = 0; k < claves.Length; k++)
                    {
                        if (clavePla == claves[k])
                        {
                            tiempo = lPlatillos.RegresaTiempo(claves[k]);
                            for (int l = 0; l < cant; l++)
                            {
                                cadena[pos] = tiempo.ToString();
                                pos++;
                            }
                            break;
                        }
                    }
                }
            }
            return(cadena);
        }
Exemple #2
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            int    cant     = Convert.ToInt32(numUpCantidad.Value.ToString());
            string desc     = cmbDescripcion.SelectedItem.ToString();
            int    clavePla = listPlatillos.NombreAClave(desc);
            double importe  = listPlatillos.RegresaImporte(clavePla);
            int    tiempo   = listPlatillos.RegresaTiempo(clavePla);

            lPLaPedidos.AgregarPlatillo(numPe, clavePla, cant);
            dPedidos.ActualizaPedido(numPe);
            //agrega al grid
            dtgvPlatillo.Rows.Clear();
            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]);
            }
        }