private void btnUpdate_Click(object sender, EventArgs e) { foreach (ListViewItem item in lstwProducts.SelectedItems) { pro = item.Tag as Entity.Products; } pro.ProductName = txtProductName.Text; pro.UnitPrice = nudUnitPrice.Value; pro.UnitsInStock = int.Parse(nudUnitsInStock.Value.ToString()); pro.id = pro.id; Entity.Categories seciliCat = cbCategori.SelectedItem as Entity.Categories; pro.CategoryID = seciliCat.id; Entity.Suppliers seciliSup = cbSupplier.SelectedItem as Entity.Suppliers; pro.SupplierID = seciliSup.id; int result = proDAL.Update(pro); MessageBox.Show(result.ToString() + " satır etkilendi."); pro.ListViewDoldur(lstwProducts); Entity.Entity en = new Entity.Entity(); en.Temizle(groupBox1); en.Temizle(groupBox2); }
private void silToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult answer = MessageBox.Show("Silmek istediğinize emin misiniz", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Stop); if (answer == DialogResult.Yes) { foreach (ListViewItem li in lstwProducts.SelectedItems) { pro = li.Tag as Entity.Products; pro.id = pro.id; } proDAL.Delete(pro.id); pro.ListViewDoldur(lstwProducts); } }
private void frmListProducts_Load(object sender, EventArgs e) { Entity.Products pro = new Entity.Products(); pro.ListViewDoldur(lstwProducts); }
private void frmUpdateProducts_Load(object sender, EventArgs e) { cat.ComboboxDoldur(cbCategori); sup.ComboboxDoldur(cbSupplier); pro.ListViewDoldur(lstwProducts); }
private void frmDeleteProducts_Load(object sender, EventArgs e) { pro.ListViewDoldur(lstwProducts); }