コード例 #1
0
        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;
        }
コード例 #2
0
        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()));
        }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
ファイル: FoodsController.cs プロジェクト: qile1997/CafeApp
 // GET: Foods
 public ActionResult Index()
 {
     return(View(foodRepo.GetFoods()));
 }