private void RentOrdering_Click(object sender, EventArgs e) { var createRent = new RentCreateEdit(); if (createRent.ShowDialog() == DialogResult.OK) { using (var context = new ApplicationDBContext()) { context.AddRent(createRent.Rent); } } }
private void EditButton_Click(object sender, EventArgs e) { var edit = new RentCreateEdit(Rent); if (edit.ShowDialog() == DialogResult.OK) { using (var context = new ApplicationDBContext()) { context.EditRent(edit.Rent); } Rent = edit.Rent; this.Close(); } }