private void LoadIngredients() { dt = ingredientBLL.GetIngredients(); cbbIngredient.DisplayMember = "IngredientName"; cbbIngredient.ValueMember = "IngredientId"; cbbIngredient.DataSource = dt; }
public frmRpt_Inventory() { InitializeComponent(); //Load nguyen lieu ingredientBLL = new IngredientBLL(); DataTable dt = ingredientBLL.GetIngredients(); //Thêm option chọn tất cả DataRow allIgre = dt.NewRow(); allIgre["IngredientName"] = "Tất cả"; allIgre["IngredientId"] = "0"; dt.Rows.Add(allIgre); cbNguyenLieu.DisplayMember = "IngredientName"; cbNguyenLieu.ValueMember = "IngredientId"; cbNguyenLieu.DataSource = dt; cbNguyenLieu.SelectedIndex = cbNguyenLieu.Items.Count - 1; inventoryResource = new InventoryBLL(); }