示例#1
0
        public ActionResult GetPriceOnTopping(string topping, string currentPrice)
        {
            try
            {
                string       v            = Request.QueryString["value"];
                DisplayModel model        = new DisplayModel();
                var          toppingPrice = /*db.Pizzas.Select(t => t.PizzaPrice).FirstOrDefault();*/ db.GetPriceOnToppingSelected(topping).SingleOrDefault();
                var          newPrice     = Convert.ToDecimal(currentPrice) + toppingPrice;
                Menu(topping);

                return(Json(new { price = newPrice.ToString() }));
            }
            catch (Exception e)
            {
                throw;
            }
        }