internal static LinkedTab OneFullNameTab(DocuSignWeb.Recipient signer)
        {
            LinkedTab ret = new LinkedTab();

            ret.Recipient      = signer;
            ret.Tab.Type       = DocuSignWeb.TabTypeCode.FullName;
            ret.Tab.PageNumber = Convert.ToString("1", CultureInfo.InvariantCulture);
            ret.Tab.XPosition  = Convert.ToString("250", CultureInfo.InvariantCulture);
            ret.Tab.YPosition  = Convert.ToString("450", CultureInfo.InvariantCulture);
            return(ret);
        }
Esempio n. 2
0
 public string RequestRecipientToken(
     DocuSignWeb.Recipient recipient,
     DocuSignWeb.RequestRecipientTokenAuthenticationAssertion authenticationAssertion,
     DocuSignWeb.RequestRecipientTokenClientURLs clientURLs)
 {
     Debug.Assert(String.IsNullOrEmpty(_envelopeId) == false);
     using (DocuSignWeb.APIServiceWse apiService = CreateApiProxy(_accountCredentials))
     {
         return(apiService.RequestRecipientToken(_envelopeId, recipient.CaptiveInfo.ClientUserId,
                                                 recipient.UserName, recipient.Email, authenticationAssertion, clientURLs));
     }
 }
 internal static LinkedDocument[] LoadPicturePdf(DocuSignWeb.Recipient signer)
 {
     LinkedDocument[] docs = { new LinkedDocument() };
     docs[0].Document.Name     = "Picture PDF";
     docs[0].Document.PDFBytes = resources.picturePdf;
     docs[0].Tabs = new LinkedTab[] {
         OneTab(signer), OneDateTab(signer), OneFullNameTab(signer),
         OneRadioTab0(signer), OneRadioTab1(signer),
         OneCheckBox(signer)
     };
     return(docs);
 }
        internal static LinkedTab OneTextTab1(DocuSignWeb.Recipient signer)
        {
            LinkedTab ret = new LinkedTab();

            ret.Recipient      = signer;
            ret.Tab.Type       = DocuSignWeb.TabTypeCode.Custom;
            ret.Tab.Name       = "Name2";
            ret.Tab.TabLabel   = "Label2";
            ret.Tab.Value      = "";
            ret.Tab.PageNumber = Convert.ToString("1", CultureInfo.InvariantCulture);
            ret.Tab.XPosition  = Convert.ToString("380", CultureInfo.InvariantCulture);
            ret.Tab.YPosition  = Convert.ToString("600", CultureInfo.InvariantCulture);
            return(ret);
        }
Esempio n. 5
0
        public static LinkedTab CreateTab(DocuSignWeb.TabTypeCode tabType,
                                          DocuSignWeb.Recipient recipient,
                                          int pageNumber, int XPosition, int YPosition)
        {
            Debug.Assert(tabType != DocuSignWeb.TabTypeCode.Custom, "A wrong helper function is used" +
                         " custom tabs should not be created with CreateStandardTab");
            LinkedTab tab = new LinkedTab();

            tab.Recipient      = recipient;
            tab.Tab.Type       = tabType;
            tab.Tab.PageNumber = Convert.ToString(pageNumber);
            tab.Tab.XPosition  = Convert.ToString(XPosition);
            tab.Tab.YPosition  = Convert.ToString(YPosition);
            return(tab);
        }
Esempio n. 6
0
        /// <summary>
        /// A function that creates a custom tab. The reason this was created is to make sure
        /// that all the necessary fields are filled in when you create a custom tab.
        /// </summary>
        /// <param name="recipient"></param>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <param name="pageNumber"></param>
        /// <param name="XPosition"></param>
        /// <param name="YPosition"></param>
        /// <returns>A LinkedTab which has all the fields filled in</returns>
        public static LinkedTab CreateTab(DocuSignWeb.Recipient recipient,
                                          string name, string value,
                                          int pageNumber, int XPosition, int YPosition)
        {
            LinkedTab tab = new LinkedTab();

            tab.Recipient      = recipient;
            tab.Tab.Type       = Signing.DocuSignWeb.TabTypeCode.Custom;
            tab.Tab.Name       = name;
            tab.Tab.TabLabel   = name;
            tab.Tab.Value      = value;
            tab.Tab.PageNumber = Convert.ToString(pageNumber);
            tab.Tab.XPosition  = Convert.ToString(XPosition);
            tab.Tab.YPosition  = Convert.ToString(YPosition);
            return(tab);
        }
        internal static LinkedTab OneCheckBox(DocuSignWeb.Recipient signer)
        {
            LinkedTab ret = new LinkedTab();

            ret.Recipient                    = signer;
            ret.Tab.Type                     = DocuSignWeb.TabTypeCode.Custom;
            ret.Tab.Name                     = "The Name";
            ret.Tab.TabLabel                 = "This goes into the tooltip";
            ret.Tab.Value                    = "X";
            ret.Tab.CustomTabType            = Signing.DocuSignWeb.CustomTabType.Checkbox;
            ret.Tab.CustomTabTypeSpecified   = true;
            ret.Tab.CustomTabLocked          = false;
            ret.Tab.CustomTabLockedSpecified = true;
            ret.Tab.PageNumber               = Convert.ToString("1", CultureInfo.InvariantCulture);
            ret.Tab.XPosition                = Convert.ToString("300", CultureInfo.InvariantCulture);
            ret.Tab.YPosition                = Convert.ToString("500", CultureInfo.InvariantCulture);
            return(ret);
        }
        internal static LinkedTab OneRadioTab1(DocuSignWeb.Recipient signer)
        {
            LinkedTab ret = new LinkedTab();

            ret.Recipient                    = signer;
            ret.Tab.Type                     = DocuSignWeb.TabTypeCode.Custom;
            ret.Tab.Name                     = "Radio2";
            ret.Tab.TabLabel                 = "This goes into the tooltip";
            ret.Tab.Value                    = "";
            ret.Tab.CustomTabType            = Signing.DocuSignWeb.CustomTabType.Radio;
            ret.Tab.CustomTabTypeSpecified   = true;
            ret.Tab.CustomTabLocked          = false;
            ret.Tab.CustomTabLockedSpecified = true;
            ret.Tab.CustomTabRadioGroupName  = "Radio Group #1";
            ret.Tab.PageNumber               = Convert.ToString("1", CultureInfo.InvariantCulture);
            ret.Tab.XPosition                = Convert.ToString("380", CultureInfo.InvariantCulture);
            ret.Tab.YPosition                = Convert.ToString("550", CultureInfo.InvariantCulture);
            return(ret);
        }
        public void CreateEnvelopeFromTemplatesAndFormsTest()
        {
            // Configure the envelope information
            DocuSignWeb.EnvelopeInformation envelopeInfo = new DocuSignWeb.EnvelopeInformation();
            envelopeInfo.AccountId = _accountId;
            envelopeInfo.EmailBlurb = "testing docusign creation services";
            envelopeInfo.Subject = "create envelope from templates and forms test";

            DocuSignWeb.CompositeTemplate template = new DocuSignWeb.CompositeTemplate();

            DocuSignWeb.Recipient recipient1 = new DocuSignWeb.Recipient();
            recipient1.UserName = "******";
            // TODO: replace the email string with an actual email
            recipient1.Email = "test email one";
            recipient1.Type = DocuSignWeb.RecipientTypeCode.Signer;
            recipient1.RequireIDLookup = false;
            recipient1.RequireIDLookupSpecified = true;
            recipient1.RoutingOrder = 1;
            recipient1.RoutingOrderSpecified = true;
            recipient1.RoleName = "One";
            recipient1.ID = "1";

            DocuSignWeb.Recipient recipient2 = new DocuSignWeb.Recipient();
            recipient2.UserName = "******";
            // TODO: replace the email string with an actual email
            recipient2.Email = "test email two";
            recipient2.Type = DocuSignWeb.RecipientTypeCode.Signer;
            recipient2.RequireIDLookup = false;
            recipient2.RequireIDLookupSpecified = true;
            recipient2.RoutingOrder = 2;
            recipient2.RoutingOrderSpecified = true;
            recipient2.RoleName = "Two";
            recipient2.ID = "2";

            DocuSignWeb.Recipient[] signers = { recipient1, recipient2 };

            // Configure the inline templates
            DocuSignWeb.InlineTemplate inlineTemplate = new DocuSignWeb.InlineTemplate();
            inlineTemplate.Sequence = "1";
            inlineTemplate.Envelope = new DocuSignWeb.Envelope();
            inlineTemplate.Envelope.Recipients = signers;
            inlineTemplate.Envelope.AccountId = _accountId;

            // This tab matches the DateSigned tab assigned to recipient one
            DocuSignWeb.Tab tab1 = new DocuSignWeb.Tab();
            tab1.RecipientID = "1";
            tab1.TabLabel = "DocuSignDateSignedOne";
            tab1.Type = DocuSignWeb.TabTypeCode.DateSigned;

            // This tab matches the SignHere tabs assigned to recipient two
            DocuSignWeb.Tab tab2 = new DocuSignWeb.Tab();
            tab2.RecipientID = "2";
            tab2.TabLabel = "SignTwo\\*";
            tab2.Type = DocuSignWeb.TabTypeCode.SignHere;

            // This tab matches the SignHere tabs assigned to recipient one
            DocuSignWeb.Tab tab3 = new DocuSignWeb.Tab();
            tab3.RecipientID = "1";
            tab3.TabLabel = "SignOne\\*";
            tab3.Type = DocuSignWeb.TabTypeCode.SignHere;

            // This tab matches the DateSigned tab assigned to recipient two
            DocuSignWeb.Tab tab4 = new DocuSignWeb.Tab();
            tab4.RecipientID = "2";
            tab4.TabLabel = "DocuSignDateSignedTwo";
            tab4.Type = DocuSignWeb.TabTypeCode.DateSigned;

            // This tab matches nothing -- but that's okay!
            // It will just get discarded
            DocuSignWeb.Tab tab5 = new DocuSignWeb.Tab();
            tab5.RecipientID = "1";
            tab5.TabLabel = "asdf";
            tab5.Type = DocuSignWeb.TabTypeCode.FullName;

            inlineTemplate.Envelope.Tabs = new DocuSignWeb.Tab[] { tab1, tab2, tab3, tab4, tab5 };

            template.InlineTemplates = new DocuSignWeb.InlineTemplate[] { inlineTemplate };

            // Configure the document
            template.Document = new DocuSignWeb.Document();
            template.Document.ID = "1";
            template.Document.Name = "Form Document";
            template.Document.PDFBytes = Resource.LoremIpsum;
            template.Document.TransformPdfFields = true;
            template.Document.FileExtension = "pdf";

            // Create draft with all the composite template information
            DocuSignWeb.EnvelopeStatus status = _apiClient.CreateEnvelopeFromTemplatesAndForms(envelopeInfo, new DocuSignWeb.CompositeTemplate[] { template/*, template2*/ }, false);

            // Confirm that the envelope has been assigned an ID
            Assert.IsNotNullOrEmpty(status.EnvelopeID);

            // Confirm that we have the correct number of tabs for each recipient
            Assert.AreEqual(3, status.RecipientStatuses[0].TabStatuses.Length);
            Assert.AreEqual(3, status.RecipientStatuses[1].TabStatuses.Length);

            Console.WriteLine("Envelope Id is {0}", status.EnvelopeID);
        }
 internal static LinkedTab[] OneTabArray(DocuSignWeb.Recipient signer)
 {
     LinkedTab[] ret = { OneTab(signer) };
     return(ret);
 }
 public LinkedTemplateReferenceRoleAssignment(DocuSignWeb.Recipient signer, string roleName)
 {
     this.signer = signer;
     referenceRoleAssignment.RoleName = roleName;
 }