Exemple #1
0
        public void AdaugaInCos(Cont user, Preparat preparatAles, int cantitate)
        {
            RestaurantEntities1 context = new RestaurantEntities1();
            var comenzi = context.Comandas.ToList();

            int idComanda = 0;

            foreach (var comanda in comenzi)
            {
                if (comanda.Cont.email == user.email && comanda.id_status == 505)
                {
                    idComanda = comanda.id_comanda;
                    break;
                }
            }
            context.AdaugarePreparatInComanda(idComanda, preparatAles.denumire, cantitate);
            context.SaveChanges();
            MessageBox.Show("Preparat Adaugat!");
        }