コード例 #1
0
        public async void SendDisclosures(PdfDocumentList encompassDisclosuresList)
        {
            SendDisclosuresButton.Enabled = false;

            var waitDialog = new PleaseWaitDialog(emSendDisclosuresDialogForm);


            await new TaskFactory().StartNew(() =>
            {
                try
                {
                    DisclosuresService  = InitDisclosuresManager(encompassDisclosuresList, waitDialog);
                    var packageResponse = DisclosuresService.SendDisclosurePackageToBorrower();


                    waitDialog.Progress.Report($"Disclosures sent successfully. {Environment.NewLine + Environment.NewLine}Saving Loan...");

                    EncompassApplication.CurrentLoan.Commit();

                    waitDialog.PleaseWaitForm.Close();

                    // SP - close EM disclosure dialog
                    emSendDisclosuresDialogForm.Close();

                    Macro.Alert($"Disclosure Package Sent Successfully.");
                }
                catch (WCMException e)
                {
                    waitDialog.PleaseWaitForm.Close();

                    UIHelper.DisplayWCMException(e);
                    SendDisclosuresButton.Enabled = true;
                }
                catch (Exception e)
                {
                    waitDialog.PleaseWaitForm.Close();

                    Macro.Alert($"Unhandled Exception ERROR: {e.ToString()}");
                    SendDisclosuresButton.Enabled = true;
                }
            });
        }
コード例 #2
0
        private List <PostPackageResponse> SendWCMDisclosurePackage(WCMDisclosurePackage package, PleaseWaitDialog waitDialog)
        {
            var trackedDoc     = _cdoDisclosuresUtility.GetDisclosuresTrackedDoc(package.EfolderNameThatContainsDisclosures, package);
            var wcmDisclosures =
                _cdoDisclosuresUtility.GetDisclosuresFromTrackedDocument(package, trackedDoc);

            var disclosuresService = new DisclosuresManger(DisclosuresHelper.PopulateDisclosuresUtilityConfig(),
                                                           new DisclosuresUtilityRequest()
            {
                EfolderContainingDisclosures = trackedDoc,
                DisclosurePackage            = package,
                Disclosures = wcmDisclosures,
                Loan        = EncompassApplication.CurrentLoan,
                Progress    = waitDialog.Progress
            });

            var packageResponse = disclosuresService.SendDisclosurePackageToBorrower();

            waitDialog.Progress.Report($"Disclosures sent successfully. {Environment.NewLine + Environment.NewLine}Saving Loan...");

            return(packageResponse);
        }