private void btnEditSchedule_Click(object sender, EventArgs e) { if (null == _credit || 0 == _credit.InstallmentList.Count) return; try { ServiceProvider.GetContractServices().ManualScheduleBeforeDisbursement(); ManualScheduleForm manualScheduleForm = new ManualScheduleForm(_credit.Copy()); if (manualScheduleForm.ShowDialog() == DialogResult.OK) { _credit.ScheduleChangedManually = true; if (_credit.ContractStatus != 0) ServicesProvider.GetInstance().GetContractServices().SaveSchedule( manualScheduleForm.Loan.InstallmentList, _credit); _credit.InstallmentList = manualScheduleForm.Loan.InstallmentList; DisplayInstallments(ref _credit); } } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
private void buttonManualSchedule_Click(object sender, EventArgs e) { if (null == _credit || 0 == _credit.InstallmentList.Count) return; try { ServiceProvider.GetContractServices().ManualScheduleAfterDisbursement(); var manualScheduleForm = new ManualScheduleForm(_credit.Copy()); if (manualScheduleForm.ShowDialog() != DialogResult.OK) return; var manualScheduleChangeEvent = new ManualScheduleChangeEvent { User = User.CurrentUser, Date = TimeProvider.Now }; ServiceProvider.GetContractServices() .AddManualScheduleChangeEvent(_credit, manualScheduleChangeEvent); _credit = manualScheduleForm.Loan; SaveContract(); _credit = ServiceProvider.GetContractServices().SelectLoan(_credit.Id, true, true, true); DisplayListViewLoanRepayments(_credit); DisplayLoanEvents(_credit); } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }