Ejemplo n.º 1
0
 // The nice way!
 public static PizzaDelivery BigPizzaProcess3(PizzaRecipe recipe)
 {
     return(recipe
            .Order("big")
            .Prepare()
            .Cook(180)
            .Deliver());
 }
Ejemplo n.º 2
0
        // 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);
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
 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());
 }
Ejemplo n.º 5
0
 public async Task <PizzaRecipe> DeletePizza(PizzaRecipe pizza)
 {
     return((await Connection.QueryAsync <PizzaRecipe>("DeletePizzasV2", new { Name = pizza.Name, Price = pizza.Price }, commandType: CommandType.StoredProcedure)).First());
 }
Ejemplo n.º 6
0
 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());
 }
Ejemplo n.º 7
0
 public static PizzaOrder Order(this PizzaRecipe recipe, string size)
 {
     return(PizzaService.OrderPizza(recipe, size));
 }
Ejemplo n.º 8
0
 // The Arabic way: You read from right to left.
 public static PizzaDelivery BigPizzaProcess2(PizzaRecipe recipe)
 {
     return(DeliverPizza(CookPizza(PreparePizza(OrderPizza(recipe, "big")), 180)));
 }
Ejemplo n.º 9
0
 public static PizzaOrder OrderPizza(PizzaRecipe recipe, string size)
 {
     return(new PizzaOrder());
 }