private void NewClient_Click(object sender, EventArgs e) { var edit = new ClientCreateEdit(); if (edit.ShowDialog() == DialogResult.OK) { using (var context = new ApplicationDBContext()) { context.AddClient(edit.Client); UpdateView(); } } }
private void EditButton_Click(object sender, EventArgs e) { var edit = new ClientCreateEdit(Client); if (edit.ShowDialog() == DialogResult.OK) { using (var context = new ApplicationDBContext()) { context.EditClient(edit.Client); } Client = edit.Client; this.Close(); } }