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 btnSave_Click(object sender, EventArgs e) { Entity.Suppliers sup = new Entity.Suppliers(); sup.CompanyName = txtCompanyName.Text; sup.ContactName = txtContactName.Text; sup.ContactTitle = txtContactTitle.Text; sup.City = txtCity.Text; sup.Country = txtCountry.Text; sup.Adress = txtAddress.Text; sup.Phone = mtxtPhone.Text; DAL.SuppliersDAL supDAL = new DAL.SuppliersDAL(); int result = supDAL.Save(sup); MessageBox.Show(result + " satır eklendi."); Entity.Entity en = new Entity.Entity(); en.Temizle(groupBox1); en.Temizle(groupBox2); }
private void btnSave_Click(object sender, EventArgs e) { Entity.Categories cat = new Entity.Categories(); cat.CategoryName = txtCategoryName.Text; cat.Description = txtDescription.Text; int result = catDAL.Save(cat); MessageBox.Show(result + " satır etkilendi."); Entity.Entity en = new Entity.Entity(); en.Temizle(groupBox1); }
private void btnUpdate_Click(object sender, EventArgs e) { foreach (ListViewItem li in lstwSuppliers.SelectedItems) { sup = li.Tag as Entity.Suppliers; } sup.CompanyName = txtCompanyName.Text; sup.ContactName = txtContactName.Text; sup.ContactTitle = txtContactTitle.Text; sup.City = txtCity.Text; sup.Country = txtCountry.Text; sup.Adress = txtAddress.Text; sup.Phone = mtxtPhone.Text; int result = supDAL.Update(sup); MessageBox.Show(result + " satır güncellendi."); sup.listVieweDoldur(lstwSuppliers); Entity.Entity en = new Entity.Entity(); en.Temizle(groupBox1); en.Temizle(groupBox2); }
private void btnSave_Click(object sender, EventArgs e) { Entity.Products pro = new Entity.Products(); pro.ProductName = txtProductName.Text; pro.UnitPrice = nudUnitPrice.Value; pro.UnitsInStock = int.Parse(nudUnitsInStock.Value.ToString()); Entity.Categories seciliCat = cbCategori.SelectedItem as Entity.Categories; pro.CategoryID = seciliCat.id; Entity.Suppliers seciliSup = cbSupplier.SelectedItem as Entity.Suppliers; pro.SupplierID = seciliSup.id; DAL.ProductsDal proDAL = new DAL.ProductsDal(); int result = proDAL.Save(pro); MessageBox.Show(result.ToString() + " satır etkilendi."); Entity.Entity en = new Entity.Entity(); en.Temizle(groupBox1); en.Temizle(groupBox2); }
private void btnUpdate_Click(object sender, EventArgs e) { Entity.Categories cat = new Entity.Categories(); foreach (ListViewItem li in lstwCategories.SelectedItems) { cat = li.Tag as Entity.Categories; } cat.CategoryName = txtCategoryName.Text; cat.Description = txtDescription.Text; catDAL.Update(cat); cat.ListVieweDoldur(lstwCategories); Entity.Entity en = new Entity.Entity(); en.Temizle(groupBox1); }