public void initializare()
        {
            var res    = contex.GetAllCategorii();
            var result = res.Select(x => new GetAllCategorii_Result
            {
                denumire     = x.denumire,
                id_categorie = x.id_categorie
            }
                                    ).ToList();
            List <string> l = new List <string>();

            for (int i = 0; i < result.Count; i++)
            {
                var aux = result.ElementAt(i).denumire;
                l.Add(aux);
            }
            Categorii = l;


            var res1   = contex.GetAllAlergeni();
            var resul1 = res1.Select(x1 => new GetAllAlergeni_Result
            {
                denumire    = x1.denumire,
                id_alergeni = x1.id_alergeni
            }).ToList();
            List <string> l1 = new List <string>();

            for (int i = 0; i < resul1.Count; i++)
            {
                var aux = resul1.ElementAt(i).denumire;
                l1.Add(aux);
            }
            Alergeni = l1;
        }
Beispiel #2
0
        public void initializare()
        {
            var res    = contex.GetAllCategorii();
            var result = res.Select(x => new GetAllCategorii_Result
            {
                denumire     = x.denumire,
                id_categorie = x.id_categorie
            }
                                    ).ToList();
            List <string> l = new List <string>();

            for (int i = 0; i < result.Count; i++)
            {
                var aux = result.ElementAt(i).denumire;
                l.Add(aux);
            }
            Categorii = l;


            var res1   = contex.SPGetPreparate();
            var resul1 = res1.Select(x1 => new SPGetPreparate_Result
            {
                cantintate_portie    = x1.cantintate_portie,
                cantitate_restaurant = x1.cantitate_restaurant,
                denumire             = x1.denumire,
                id_categorie         = x1.id_categorie,
                id_preparat          = x1.id_preparat,
                pret = x1.pret
            }).ToList();
            List <string> l1 = new List <string>();

            for (int i = 0; i < resul1.Count; i++)
            {
                var aux = resul1.ElementAt(i).denumire;
                l1.Add(aux);
            }
            Preparate = l1;
        }