Esempio n. 1
0
        override public void Execute()
        {
            // Get the contacts (Senders) from account
            beforeContacts = eslClient.AccountService.GetContacts();
            signerForPackage = beforeContacts[email1];

            // Create package with signer using information from contacts
            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("ContactsExample: " + 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)
                        .WithFirstName(signerForPackage.FirstName)
                        .WithLastName(signerForPackage.LastName)
                        .WithTitle(signerForPackage.Title)
                        .WithCompany(signerForPackage.Company))
                    .WithSigner(SignerBuilder.NewSignerWithEmail(email2)
                        .WithFirstName("John")
                        .WithLastName("Smith"))
                    .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                        .FromStream(fileStream1, DocumentType.PDF)
                        .WithSignature(SignatureBuilder.SignatureFor(email1)
                            .OnPage(0)
                            .AtPosition(100, 100)))
                    .Build();

            packageId = eslClient.CreatePackageOneStep(superDuperPackage);
            eslClient.SendPackage(packageId);

            afterContacts = eslClient.AccountService.GetContacts();
        }
        override public void Execute()
        {
            accountMember1 = AccountMemberBuilder.NewAccountMember(email1)
                .WithFirstName( "firstName1" )
                .WithLastName( "lastName1" )
                .WithCompany( "company1" )
                .WithTitle( "title1" )
                .WithLanguage( "language1" )
                .WithPhoneNumber( "phoneNumber1" )
                .WithStatus(SenderStatus.ACTIVE)
                .Build();

            accountMember2 = AccountMemberBuilder.NewAccountMember(email2)
                .WithFirstName( "firstName2" )
                .WithLastName( "lastName2" )
                .WithCompany( "company2" )
                .WithTitle( "title2" )
                .WithLanguage( "language2" )
                .WithPhoneNumber( "phoneNumber2" )
                .WithStatus(SenderStatus.ACTIVE)
                .Build();

            accountMember3 = AccountMemberBuilder.NewAccountMember(email3)
                .WithFirstName( "firstName3" )
                .WithLastName( "lastName3" )
                .WithCompany( "company3" )
                .WithTitle( "title3" )
                .WithLanguage( "language3" )
                .WithPhoneNumber( "phoneNumber3" )
                .WithStatus(SenderStatus.ACTIVE)
                .Build();

            Sender createdSender1 = eslClient.AccountService.InviteUser(accountMember1);
            Sender createdSender2 = eslClient.AccountService.InviteUser(accountMember2);
            Sender createdSender3 = eslClient.AccountService.InviteUser(accountMember3);

            retrievedSender1 = eslClient.AccountService.GetSender(createdSender1.Id);
            retrievedSender2 = eslClient.AccountService.GetSender(createdSender2.Id);
            retrievedSender3 = eslClient.AccountService.GetSender(createdSender3.Id);

            eslClient.AccountService.SendInvite(createdSender1.Id);

            eslClient.AccountService.DeleteSender(createdSender2.Id);

            updatedSenderInfo = SenderInfoBuilder.NewSenderInfo(email3)
                .WithName("updatedFirstName", "updatedLastName")
                    .WithCompany("updatedCompany")
                    .WithTitle("updatedTitle")
                    .Build();

            eslClient.AccountService.UpdateSender(updatedSenderInfo, createdSender3.Id);
            retrievedUpdatedSender3 = eslClient.AccountService.GetSender(createdSender3.Id);

            // Get senders in account
            IDictionary<string, Sender> senders = eslClient.AccountService.GetSenders(Direction.ASCENDING, new PageRequest(1, 100));
        }
Esempio n. 3
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"]);
        }
Esempio n. 4
0
		public Sender ToSDKSender() {
			if (apiSender == null)
			{
				return sdkSender;
			}

			Sender result = new Sender();
			result.Email = apiSender.Email;
			result.Id = apiSender.Id;
			result.FirstName = apiSender.FirstName;
			result.LastName = apiSender.LastName;
			result.Company = apiSender.Company;
			result.Created = apiSender.Created;
			result.Language = apiSender.Language;
			result.Name = apiSender.Name;
			result.Phone = apiSender.Phone;
			result.Status = new SenderStatusConverter(apiSender.Status).ToSDKSenderStatus();
			result.Type = new SenderTypeConverter(apiSender.Type).ToSDKSenderType();
			result.Title = apiSender.Title;
			result.Updated = apiSender.Updated;
            result.External = new ExternalConverter(apiSender.External).ToSDKExternal();
			
			return result;
		}