protected void CreateAndSend() { buttonTable.Visible = false; // Construct the envelope basics var envelope = new Envelope { Subject = "DocuSign API SDK Example", EmailBlurb = "This envelope demonstrates embedded signing", AccountId = Session[Keys.ApiAccountId].ToString(), Recipients = ConstructRecipients() }; // Create the recipient(s) // Add the document to the envelope var stockDocument = new Document { PDFBytes = Resources.DocuSign_Demo__111_PDF, Name = "Demo Document", ID = "1", FileExtension = "pdf" }; envelope.Documents = new Document[] { stockDocument }; // Add the tabs to the envelope envelope.Tabs = AddTabs(envelope.Recipients.Length); APIServiceSoapClient client = CreateAPIProxy(); try { // Send the envelope and temporarily store the status in the session EnvelopeStatus status = client.CreateAndSendEnvelope(envelope); if (status.SentSpecified) { Session[Keys.EnvelopeStatus] = status; AddEnvelopeID(status.EnvelopeID); // Start the first signer SignFirst(status); } } catch (Exception ex) { GoToErrorPage(ex.Message); } }
protected void SendNow(Envelope envelope) { APIServiceSoapClient client = CreateAPIProxy(); try { // Create and send the envelope in one step EnvelopeStatus status = client.CreateAndSendEnvelope(envelope); // If we succeeded, go to the status if (status.SentSpecified) { AddEnvelopeID(status.EnvelopeID); Response.Redirect("GetStatusAndDocs.aspx", false); } } catch (Exception ex) { GoToErrorPage(ex.Message); } }