Пример #1
0
 private static ReminderCreationInfoModel GetReminderCreationInfoModel(ESignEnvelopeInfo actualEnvelope)
 {
     return(new ReminderCreationInfoModel
     {
         agreementId = actualEnvelope.EnvelopeID
     });
 }
Пример #2
0
        private static Notification CreateNotification(ESignEnvelopeInfo envelope)
        {
            var reminder = new Reminders();

            if (envelope.SendReminders != false)
            {
                reminder = new Reminders
                {
                    ReminderDelay     = envelope.FirstReminderDay.ToString(),
                    ReminderFrequency = envelope.ReminderFrequency.ToString(),
                    ReminderEnabled   = true.ToString()
                };
            }

            return(new Notification
            {
                UseAccountDefaults = false.ToString(),
                Reminders = reminder,
                Expirations = new Expirations
                {
                    ExpireAfter = envelope.ExpiredDays.ToString(),
                    ExpireWarn = envelope.WarnDays.ToString(),
                    ExpireEnabled = true.ToString()
                }
            });
        }
Пример #3
0
        private static void RemindAdobeEnvelope(ESignAccount account, ESignEnvelopeInfo actualEnvelope)
        {
            var adobeSignClient = AdobeSignClientBuilder.Build(account);
            var reminderModel   = GetReminderCreationInfoModel(actualEnvelope);

            ESignApiExecutor.TryExecute(() => adobeSignClient.DocumentsService.SendReminder(reminderModel), adobeSignClient);
        }
Пример #4
0
        private static void RedirectToAdobeSign(ESignAccount account, ESignEnvelopeInfo envelope)
        {
            var adobeSignClient = AdobeSignClientBuilder.Build(account);
            var url             = ESignApiExecutor.TryExecute(() => adobeSignClient.DocumentsService
                                                              .GetAgreementAssets(envelope.EnvelopeID), adobeSignClient).viewURL;

            throw new PXRedirectToUrlException(url, string.Empty);
        }
Пример #5
0
        public static void CancelAdobeSignEnvelope(ESignAccount account, ESignEnvelopeInfo actualEnvelope,
                                                   string voidReason)
        {
            var adobeSignClient = AdobeSignClientBuilder.Build(account);

            ESignApiExecutor.TryExecute(
                () => adobeSignClient.DocumentsService.CancelAgreement(actualEnvelope.EnvelopeID, voidReason),
                adobeSignClient);
        }
Пример #6
0
 public static void VoidAdobeSignEnvelope(ESignEnvelopeInfo envelope, ESignAccount account)
 {
     if (envelope.EnvelopeInfoID.HasValue)
     {
         var adobeSignClient = AdobeSignClientBuilder.Build(account);
         ESignApiExecutor.TryExecute(() => adobeSignClient.DocumentsService.DeleteAgreement(envelope.EnvelopeID),
                                     adobeSignClient);
     }
 }
Пример #7
0
        private static void RemindDocuSignEnvelope(ESignAccount account, ESignEnvelopeInfo actualEnvelope)
        {
            var dsService = new DocuSignService();
            var request   = new BaseRequestModel
            {
                ESignAccount = account,
                EnvelopeId   = actualEnvelope.EnvelopeID
            };

            dsService.RemindEnvelope(request);
        }
Пример #8
0
        public static void VoidDraftDocuSignEnvelope(ESignAccount account, ESignEnvelopeInfo envelope)
        {
            var dsService = new DocuSignService();
            var request   = new VoidEnvelopeRequestModel
            {
                ESignAccount = account,
                EnvelopeId   = envelope.EnvelopeID,
            };

            dsService.VoidDraftEnvelope(request);
        }
Пример #9
0
        public static void VoidDocuSignEnvelope(ESignAccount account, ESignEnvelopeInfo envelope, string voidReason)
        {
            var dsService = new DocuSignService();
            var request   = new VoidEnvelopeRequestModel
            {
                ESignAccount = account,
                EnvelopeId   = envelope.EnvelopeID,
                VoidReason   = string.IsNullOrEmpty(voidReason) ? Messages.DefaultEnvelopeVoidReason : voidReason
            };

            dsService.VoidEnvelope(request);
        }
Пример #10
0
 private static void VoidDocuSignEnvelope(ESignEnvelopeInfo envelope, ESignAccount account)
 {
     if (envelope.IsActionsAvailable != null &&
         envelope.IsActionsAvailable.Value &&
         envelope.EnvelopeInfoID.HasValue)
     {
         VoidDocuSignEnvelope(account, envelope, Messages.DefaultEnvelopeVoidReason);
     }
     else if (envelope.LastStatus == EnvelopeStatus.DocuSign.Created)
     {
         VoidDraftDocuSignEnvelope(account, envelope);
     }
 }
Пример #11
0
        private static void RedirectToDocuSign(ESignAccount account, ESignEnvelopeInfo envelope)
        {
            var dsService = new DocuSignService();
            var request   = new BaseRequestModel
            {
                ESignAccount = account,
                EnvelopeId   = envelope.EnvelopeID
            };

            var url = dsService.Redirect(request);

            throw new PXRedirectToUrlException(url.Url, string.Empty);
        }
Пример #12
0
        private static IEnumerable <Signer> ParseSigners(IEnumerable <ESignRecipient> recipients, ESignEnvelopeInfo envelopeInfo)
        {
            var tabs = new Tabs();

            return(recipients.Select(item => new Signer
            {
                Name = item.Name,
                Email = item.Email,
                RecipientId = item.RecipientID.ToString(),
                Tabs = tabs,
                Note = item.CustomMessage,
                RoutingOrder = envelopeInfo.IsOrder.HasValue && envelopeInfo.IsOrder.Value
                    ? item.Position.ToString()
                    : 1.ToString()
            }));
        }
Пример #13
0
 private static IEnumerable <CarbonCopy> ParseCarbonCopy(IEnumerable <ESignRecipient> recipients, ESignEnvelopeInfo envelopeInfo)
 {
     return(recipients.Select(item => new CarbonCopy
     {
         Email = item.Email,
         Name = item.Name,
         RecipientId = item.RecipientID.ToString(),
         Note = item.CustomMessage,
         RoutingOrder = envelopeInfo.IsOrder.HasValue && envelopeInfo.IsOrder.Value
             ? item.Position.ToString()
             : 1.ToString()
     }));
 }