private void loadIntoForm() { loadBrands(); CategoryBL categoryBL = new CategoryBL(); cmbCategory.DataSource = categoryBL.GetCategories(); cmbCategory.DataTextField = "name"; cmbCategory.DataValueField = "categoryID"; cmbCategory.DataBind(); VatBL vatBL = new VatBL(); cmbVat.DataSource = vatBL.GetVats(); cmbVat.DataValueField = "vatID"; cmbVat.DataTextField = "vatValue"; cmbVat.DataBind(); cmbVat.SelectedIndex = 3; loadSupplier(); PromotionBL promotionBL = new PromotionBL(); cmbPromotions.DataSource = promotionBL.GetPromotions(true, null, null); cmbPromotions.DataTextField = "name"; cmbPromotions.DataValueField = "promotionID"; cmbPromotions.DataBind(); }
private void loadIntoForm() { loadBrands(); CategoryBL categoryBL = new CategoryBL(); //cmbCategory.DataSource = categoryBL.GetCategories(); cmbCategory.DataSource = categoryBL.GetNestedCategoriesDataTable(true, true); cmbCategory.DataTextField = "name"; cmbCategory.DataValueField = "categoryID"; cmbCategory.DataBind(); VatBL vatBL = new VatBL(); cmbVat.DataSource = vatBL.GetVats(); cmbVat.DataValueField = "vatID"; cmbVat.DataTextField = "vatValue"; cmbVat.DataBind(); cmbVat.SelectedIndex = 3; loadSupplier(); PromotionBL promotionBL = new PromotionBL(); cmbPromotions.DataSource = promotionBL.GetPromotions(true, null, null); cmbPromotions.DataTextField = "name"; cmbPromotions.DataValueField = "promotionID"; cmbPromotions.DataBind(); cmbUnitOfMeasure.DataSource = new UnitOfMeasureBL().GetUnitsOfMeasure(true); cmbUnitOfMeasure.DataTextField = "FullName"; cmbUnitOfMeasure.DataValueField = "unitOfMeasureID"; cmbUnitOfMeasure.SelectedValue = "2"; cmbUnitOfMeasure.DataBind(); cmbCategories.DataSource = categoryBL.GetNestedCategoriesDataTable(); cmbCategories.DataTextField = "name"; cmbCategories.DataValueField = "categoryID"; cmbCategories.DataBind(); if (!bool.Parse(ConfigurationManager.AppSettings["productInMultipleCategories"])) { divProductInMultipleCategories.Visible = false; } else { btnAddProductToCategory.Enabled = cmbCategory.SelectedIndex > 0 ? true : false; } }