private void btnWriteOff_Click(object sender, EventArgs e) { //if (Confirm("ConfirmWriteOff.Text")) // WriteOff(); int writeOffMethodId; var dialogResult = new WriteOffOkCancelForm().ShowDialogWrappe(out writeOffMethodId); if (dialogResult != DialogResult.Cancel) WriteOff(writeOffMethodId); }
private void btnWriteOff_Click(object sender, EventArgs e) { if (_credit == null) return; try { var form = new WriteOffOkCancelForm(); var loanService = ServiceProvider.GetContractServices(); form.ShowWriteOffOptions(loanService.GetWriteOffOptions()); if (form.ShowDialog() != DialogResult.OK) return; WriteOff(form.OptionId, form.Comment); } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); return; } }