示例#1
0
        public void AdaugaInCos(Cont user, Meniu 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.AdaugareMeniuInComanda(idComanda, preparatAles.denumireMeniu, cantitate);
            context.SaveChanges();
            MessageBox.Show("Meniu Adaugat!");
        }