override public void Execute()
		{
			DocumentPackage superDuperPackage =
                PackageBuilder.NewPackageNamed("DownloadCompletionAndUsageReport: " + DateTime.Now)
					.DescribedAs("This is a package created using the e-SignLive SDK")
					.ExpiresOn(DateTime.Now.AddMonths(100))
					.WithEmailMessage("This message should be delivered to all signers")
					.WithSigner(SignerBuilder.NewSignerWithEmail(email1)
						.WithCustomId("Client1")
						.WithFirstName("John")
						.WithLastName("Smith")
						.WithTitle("Managing Director")
						.WithCompany("Acme Inc.")
					)
					.WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
						.FromStream(fileStream1, DocumentType.PDF)
						.WithSignature(SignatureBuilder.SignatureFor(email1)
							.OnPage(0)
							.WithField(FieldBuilder.CheckBox()
								.OnPage(0)
								.AtPosition(400, 200)
								.WithValue(FieldBuilder.CHECKBOX_CHECKED)
							)
							.AtPosition(100, 100)
						)
					)
					.Build();

			packageId = eslClient.CreatePackage(superDuperPackage);

			// Date and time range to get completion report.
			DateTime from = DateTime.Today.AddDays(-1);
			DateTime to = DateTime.Now;

            // Download the completion report
			sdkCompletionReport = eslClient.PackageService.DownloadCompletionReport(DocumentPackageStatus.DRAFT, senderUID, from, to);
            csvCompletionReport = eslClient.PackageService.DownloadCompletionReportAsCSV(DocumentPackageStatus.DRAFT, senderUID, from, to);

            // Download the usage report
            sdkUsageReport = eslClient.PackageService.DownloadUsageReport(from, to);
            csvUsageReport = eslClient.PackageService.DownloadUsageReportAsCSV(from, to);

            // Get the number of packages in draft for sender
            IDictionary<UsageReportCategory, int> categoryCounts = sdkUsageReport.SenderUsageReports[0].CountByUsageReportCategory;
            int numOfDrafts = categoryCounts[UsageReportCategory.DRAFT];
		}
        override public void Execute()
        {
            DocumentPackage superDuperPackage =
                PackageBuilder.NewPackageNamed("DownloadCompletionAndUsageReport: " + DateTime.Now)
                .DescribedAs("This is a package created using the e-SignLive SDK")
                .ExpiresOn(DateTime.Now.AddMonths(100))
                .WithEmailMessage("This message should be delivered to all signers")
                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                            .WithCustomId("Client1")
                            .WithFirstName("John")
                            .WithLastName("Smith")
                            .WithTitle("Managing Director")
                            .WithCompany("Acme Inc.")
                            )
                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                              .FromStream(fileStream1, DocumentType.PDF)
                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                             .OnPage(0)
                                             .WithField(FieldBuilder.CheckBox()
                                                        .OnPage(0)
                                                        .AtPosition(400, 200)
                                                        .WithValue(FieldBuilder.CHECKBOX_CHECKED)
                                                        )
                                             .AtPosition(100, 100)
                                             )
                              )
                .Build();

            packageId = eslClient.CreatePackage(superDuperPackage);

            // Date and time range to get completion report.
            DateTime from = DateTime.Today.AddDays(-1);
            DateTime to   = DateTime.Now;

            // Download the completion report
            sdkCompletionReport = eslClient.PackageService.DownloadCompletionReport(DocumentPackageStatus.DRAFT, senderUID, from, to);
            csvCompletionReport = eslClient.PackageService.DownloadCompletionReportAsCSV(DocumentPackageStatus.DRAFT, senderUID, from, to);

            // Download the usage report
            sdkUsageReport = eslClient.PackageService.DownloadUsageReport(from, to);
            csvUsageReport = eslClient.PackageService.DownloadUsageReportAsCSV(from, to);

            // Get the number of packages in draft for sender
            IDictionary <UsageReportCategory, int> categoryCounts = sdkUsageReport.SenderUsageReports[0].CountByUsageReportCategory;
            int numOfDrafts = categoryCounts[UsageReportCategory.DRAFT];
        }
        public void ConvertAPIToSDK()
        {
            apiUsageReport1 = CreateTypicalAPIUsageReport();
            sdkUsageReport1 = new UsageReportConverter(apiUsageReport1).ToSDKUsageReport();

            Assert.AreEqual(sdkUsageReport1.From, apiUsageReport1.From);
            Assert.AreEqual(sdkUsageReport1.To, apiUsageReport1.To);

            Silanis.ESL.API.Sender apiSender = apiUsageReport1.Senders[0].Sender;
            Silanis.ESL.SDK.Sender sdkSender = sdkUsageReport1.SenderUsageReports[0].Sender;
            Assert.AreEqual(sdkSender.Email, apiSender.Email);
            Assert.AreEqual(sdkSender.FirstName, apiSender.FirstName);
            Assert.AreEqual(sdkSender.LastName, apiSender.LastName);
        
            IDictionary<string, object> apiPackageDictionary = apiUsageReport1.Senders[0].Packages;
            IDictionary<UsageReportCategory, int> sdkPackageDictionary = sdkUsageReport1.SenderUsageReports[0].CountByUsageReportCategory;
            Assert.AreEqual(sdkPackageDictionary[UsageReportCategory.ACTIVE], apiPackageDictionary["active"]);
            Assert.AreEqual(sdkPackageDictionary[UsageReportCategory.DRAFT], apiPackageDictionary["draft"]);
            Assert.AreEqual(sdkPackageDictionary[UsageReportCategory.DECLINED], apiPackageDictionary["declined"]);
        }
Exemplo n.º 4
0
        public void ConvertAPIToSDK()
        {
            apiUsageReport1 = CreateTypicalAPIUsageReport();
            sdkUsageReport1 = new UsageReportConverter(apiUsageReport1).ToSDKUsageReport();

            Assert.AreEqual(sdkUsageReport1.From, apiUsageReport1.From);
            Assert.AreEqual(sdkUsageReport1.To, apiUsageReport1.To);

            Silanis.ESL.API.Sender apiSender = apiUsageReport1.Senders[0].Sender;
            Silanis.ESL.SDK.Sender sdkSender = sdkUsageReport1.SenderUsageReports[0].Sender;
            Assert.AreEqual(sdkSender.Email, apiSender.Email);
            Assert.AreEqual(sdkSender.FirstName, apiSender.FirstName);
            Assert.AreEqual(sdkSender.LastName, apiSender.LastName);

            IDictionary <string, object>           apiPackageDictionary = apiUsageReport1.Senders[0].Packages;
            IDictionary <UsageReportCategory, int> sdkPackageDictionary = sdkUsageReport1.SenderUsageReports[0].CountByUsageReportCategory;

            Assert.AreEqual(sdkPackageDictionary[UsageReportCategory.ACTIVE], apiPackageDictionary["active"]);
            Assert.AreEqual(sdkPackageDictionary[UsageReportCategory.DRAFT], apiPackageDictionary["draft"]);
            Assert.AreEqual(sdkPackageDictionary[UsageReportCategory.DECLINED], apiPackageDictionary["declined"]);
        }
Exemplo n.º 5
0
        override public void Execute()
        {
            DocumentPackage superDuperPackage =
                PackageBuilder.NewPackageNamed(PackageName)
                .DescribedAs("This is a package created using the eSignLive SDK")
                .ExpiresOn(DateTime.Now.AddMonths(100))
                .WithEmailMessage("This message should be delivered to all signers")
                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                            .WithCustomId("Client1")
                            .WithFirstName("John")
                            .WithLastName("Smith")
                            .WithTitle("Managing Director")
                            .WithCompany("Acme Inc.")
                            )
                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                              .FromStream(fileStream1, DocumentType.PDF)
                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                             .OnPage(0)
                                             .WithField(FieldBuilder.CheckBox()
                                                        .OnPage(0)
                                                        .AtPosition(400, 200)
                                                        .WithValue(FieldBuilder.CHECKBOX_CHECKED)
                                                        )
                                             .AtPosition(100, 100)
                                             )
                              )
                .Build();

            packageId = eslClient.CreatePackage(superDuperPackage);

            DocumentPackage superDuperPackage2 =
                PackageBuilder.NewPackageNamed("DownloadReportForSent: " + DateTime.Now)
                .DescribedAs("This is a package created using the eSignLive SDK")
                .ExpiresOn(DateTime.Now.AddMonths(100))
                .WithEmailMessage("This message should be delivered to all signers")
                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                            .WithCustomId("Client1")
                            .WithFirstName("John")
                            .WithLastName("Smith")
                            .WithTitle("Managing Director")
                            .WithCompany("Acme Inc.")
                            )
                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                              .FromStream(fileStream2, DocumentType.PDF)
                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                             .OnPage(0)
                                             .WithField(FieldBuilder.CheckBox()
                                                        .OnPage(0)
                                                        .AtPosition(400, 200)
                                                        .WithValue(FieldBuilder.CHECKBOX_CHECKED)
                                                        )
                                             .AtPosition(100, 100)
                                             )
                              )
                .Build();

            package2Id = eslClient.CreateAndSendPackage(superDuperPackage2);

            // Date and time range to get completion report.
            DateTime from = DateTime.Now.AddMinutes(-5);
            DateTime to   = DateTime.Now.AddMinutes(5);

            // Download the completion report for a sender
            sdkCompletionReportForSenderDraft = eslClient.ReportService.DownloadCompletionReport(DocumentPackageStatus.DRAFT, senderUID, from, to);
            csvCompletionReportForSenderDraft = eslClient.ReportService.DownloadCompletionReportAsCSV(DocumentPackageStatus.DRAFT, senderUID, from, to);

            sdkCompletionReportForSenderSent = eslClient.ReportService.DownloadCompletionReport(DocumentPackageStatus.SENT, senderUID, from, to);
            csvCompletionReportForSenderSent = eslClient.ReportService.DownloadCompletionReportAsCSV(DocumentPackageStatus.SENT, senderUID, from, to);

            // Download the completion report for all senders
            sdkCompletionReportDraft = eslClient.ReportService.DownloadCompletionReport(DocumentPackageStatus.DRAFT, from, to);
            csvCompletionReportDraft = eslClient.ReportService.DownloadCompletionReportAsCSV(DocumentPackageStatus.DRAFT, from, to);

            sdkCompletionReportSent = eslClient.ReportService.DownloadCompletionReport(DocumentPackageStatus.SENT, from, to);
            csvCompletionReportSent = eslClient.ReportService.DownloadCompletionReportAsCSV(DocumentPackageStatus.SENT, from, to);

            // Download the usage report
            sdkUsageReport = eslClient.ReportService.DownloadUsageReport(from, to);
            csvUsageReport = eslClient.ReportService.DownloadUsageReportAsCSV(from, to);

            // Download the delegation report for a sender
            sdkDelegationReportForAccountWithoutDate = eslClient.ReportService.DownloadDelegationReport();
            csvDelegationReportForAccountWithoutDate = eslClient.ReportService.DownloadDelegationReportAsCSV();

            sdkDelegationReportForAccount = eslClient.ReportService.DownloadDelegationReport(from, to);
            csvDelegationReportForAccount = eslClient.ReportService.DownloadDelegationReportAsCSV(from, to);

            sdkDelegationReportForSender = eslClient.ReportService.DownloadDelegationReport(senderUID, from, to);
            csvDelegationReportForSender = eslClient.ReportService.DownloadDelegationReportAsCSV(senderUID, from, to);
        }
Exemplo n.º 6
0
        override public void Execute()
        {
            DocumentPackage superDuperPackage =
                PackageBuilder.NewPackageNamed("DownloadReport: " + DateTime.Now)
                .DescribedAs("This is a package created using the e-SignLive SDK")
                .ExpiresOn(DateTime.Now.AddMonths(100))
                .WithEmailMessage("This message should be delivered to all signers")
                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                            .WithCustomId("Client1")
                            .WithFirstName("John")
                            .WithLastName("Smith")
                            .WithTitle("Managing Director")
                            .WithCompany("Acme Inc.")
                            )
                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                              .FromStream(fileStream1, DocumentType.PDF)
                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                             .OnPage(0)
                                             .WithField(FieldBuilder.CheckBox()
                                                        .OnPage(0)
                                                        .AtPosition(400, 200)
                                                        .WithValue(FieldBuilder.CHECKBOX_CHECKED)
                                                        )
                                             .AtPosition(100, 100)
                                             )
                              )
                .Build();

            packageId = eslClient.CreatePackage(superDuperPackage);

            // Date and time range to get completion report.
            DateTime from = DateTime.Today.AddDays(-1);
            DateTime to   = DateTime.Now;

            // Download the completion report for a sender
            sdkCompletionReportForSender = eslClient.ReportService.DownloadCompletionReport(DocumentPackageStatus.DRAFT, senderUID, from, to);
            csvCompletionReportForSender = eslClient.ReportService.DownloadCompletionReportAsCSV(DocumentPackageStatus.DRAFT, senderUID, from, to);

            // Display package id and name of packages in DRAFT from sender
            foreach (SenderCompletionReport senderCompletionReport in sdkCompletionReportForSender.Senders)
            {
                Console.Write("Sender: " + senderCompletionReport.Sender.Email);
                Console.WriteLine(" has " + senderCompletionReport.Packages.Count + " packages in DRAFT");
                foreach (PackageCompletionReport packageCompletionReport in senderCompletionReport.Packages)
                {
                    Console.WriteLine(packageCompletionReport.Id + " , " + packageCompletionReport.Name + " , Sender : " + eslClient.GetPackage(new PackageId(packageCompletionReport.Id)).SenderInfo.Email);
                }
            }

            // Download the completion report for all senders
            sdkCompletionReport = eslClient.ReportService.DownloadCompletionReport(DocumentPackageStatus.DRAFT, from, to);
            csvCompletionReport = eslClient.ReportService.DownloadCompletionReportAsCSV(DocumentPackageStatus.DRAFT, from, to);

            // Display package id and name of packages in DRAFT from sender
            foreach (SenderCompletionReport senderCompletionReport in sdkCompletionReport.Senders)
            {
                Console.Write("Sender: " + senderCompletionReport.Sender.Email);
                Console.WriteLine(" has " + senderCompletionReport.Packages.Count + " packages in DRAFT");
                foreach (PackageCompletionReport packageCompletionReport in senderCompletionReport.Packages)
                {
                    Console.WriteLine(packageCompletionReport.Id + " , " + packageCompletionReport.Name + " , Sender : " + eslClient.GetPackage(new PackageId(packageCompletionReport.Id)).SenderInfo.Email);
                }
            }

            // Download the usage report
            sdkUsageReport = eslClient.ReportService.DownloadUsageReport(from, to);
            csvUsageReport = eslClient.ReportService.DownloadUsageReportAsCSV(from, to);

            // Download the delegation report for a sender
            sdkDelegationReport = eslClient.ReportService.DownloadDelegationReport(senderUID, from, to);
            csvDelegationReport = eslClient.ReportService.DownloadDelegationReportAsCSV(senderUID, from, to);
        }