示例#1
0
        private void Bind()
        {
            if (ProductTypeID == Guid.Empty)
            {
                btnSave.Text = "Add";
            }

            var allProducts = productController.All().Where(p => p.Status == "Active").ToList();

            foreach (var product in allProducts)
            {
                ComboboxItem item = new ComboboxItem();
                item.Text  = $"{product.Name} - {product.SKU}";
                item.Value = product.ID;
                comProductType.Items.Add(item);
                comProductType.SelectedIndex = 0;
            }
            grdProducts.DataSource = productTypeController.GetAllDataTable();
        }