Exemple #1
0
 public MainPage()
 {
     this.InitializeComponent();
     MenuItemManager.GetMenuItem();
     mainListView.ItemsSource = MenuItemManager.menuItems;
     SqlHelper.PrepareConnection();
     myFrame.Navigate(MenuItemManager.menuItems[0].content);
 }
 public ActionResult AddToCart(int ID, string returnURL, int quantity)
 {
     GetShoppingCart();
     BL.Models.MenuItemModel menuItemModel = MenuItemManager.GetMenuItem(ID);
     cart.VendorID = (MenuManager.GetMenu(menuItemModel.MenuItem)).VendorID;
     ShoppingCartManager.Add(cart, menuItemModel, quantity);
     Session["Cart"] = cart;
     return(Redirect(returnURL));
 }
Exemple #3
0
        public void Update()
        {
            MenuItemModel menuItem = new MenuItemModel
            {
                ItemID        = 2,
                MenuItem      = 2,
                ItemName      = "Good Eats",
                Price         = 2,
                Picture       = "picture_here",
                Description   = "very spicy",
                MenuSectionID = 2
            };

            MenuItemManager.Update(menuItem);

            MenuItemModel newMenuItem = MenuItemManager.GetMenuItem(2);

            Assert.AreEqual(menuItem.ItemID, newMenuItem.ItemName);
        }
Exemple #4
0
        public ActionResult EditItem(int ID)
        {
            MenuItemModel item = MenuItemManager.GetMenuItem(ID);

            return(View(item));
        }