示例#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()
     }));
 }