示例#1
0
        public ObservableCollection <Preparat> PreparateMeniu(Meniu meniuAles)
        {
            RestaurantEntities1 context = new RestaurantEntities1();

            var preparate = context.AfisarePreparateMeniu(meniuAles.denumireMeniu).ToList();
            ObservableCollection <Preparat> result = new ObservableCollection <Preparat>();

            foreach (var preparat in preparate)
            {
                Preparat aux = new Preparat();
                aux.id_categorie     = preparat.id_categorie;
                aux.id_preparat      = preparat.id_preparat;
                aux.pret             = preparat.pret;
                aux.cantitate        = preparat.cantitate;
                aux.cantitate_totala = preparat.cantitate_totala;
                aux.denumire         = preparat.denumire;
                result.Add(aux);
            }
            return(result);
        }