private void R01addButton_Click(object sender, EventArgs e) { if (R01_name_category.Text == "") { MessageBox.Show("Заполните поля!"); } else { try { bd_kidsDataSet.R01_people_categoryRow row; row = bd_kidsDataSet.R01_people_category.NewR01_people_categoryRow(); row.name_category = R01_name_category.Text; row.note = R01_note.Text == " " ? " " : R01_note.Text; this.bd_kidsDataSet.R01_people_category.Rows.Add(row); this.r01_people_categoryTableAdapter.Update(this.bd_kidsDataSet.R01_people_category); } catch (Exception ee) { MessageBox.Show("Возникли неприятности"); } } R01_name_category.Clear(); R01_note.Clear(); R01.Refresh(); }
private void R01deleteButton_Click(object sender, EventArgs e) { try { bd_kidsDataSet.R01_people_categoryRow row; row = bd_kidsDataSet.R01_people_category.FindBycode_category((long)R01.CurrentRow.Cells[0].Value); row.Delete(); this.r01_people_categoryTableAdapter.Update(this.bd_kidsDataSet.R01_people_category); } catch (Exception ee) { MessageBox.Show("Возникли неприятности"); } R01.Refresh(); }