コード例 #1
0
        internal void DeleteAlergen(Alergen alergenAles, Preparat preparatAles)
        {
            RestaurantEntities1 context = new RestaurantEntities1();

            context.StergeAlergenDupaID(alergenAles.id_alergen, preparatAles.id_preparat);
            context.SaveChanges();
        }
コード例 #2
0
        internal void DeletePreparatAlergen(Alergen alergenAles, Preparat preparatAles, Cont user)
        {
            RestaurantEntities1 context = new RestaurantEntities1();

            context.StergeAlergenDupaID(alergenAles.id_alergen, preparatAles.id_preparat);
            context.SaveChanges();
            MainViewModel.Instance.ActiveScreen = new DetaliiPreparatViewModel(preparatAles, user);
            MessageBox.Show("Alergen Sters!");
        }
コード例 #3
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!");
        }
コード例 #4
0
        public Fotografie FotografieCurenta(Preparat preparat)
        {
            RestaurantEntities1 context = new RestaurantEntities1();

            Fotografie aux = new Fotografie();

            foreach (var product in context.Preparats.SqlQuery("[CautaPreparat] @denumire",
                                                               new SqlParameter("denumire", preparat.denumire)).ToList())
            {
                var poze = context.Fotografies.ToList();
                foreach (var poza in poze)
                {
                    if (poza.id_preparat == product.id_preparat)
                    {
                        aux = poza;
                        break;
                    }
                }
            }
            return(aux);
        }