internal void DeleteAlergen(Alergen alergenAles, Preparat preparatAles) { RestaurantEntities1 context = new RestaurantEntities1(); context.StergeAlergenDupaID(alergenAles.id_alergen, preparatAles.id_preparat); context.SaveChanges(); }
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!"); }
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!"); }
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); }