Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            TblProduct p = new TblProduct()
            {
                Description = "Apple", Price = 1.50M
            };

            products.Add(p);
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            TblProduct product = new TblProduct();

            product.Description = textBox1.Text;
            product.Price       = decimal.Parse(textBox2.Text);
            product.Image       = byteBLOBData;
            product.ProductType = (int)cmbCategory.SelectedValue;

            esds.AddToTblProduct(product);
            esds.SaveChanges();

            MessageBox.Show("Product has been Successfully added.");
        }