private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Delete all selected rows?", "Warning", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning) == DialogResult.Yes) { BUS_Suppliers bus = new BUS_Suppliers(); bus.deleteSuppliers(dataGridView1); } refreshData(); }
private void btnSave_Click(object sender, EventArgs e) { if (MessageBox.Show("Save all modified rows?", "Warning", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning) == DialogResult.Yes) { BUS_Suppliers bus = new BUS_Suppliers(); bus.updateSuppliers((DataTable)dataGridView1.DataSource); } refreshData(); }
void refreshData() { BUS_Suppliers bus = new BUS_Suppliers(); dataGridView1.DataSource = bus.getSuppliers(); }
private void Form1_Load(object sender, EventArgs e) { BUS_Suppliers bus = new BUS_Suppliers(); dataGridView1.DataSource = bus.getSuppliers(); }