示例#1
0
        private void BtnEkle_Click(object sender, EventArgs e)
        {
            CategoryTable kategori = new CategoryTable();

            kategori.CategoryName = TxtKatAd.Text;
            entity.CategoryTable.Add(kategori);
            entity.SaveChanges();

            MessageBox.Show("Kategori Eklendi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        private void BtnUrunEkle_Click(object sender, EventArgs e)
        {
            ProductTable urun = new ProductTable();

            urun.ProductName = TxtUrunAd.Text;
            urun.Brand       = TxtUrunMarka.Text;
            urun.Stock       = short.Parse(TxtUrunStok.Text);
            urun.Price       = decimal.Parse(TxtUrunFiyat.Text);
            urun.State       = true;
            urun.Category    = int.Parse(CmbUrunKategori.SelectedValue.ToString());
            entity.ProductTable.Add(urun);
            entity.SaveChanges();

            MessageBox.Show("Ürün Eklendi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }