private void DobavleniePostav_Click(object sender, EventArgs e) { string name = textBoxPostavName.Text; string address = textBoxPostavAdress.Text; string tel = textBoxPostavTelefon.Text; Postavchik p = new Postavchik(); p.Insert(name, address, tel); this.postavchikTableAdapter.Fill(this.skladDataSet7.Postavchik); textBoxPostavName.Text = ""; textBoxPostavTelefon.Text = ""; textBoxPostavAdress.Text = ""; }
private void RedaktirPostav_Click(object sender, EventArgs e) { int f = dataGridViewPostav.CurrentRow.Index; string name = textBoxPostavRedakName.Text; string address = textBoxPostavRedaAdres.Text; string tel = textBoxPostavRedaTel.Text; int id = Convert.ToInt32(dataGridViewPostav[0, f].Value); Postavchik p = new Postavchik(); p.Update(name, address, tel, id); this.postavchikTableAdapter.Fill(this.skladDataSet7.Postavchik); textBoxPostavRedaAdres.Text = ""; textBoxPostavRedakName.Text = ""; textBoxPostavRedaTel.Text = ""; }
private void DeletePostav_Click(object sender, EventArgs e) { int f = dataGridViewPostav.CurrentRow.Index; if (f == 0) { MessageBox.Show("Не выбрана строка для удаления"); } else { int id = Convert.ToInt32(dataGridViewPostav[0, f].Value); Postavchik p = new Postavchik(); p.Delete(id); this.postavchikTableAdapter.Fill(this.skladDataSet7.Postavchik); } textBoxPostavRedaAdres.Text = ""; textBoxPostavRedakName.Text = ""; textBoxPostavRedaTel.Text = ""; }