// The nice way! public static PizzaDelivery BigPizzaProcess3(PizzaRecipe recipe) { return(recipe .Order("big") .Prepare() .Cook(180) .Deliver()); }
// The ol'good way. public static PizzaDelivery BigPizzaProcess1(PizzaRecipe recipe) { var order = OrderPizza(recipe, "big"); var coldPizza = PreparePizza(order); var hotPizza = CookPizza(coldPizza, 180); var delivery = DeliverPizza(hotPizza); return(delivery); }
private async void btnUpdate_Click(object sender, EventArgs e) { using (IRepository repo = RepositoryFactory.Create()) { PizzaRecipe p = new PizzaRecipe(); int id = (int)lstPizzas.SelectedItems[0].Tag; try { var pizzaUpdate = await repo.EditPizza(new PizzaRecipe { ID = id, Name = txtName.Text, Price = float.Parse(txtPrice.Text) }); MessageBox.Show("Updated Successfully"); } catch (Exception ex) { MessageBox.Show("You Need To Fill The Boxes To Update"); } FillLstPizzas(); CancelPizza(); ClearPizza(); } }
public async Task <PizzaRecipe> EditPizza(PizzaRecipe pizza) { return((await Connection.QueryAsync <PizzaRecipe>("EditPizzas", new { ID = pizza.ID, Name = pizza.Name, Price = pizza.Price }, commandType: CommandType.StoredProcedure)).FirstOrDefault()); }
public async Task <PizzaRecipe> DeletePizza(PizzaRecipe pizza) { return((await Connection.QueryAsync <PizzaRecipe>("DeletePizzasV2", new { Name = pizza.Name, Price = pizza.Price }, commandType: CommandType.StoredProcedure)).First()); }
public async Task <PizzaRecipe> AddNewPizzaContent(PizzaRecipe pizza) { return((await Connection.QueryAsync <PizzaRecipe>("AddNewPizzaContent", new { Ingredients_id = pizza.Ingredient_id, Pizza_id = pizza.Pizza_id }, commandType: CommandType.StoredProcedure)).First()); }
public static PizzaOrder Order(this PizzaRecipe recipe, string size) { return(PizzaService.OrderPizza(recipe, size)); }
// The Arabic way: You read from right to left. public static PizzaDelivery BigPizzaProcess2(PizzaRecipe recipe) { return(DeliverPizza(CookPizza(PreparePizza(OrderPizza(recipe, "big")), 180))); }
public static PizzaOrder OrderPizza(PizzaRecipe recipe, string size) { return(new PizzaOrder()); }