Exemplo n.º 1
0
        private void LoadComboBoxCostRange()
        {
            CostRanges costRanges = new CostRanges();

            cbbCostRange.DataSource    = costRanges.ListAllCostRanges();
            cbbCostRange.DisplayMember = "Cost";
            cbbCostRange.ValueMember   = "IDcost";
        }
        private void LoadDropdowlist()
        {
            Ingredients Listingredients = new Ingredients();

            DropDownListIngredient.DataSource     = Listingredients.ListAll();
            DropDownListIngredient.DataTextField  = "Name";
            DropDownListIngredient.DataValueField = "ID";
            DropDownListIngredient.DataBind();

            MeasurementUnits measurementUnits = new MeasurementUnits();

            DropDownListMeasurementUnit.DataSource     = measurementUnits.ListMeasurementUnits();
            DropDownListMeasurementUnit.DataTextField  = "Name";
            DropDownListMeasurementUnit.DataValueField = "ID";
            DropDownListMeasurementUnit.DataBind();

            DifficultieRanges difficultieRanges = new DifficultieRanges();

            DropDownListRecipeDifficulty.DataSource     = difficultieRanges.ListAllDifficutyRanges();
            DropDownListRecipeDifficulty.DataTextField  = "Difficulty";
            DropDownListRecipeDifficulty.DataValueField = "IdDifficulty";
            DropDownListRecipeDifficulty.DataBind();

            TimesToMake timesToMake = new TimesToMake();

            DropDownListTimeToMake.DataSource     = timesToMake.ListAllTimesToMake();
            DropDownListTimeToMake.DataTextField  = "Time";
            DropDownListTimeToMake.DataValueField = "IdTimeToMake";
            DropDownListTimeToMake.DataBind();

            CostRanges costRanges = new CostRanges();

            DropDownListCostRange.DataSource     = costRanges.ListAllCostRanges();
            DropDownListCostRange.DataTextField  = "Cost";
            DropDownListCostRange.DataValueField = "IDcost";
            DropDownListCostRange.DataBind();

            CuisineTypes cuisineTypes = new CuisineTypes();

            DropDownListCuisineType.DataSource     = cuisineTypes.ListAllCuisineType();
            DropDownListCuisineType.DataTextField  = "CuisineTypeName";
            DropDownListCuisineType.DataValueField = "IdCuisine";
            DropDownListCuisineType.DataBind();

            DishCategories dishCategories = new DishCategories();

            CheckBoxListCategory.DataSource     = dishCategories.ListAllDishCategories();
            CheckBoxListCategory.DataTextField  = "DishCategoryName";
            CheckBoxListCategory.DataValueField = "DishCategoryID";
            CheckBoxListCategory.DataBind();
        }