public bool MakeNewPizza(ref BLL.PizzaModel pz_m, List <BLL.IngredientModel> ingres) { try { DAL.Pizza pz = new DAL.Pizza(); pz.Name = pz_m.Name; pz.Price = pz_m.Price; pz.PizzaType_ID = 2; db.Pizzas.Create(pz); db.Save(); pz_m = new PizzaModel(db.Pizzas.GetLastRecord()); foreach (var ingre in ingres) { Receipt rc = new Receipt(); rc.Pizza_ID = pz_m.ID; rc.Ingredient_ID = ingre.ID; db.Receipts.Create(rc); } } catch { } if (db.Save() > 0) { return(true); } else { return(false); } }
public void updatePizza(int pizzaID, Pizza s) { throw new NotImplementedException(); }