private void btnCreateBill_Click(object sender, EventArgs e) { var result = new FormAddBill(bill => _db.Bills.Add(bill)).ShowDialog(); if (result == DialogResult.OK) { _db.SaveChanges(); _Reload(); } }
private void _UpdateBill(int id) { var result = new FormAddBill(_db.Bills.Local.SingleOrDefault(x => x.Id == id)).ShowDialog(); if (result == DialogResult.OK) { _db.SaveChanges(); _Reload(); } }