private void frmProductAdd_Load(object sender, EventArgs e) { keyValues = CategoryDataAccess.GetCategoriesForProduct(); if (keyValues != null) { foreach (var item in keyValues) { cmbCategory.Items.Add(item.Value); categoryIds.Add(item.Key); } } }
private void ViewCategories() { keyValues = CategoryDataAccess.GetCategoriesForProduct(); if (keyValues != null) { cmbCategory.Items.Add("All"); foreach (var item in keyValues) { cmbCategory.Items.Add(item.Value); categoryIds.Add(item.Key); } } cmbCategory.SelectedIndex = 0; }
private void frmProductAdd_Load(object sender, EventArgs e) { keyValues = CategoryDataAccess.GetCategoriesForProduct(); if (keyValues != null && cmbCategory.Items.Count < 1) { foreach (var item in keyValues) { cmbCategory.Items.Add(item.Value); categoryIds.Add(item.Key); } } if (productId > 0) { btnAdd.Text = "Update"; } }
public frmProductAdd(Form frmProduct, int userId, int productId) { this.frmProduct = frmProduct; this.userId = userId; this.productId = productId; InitializeComponent(); keyValues = CategoryDataAccess.GetCategoriesForProduct(); if (keyValues != null && cmbCategory.Items.Count < 1) { foreach (var item in keyValues) { cmbCategory.Items.Add(item.Value); categoryIds.Add(item.Key); } } ViewProductInfo(); }