public void ComboboxDoldur(ComboBox cb) { DAL.SuppliersDAL supDAL = new DAL.SuppliersDAL(); List <Suppliers> listSup = supDAL.List(); foreach (Suppliers sup in listSup) { cb.Items.Add(sup); } cb.SelectedIndex = 0; }
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); }
public void listVieweDoldur(ListView lstw) { lstw.Items.Clear(); DAL.SuppliersDAL supDAL = new DAL.SuppliersDAL(); List <Suppliers> listSup = supDAL.List(); foreach (Suppliers sup in listSup) { ListViewItem li = new ListViewItem(); li.Tag = sup; li.Text = sup.CompanyName; li.SubItems.Add(sup.ContactName); li.SubItems.Add(sup.ContactTitle); li.SubItems.Add(sup.Adress); li.SubItems.Add(sup.City); li.SubItems.Add(sup.Country); li.SubItems.Add(sup.Phone); lstw.Items.Add(li); } }