Example #1
0
        // Food
        public List <BFood> GetAllFood()
        {
            FoodController foodController = new FoodController();
            List <BFood>   foundFoods     = foodController.GetAllFood();

            return(foundFoods);
        }
Example #2
0
        private void SbmitClicked(object sender, EventArgs e)
        {
            string  id   = tbId.Text;
            dynamic food = FoodController.GetAllFood(id);

            if (food != null)
            {
                dynamic restaurant = RestaurantController.GetRestaurant(id);
                if (restaurant != null)
                {
                    tbName.Text = restaurant.Name;
                }
                else
                {
                    MessageBox.Show("No Restaurant found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                dgView.DataSource = food;
            }
            else
            {
                MessageBox.Show("No Restaurant found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }