Ejemplo n.º 1
0
        private void shortTermReloanSave()
        {
            Payment payment = new Payment(database);

            payment.Account     = originalLoan.Account;
            payment.Loan        = originalLoan;
            payment.Amount      = originalLoan.Balance;
            payment.PaymentDate = DateTime.Now;
            if (string.IsNullOrEmpty(payment.Remarks))
            {
                payment.Remarks = "Reloan payment";
            }

            if (string.IsNullOrEmpty(reloan.Remarks))
            {
                reloan.Remarks = "Reloan";
            }
            reloan.Id = 0;
            try
            {
                database.BeginTransaction();
                originalLoan.MarkClosed();
                payment.Save();
                reloan.Save();
                database.Commit();
            }
            catch (DatabaseException exception)
            {
                database.Rollback();
            }
        }
Ejemplo n.º 2
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            if (!validatePayment())
            {
                return;
            }

            try
            {
                payment.PaymentDate = paymentDate.Value;
                payment.Remarks     = remarks.Text;
                payment.Save();
                Close();
                if (PaymentSaved != null)
                {
                    PaymentSaved(payment);
                }
            }
            catch (ApplicationException exception)
            {
                Message.Error("Unable to save payment.");
            }
        }
Ejemplo n.º 3
0
        private void shortTermReloanSave()
        {
            Payment payment = new Payment(database);
            payment.Account = originalLoan.Account;
            payment.Loan = originalLoan;
            payment.Amount = originalLoan.Balance;
            payment.PaymentDate = DateTime.Now;
            if (string.IsNullOrEmpty(payment.Remarks))
            {
                payment.Remarks = "Reloan payment";
            }

            if (string.IsNullOrEmpty(reloan.Remarks))
            {
                reloan.Remarks = "Reloan";
            }
            reloan.Id = 0;
            try
            {
                database.BeginTransaction();
                originalLoan.MarkClosed();
                payment.Save();
                reloan.Save();
                database.Commit();
            }
            catch (DatabaseException exception)
            {
                database.Rollback();
            }
        }