private void DobavlenieVid_Click(object sender, EventArgs e) { string name = textBoxVidName.Text; Vid v = new Vid(); v.Insert(name); this.vidTableAdapter.Fill(this.skladDataSet6.Vid); textBoxVidName.Text = ""; }
private void RedaktirVid_Click(object sender, EventArgs e) { int f = dataGridViewVid.CurrentRow.Index; string name = textBoxRedakVidName.Text; int id = Convert.ToInt32(dataGridViewVid[0, f].Value); Vid v = new Vid(); v.Update(name, id); this.vidTableAdapter.Fill(this.skladDataSet6.Vid); textBoxRedakVidName.Text = ""; }
private void DeleteVid_Click(object sender, EventArgs e) { int f = dataGridViewVid.CurrentRow.Index; if (f == 0) { MessageBox.Show("Не выбрана строка для удаления"); } else { int id = Convert.ToInt32(dataGridViewVid[0, f].Value); Vid v = new Vid(); v.Delete(id); this.vidTableAdapter.Fill(this.skladDataSet6.Vid); } textBoxRedakVidName.Text = ""; }