protected void onOkButtonClicked(object sender, EventArgs e) { using (var db = new BizeeBirdDbContext()) { if (!AppointmentId.HasValue) { SaveNewAppointment(db); } else { SaveExistingAppointment(db); } db.SaveChanges(); } Destroy(); }
protected void onOkButtonClicked(object sender, EventArgs e) { if (birdNameEntry.Text.Trim() != "") { onBirdAddButtonClicked(sender, e); } using (var db = new BizeeBirdDbContext()) { if (CustomerId.HasValue) { UpdateExistingCustomer(db); } else { CreateNewCustomer(db); } db.SaveChanges(); } Destroy(); }