Ejemplo n.º 1
0
        internal Silanis.ESL.API.Package ToAPIPackage()
        {
            Silanis.ESL.API.Package package = new Silanis.ESL.API.Package();

            package.Name         = Name;
            package.Description  = Description;
            package.Autocomplete = Autocomplete;
            package.Due          = ExpiryDate;
            package.EmailMessage = EmailMessage;

            if (Language != null)
            {
                package.Language = Language.TwoLetterISOLanguageName;
            }

            if (Settings != null)
            {
                package.Settings = Settings.toAPIPackageSettings();
            }

            int signerCount = 1;

            foreach (Signer signer in Signers.Values)
            {
                Silanis.ESL.API.Role role = new Silanis.ESL.API.Role();

                role.Name = "signer" + signerCount;
                role.AddSigner(signer.ToAPISigner());
                role.Index    = signer.SigningOrder;
                role.Reassign = signer.CanChangeSigner;

                if (String.IsNullOrEmpty(signer.RoleId))
                {
                    role.Id = "role" + signerCount;
                }
                else
                {
                    role.Id = signer.RoleId;
                }

                if (!String.IsNullOrEmpty(signer.Message))
                {
                    Silanis.ESL.API.BaseMessage message = new Silanis.ESL.API.BaseMessage();

                    message.Content   = signer.Message;
                    role.EmailMessage = message;
                }

                package.AddRole(role);
                signerCount++;
            }

            return(package);
        }
Ejemplo n.º 2
0
        public Silanis.ESL.API.Role ToAPIRole(string id, string name)
        {
            Silanis.ESL.API.Role role = new Silanis.ESL.API.Role();

            if (!sdkSigner.IsPlaceholderSigner())
            {
                role.AddSigner(new SignerConverter(sdkSigner).ToAPISigner());
            }
            role.Index    = sdkSigner.SigningOrder;
            role.Reassign = sdkSigner.CanChangeSigner;
            role.Locked   = sdkSigner.Locked;

            foreach (AttachmentRequirement attachmentRequirement in sdkSigner.Attachments)
            {
                role.AddAttachmentRequirement(new AttachmentRequirementConverter(attachmentRequirement).ToAPIAttachmentRequirement());
            }

            if (!String.IsNullOrEmpty(sdkSigner.Id))
            {
                role.Id = sdkSigner.Id;
            }
            else if (sdkSigner.IsGroupSigner())
            {
                role.Id = sdkSigner.GroupId.Id;
            }
            else
            {
                role.Id = id;
            }

            if (!String.IsNullOrEmpty(sdkSigner.PlaceholderName))
            {
                role.Name = sdkSigner.PlaceholderName;
            }
            else
            {
                role.Name = name;
            }

            if (!String.IsNullOrEmpty(sdkSigner.Message))
            {
                Silanis.ESL.API.BaseMessage message = new Silanis.ESL.API.BaseMessage();

                message.Content   = sdkSigner.Message;
                role.EmailMessage = message;
            }

            return(role);
        }
Ejemplo n.º 3
0
        private Silanis.ESL.API.Role CreateTypicalAPIRole()
        {
            Silanis.ESL.API.Role apiRole = new Silanis.ESL.API.Role();

            Silanis.ESL.API.Signer apiSigner = new Silanis.ESL.API.Signer();
            apiSigner.Email      = "*****@*****.**";
            apiSigner.FirstName  = "Signer first name";
            apiSigner.LastName   = "Signer last name";
            apiSigner.Company    = "ABC Inc.";
            apiSigner.SignerType = "THIRD_PARTY_SIGNER";
            apiSigner.Language   = "fr";
            apiSigner.Title      = "Doctor";

            Silanis.ESL.API.Delivery delivery = new Silanis.ESL.API.Delivery();
            delivery.Download = true;
            delivery.Email    = true;

            apiSigner.Delivery = delivery;
            apiSigner.Id       = "1";

            apiRole.AddSigner(apiSigner);
            apiRole.Id       = "3";
            apiRole.Name     = "Signer name";
            apiRole.Index    = 0;
            apiRole.Reassign = true;
            Silanis.ESL.API.BaseMessage baseMessage = new Silanis.ESL.API.BaseMessage();
            baseMessage.Content  = "Base message content.";
            apiRole.EmailMessage = baseMessage;
            apiRole.Locked       = true;

            Silanis.ESL.API.AttachmentRequirement attachmentRequirement = new Silanis.ESL.API.AttachmentRequirement();
            attachmentRequirement.Name        = "Driver's license";
            attachmentRequirement.Description = "Please upload your scanned driver's license.";
            attachmentRequirement.Status      = Silanis.ESL.SDK.RequirementStatus.INCOMPLETE.getApiValue();
            attachmentRequirement.Required    = true;
            attachmentRequirement.Comment     = "Attachment was not uploaded";
            apiRole.AddAttachmentRequirement(attachmentRequirement);

            return(apiRole);
        }
Ejemplo n.º 4
0
        public Silanis.ESL.API.Role ToAPIRole(string roleIdName)
        {
            Silanis.ESL.API.Role role = new Silanis.ESL.API.Role();

            if ( !sdkSigner.IsPlaceholderSigner() ) {
				role.AddSigner(new SignerConverter(sdkSigner).ToAPISigner());
            }
            role.Index = sdkSigner.SigningOrder;
            role.Reassign = sdkSigner.CanChangeSigner;
            role.Locked = sdkSigner.Locked;

			foreach (AttachmentRequirement attachmentRequirement in sdkSigner.Attachments.Values)
			{
				role.AddAttachmentRequirement(new AttachmentRequirementConverter(attachmentRequirement).ToAPIAttachmentRequirement());
			}

            if (!String.IsNullOrEmpty(sdkSigner.Id))
            {
                role.Id = sdkSigner.Id;
                role.Name = sdkSigner.Id;
            }
            else if (sdkSigner.IsGroupSigner())
            {
                role.Id = role.Name = sdkSigner.GroupId.Id;
            }
            else
            {
                role.Id = role.Name = roleIdName;
            }

            if (!String.IsNullOrEmpty(sdkSigner.Message))
            {
                Silanis.ESL.API.BaseMessage message = new Silanis.ESL.API.BaseMessage();

                message.Content = sdkSigner.Message;
                role.EmailMessage = message;
            }
            
            return role;
        }
Ejemplo n.º 5
0
        internal Silanis.ESL.API.Package ToAPIPackage()
        {
            Silanis.ESL.API.Package package = new Silanis.ESL.API.Package();

            package.Name = Name;
            package.Description = Description;
            package.Autocomplete = Autocomplete;
            package.Due = ExpiryDate;
            package.EmailMessage = EmailMessage;

            if (Language != null)
            {
                package.Language = Language.TwoLetterISOLanguageName;
            }

            if (Settings != null)
            {
                package.Settings = Settings.toAPIPackageSettings();
            }

            if (SenderInfo != null)
            {
				package.Sender = new SenderConverter(SenderInfo).ToAPISender();
            }

            if ( Attributes != null ) {
                package.Data = Attributes.Contents;
            }

            int signerCount = 1;
            foreach (Signer signer in Signers.Values)
            {
                Silanis.ESL.API.Role role = new Silanis.ESL.API.Role();

                role.Name = "signer" + signerCount;
                role.AddSigner(signer.ToAPISigner());
                role.Index = signer.SigningOrder;
                role.Reassign = signer.CanChangeSigner;

                if (String.IsNullOrEmpty(signer.RoleId))
                {
                    role.Id = "role" + signerCount;
                }
                else
                {
                    role.Id = signer.RoleId;
                }

                if (!String.IsNullOrEmpty(signer.Message))
                {
                    Silanis.ESL.API.BaseMessage message = new Silanis.ESL.API.BaseMessage();

                    message.Content = signer.Message;
                    role.EmailMessage = message;
                }

                package.AddRole(role);
                signerCount++;
            }

            return package;
        }
Ejemplo n.º 6
0
		private Silanis.ESL.API.Role CreateTypicalAPIRole()
		{
			Silanis.ESL.API.Role apiRole = new Silanis.ESL.API.Role();

			Silanis.ESL.API.Signer apiSigner = new Silanis.ESL.API.Signer();
			apiSigner.Email = "*****@*****.**";
			apiSigner.FirstName = "Signer first name";
			apiSigner.LastName = "Signer last name";
			apiSigner.Company = "ABC Inc.";
			apiSigner.Title = "Doctor";

			Silanis.ESL.API.Delivery delivery = new Silanis.ESL.API.Delivery();
			delivery.Download = true;
			delivery.Email = true;

			apiSigner.Delivery = delivery;
			apiSigner.Id = "1";

			apiRole.AddSigner(apiSigner);
			apiRole.Id = "3";
			apiRole.Name = "Signer name";
			apiRole.Index = 0;
			apiRole.Reassign = true;
			Silanis.ESL.API.BaseMessage baseMessage = new Silanis.ESL.API.BaseMessage();
			baseMessage.Content = "Base message content.";
			apiRole.EmailMessage = baseMessage;
			apiRole.Locked = true;

			Silanis.ESL.API.AttachmentRequirement attachmentRequirement = new Silanis.ESL.API.AttachmentRequirement();
			attachmentRequirement.Name = "Driver's license";
			attachmentRequirement.Description = "Please upload your scanned driver's license.";
			attachmentRequirement.Status = Silanis.ESL.API.RequirementStatus.INCOMPLETE;
			attachmentRequirement.Required = true;
			attachmentRequirement.Comment = "Attachment was not uploaded";
			apiRole.AddAttachmentRequirement(attachmentRequirement);

			return apiRole;
		}