public OtherPurchaseForm() { InitializeComponent(); List<Supplier1> aSuppliers = new List<Supplier1>(); Supplier1DAO aDao = new Supplier1DAO(); aSuppliers = aDao.GetAllSupplier(); supplierNamecomboBox.DataSource = aSuppliers; supplierNamecomboBox.DisplayMember = "SupplierName"; supplierNamecomboBox.ValueMember = "SupplierId"; }
private void supplierAddbutton_Click(object sender, EventArgs e) { Supplier1 aSuppllier =new Supplier1(); aSuppllier.SupplierName = NametextBox.Text.Replace("'", "''"); aSuppllier.SupplierInformation = informationtextBox.Text.Replace("'", "''"); Supplier1DAO aDao=new Supplier1DAO(); string sr = aDao.InsertSupplier(aSuppllier); if (sr == "Supplier1 Insert Successfully") { NametextBox.Clear(); informationtextBox.Clear(); } MessageBox.Show(sr); }