示例#1
0
        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();
                }
            }
        }
示例#2
0
        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();
            }
        }