コード例 #1
0
        public AddRecipeForm(string selectedRestaurantName)
        {
            InitializeComponent();
            _recipeRepository       = new RecipeRepository();
            _restaurantOfRecipeName = selectedRestaurantName;
            _ingredientsToAdd       = new List <Ingredient>();

            var ingredients = _recipeRepository.GetAllIngredients();

            ExistingIngredientsListBox.DataSource    = ingredients;
            ExistingIngredientsListBox.DisplayMember = "Name";

            var existingRecipes = _recipeRepository.GetAllExistingRecipes();

            ExistingRecipesListBox.DataSource    = existingRecipes;
            ExistingRecipesListBox.DisplayMember = "Name";
        }