예제 #1
0
        public ActionResult Shop()
        {
            ViewBag.Message = "Your shopping page.";
            _ItemsController itemsController = new _ItemsController();
            List <Item>      items           = itemsController.FetchAllItems();

            return(View(items));
        }
예제 #2
0
        public static Cart Create(int cartId)
        {
            _ItemsController    itemsController     = new _ItemsController();
            CartItemsController cartItemsController = new CartItemsController();

            User user = new UserBuilder()
                        .SetFirstName("August")
                        .SetLastName("Alexandersson")
                        .SetAge(21)
                        .SetTitle("Dr")
                        .SetBillingAddress("Sandlyckevägen 28")
                        .SetCountry("Sweden")
                        .SetCity("Borås")
                        .SetEmail("*****@*****.**")
                        .SetId(0)
                        .Build();

            List <PickedItem> items = itemsController
                                      .GetItemsFromCartItems(
                cartItemsController.GetListOfItems(cartId)
                );

            return(new Cart(cartId, items, user));
        }