private void longTermReloanSave() { LoanFactory factory = new LoanFactory(DatabaseFactory.Default); Loan newLoan = factory.Clone(originalLoan); newLoan.Id = 0; newLoan.IsReloan = true; try { database.BeginTransaction(); originalLoan.MarkClosed(); newLoan.Save(); database.Commit(); } catch (DatabaseException exception) { database.Rollback(); } }
private void saveButton_Click(object sender, EventArgs e) { if (!validateLoanInputs()) { return; } try { loan.StartDate = startDateInput.Value; loan.TakenDate = takenDateInput.Value; loan.Save(); if (LoanSaved != null) { LoanSaved(); } Close(); } catch (DatabaseException exception) { throw; //Message.Error("Unable to save loan"); } }