public ActionResult Index(PizzaStoreModel m)
 {
     //data.PizzaOrder = new PizzaOrderDAO();
     data.PizzaOrder.Customer = m.Customer;
     TempData["temp"]         = data;
     return(RedirectToAction("Ordering"));
 }
        public ActionResult Review(PizzaStoreModel m)
        {
            m = TempData["final"] as PizzaStoreModel;
            var x = InsertPizzaOrder(m.PizzaOrder);

            return(RedirectToAction("Index"));
        }
 public ActionResult CustomerInfo(PizzaStoreModel m)
 {
     client             = new HttpClient();
     client.BaseAddress = new Uri(url);
     client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
     data.History = getHistory(int.Parse(m.Customer.ID.ToString())).Result;
     return(View(data));
 }
 public ActionResult Ordering()
 {
     data               = TempData["temp"] as PizzaStoreModel;
     client             = new HttpClient();
     client.BaseAddress = new Uri(url);
     client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
     data.ListOfTopping = getToppings().Result;
     data.ListOfCheeses = getCheeses().Result;
     data.ListOfSizes   = getSizes().Result;
     data.ListOfSauces  = getSauces().Result;
     data.ListOfCrusts  = getCrusts().Result;
     TempData["temp"]   = data;
     return(View(data));
 }
        public ActionResult Ordering(PizzaStoreModel m)
        {
            data = TempData["temp"] as PizzaStoreModel;
            //data.PizzaOrder.Order = new OrderDAO();
            //data.PizzaOrder.Order.Pizzas = new List<PizzaDAO>();
            PizzaDAO pizza = new PizzaDAO();

            pizza.Toppings = new List <ToppingDAO>();
            pizza.Cheeses  = new List <CheeseDAO>();
            pizza.Crust    = new CrustDAO();
            pizza.Sauce    = new SauceDAO();
            pizza.Size     = new SizeDAO();

            for (int i = 0; i < m.ListOfTopping.Count; i++)
            {
                m.ListOfTopping[i].ID   = data.ListOfTopping[i].ID;
                m.ListOfTopping[i].Name = data.ListOfTopping[i].Name;
            }
            for (int i = 0; i < m.ListOfCheeses.Count; i++)
            {
                m.ListOfCheeses[i].ID   = data.ListOfCheeses[i].ID;
                m.ListOfCheeses[i].Name = data.ListOfCheeses[i].Name;
            }
            for (int i = 0; i < m.ListOfSizes.Count; i++)
            {
                m.ListOfSizes[i].ID   = data.ListOfSizes[i].ID;
                m.ListOfSizes[i].Name = data.ListOfSizes[i].Name;
            }
            for (int i = 0; i < m.ListOfCrusts.Count; i++)
            {
                m.ListOfCrusts[i].ID   = data.ListOfCrusts[i].ID;
                m.ListOfCrusts[i].Name = data.ListOfCrusts[i].Name;
            }

            for (int i = 0; i < m.ListOfSauces.Count; i++)
            {
                m.ListOfSauces[i].ID   = data.ListOfSauces[i].ID;
                m.ListOfSauces[i].name = data.ListOfSauces[i].name;
            }

            foreach (var item in m.ListOfTopping)
            {
                if (item.picked == true)
                {
                    pizza.Toppings.Add(item);
                }
            }
            foreach (var item in m.ListOfCheeses)
            {
                if (item.picked == true)
                {
                    pizza.Cheeses.Add(item);
                }
            }
            foreach (var item in m.ListOfCrusts)
            {
                if (item.picked == true)
                {
                    pizza.Crust.ID   = item.ID;
                    pizza.Crust.Name = item.Name;
                }
            }
            foreach (var item in m.ListOfSauces)
            {
                if (item.picked == true)
                {
                    pizza.Sauce.ID   = item.ID;
                    pizza.Sauce.name = item.name;
                }
            }
            foreach (var item in m.ListOfSizes)
            {
                if (item.picked == true)
                {
                    pizza.Size.ID   = item.ID;
                    pizza.Size.Name = item.Name;
                }
            }
            data.PizzaOrder.Order.Pizzas.Add(pizza);
            TempData["temp"] = data;
            return(View(data));
        }
 public ActionResult Review()
 {
     data = TempData["temp"] as PizzaStoreModel;
     TempData["final"] = data;
     return(View(data));
 }