Exemplo n.º 1
0
        private void tablaPlatos(int idPlato, float cantidad)
        {
            DAL.DetalleProduccion detalle = new DAL.DetalleProduccion();

            //DAL.Plato infPlato = BRL.PlatoBRL.InfPalto(idPlato, cantidad);

            detalle.Cantidad = cantidad;
            detalle.Plato    = BRL.PlatoBRL.InfPalto(idPlato, cantidad);;

            produccion.setListaDetalle(detalle);

            celdasPlato();

            //produccion.setListaDetalle(new DAL.DetalleProduccion(idPlato, cantidad));

            this.dgvPlatos.Rows.Add(detalle.Plato.Id, detalle.Plato.Nombre, null, null, cantidad, null, String.Format("{0:0.00}", detalle.Plato.Costo));

            lblTotal.Text = String.Format("{0:0.00}", detalle.Plato.Costo + Convert.ToDecimal(lblTotal.Text));

            foreach (DAL.Ingrediente ing in detalle.Plato.getIngredientes())
            {
                celdasIngredientes();

                this.dgvPlatos.Rows.Add(idPlato, null, ing.IdProducto, ing.IdProducto, String.Format("{0:0.00}", ing.Cantidad), ing.Unidad.Nombre, null);

                ing.Cantidad = DAL.Validar.ConvertirAKilo(ing.Unidad.Nombre.ToLower(), ing.Cantidad);

                //listaProducto.Add(new DAL.Producto(ing.IdProducto, DAL.Validar.ConvertirAKilo(ing.Unidad.Nombre.ToLower(), ing.Cantidad), idPlato));
            }
        }