private void largePhoto_PictureBox_Click(object sender, EventArgs e) { int productID = AccesDatabase.getProductModel_ID(); var ProductModel = AccesDatabase.getProductModel(productID); MemoryStream ms = new MemoryStream(ProductModel.LargePhoto); Image image = Image.FromStream(ms); largePhoto_PictureBox.Image = image; productModelID.Text = ProductModel.ProductModelID.ToString(); productModel_Name.Text = ProductModel.Name; productModel_Price.Text = ProductModel.ListPrice.ToString(); productModelID.Enabled = false; productModel_Name.Enabled = false; productModel_Price.Enabled = false; showButtonsSize(productID); }
private void showButtonsSize(int id) { List <Product> sizesPro = AccesDatabase.getProductModel_Sizes(id); button_FlowLayout.Controls.Clear(); foreach (var size in sizesPro) { if (size.Size != null) { Button b = new Button(); b.Text = size.Size; b.Name = size.ProductID.ToString(); button_FlowLayout.Controls.Add(b); b.Click += buttonOnClicky; } } }