public IHttpActionResult GetAllMenuItems() { MenuItemService menuItemService = CreatedMenuItemService(); var menuItems = menuItemService.GetAllMenuItems(); return(Ok(menuItems)); }
private void FillListView() { List <MenuItem> menuItems = menuItemSrv.GetAllMenuItems(); lstMenu.Items.Clear(); foreach (MenuItem mi in menuItems) { ListViewItem lvItem = new ListViewItem(mi.ProductID.ToString()); lvItem.SubItems.Add(mi.Name); lvItem.SubItems.Add(mi.Quantity.ToString()); lvItem.SubItems.Add(mi.Price.ToString()); lvItem.SubItems.Add(mi.PreparationTime.ToString()); lvItem.SubItems.Add(mi.Category.ToString()); lvItem.Tag = mi; lstMenu.Items.Add(lvItem); } }
private void DisplayItemOverview() { List <MenuItem> menuItems = menuItemService.GetAllMenuItems(); lvwItemOverview.Items.Clear(); foreach (MenuItem item in menuItems) { ListViewItem lvwItem = new ListViewItem(new[] { item.ItemID.ToString(), item.ItemName, item.InStock.ToString() }) { Font = new Font(lvwItemOverview.Font, FontStyle.Regular), Tag = item }; lvwItemOverview.Items.Add(lvwItem); } }