private void Entry_Click(object sender, EventArgs e) { add(comboBox1.SelectedItem.ToString(), qtext.Text); FoodRepository f = new FoodRepository(); total = f.GetFoods(comboBox1.Text).FoodPrice *(float.Parse(qtext.Text)) + total; }
public ActionResult Menu() { int SessionId = SessionID(); var TableData = orderRepo.CheckSeat(SessionId); if (TableData != null) { ViewBag.TableNo = TableData.TableNo; } else { ViewBag.TableNo = "Empty"; } ViewBag.Username = userRepo.userRoles(SessionId).Username.ToString(); ViewBag.Count = orderRepo.FoodCount(SessionId); return(View(foodRepo.GetFoods())); }
public void TestGetFood() { using (var context = new FoodContext(ContextOptions)) { var repo = new FoodRepository(context); repo.CreateFood(new Food { Calories = 300, Carbohydrates = 34, Fats = 33, Name = "Chocolate", Protein = 5 }); Assert.Single(repo.GetFoods(new FoodRequest { Name = "Chocolate" })); repo.Dispose(); } }
// GET: Foods public ActionResult Index() { return(View(foodRepo.GetFoods())); }