예제 #1
0
        /// <summary>
        /// Modello del Firmatario di una Collaborazione
        /// </summary>
        /// <param name="order">Ordine dei firmatari. Questo parametro serve per determinare la sequenza corretta approvativa nel processo di Collaborazione/Firma</param>
        /// <param name="required">Specifica se la firma è obblicatoria (firma digitale) o semplicemente un 'visto a procedere'</param>
        /// <param name="signerType">Rappresenta la tipologia di firmatario, es: Settore DocSuite o Utente di Dominio<see cref="SignerType"/></param>
        /// <param name="identity">Modello dell'utente di Dominio</param>
        /// <param name="role">Modello del settore della DocSuite (o associazione di tag per la trascodifica)</param>
        public SignerModel(ushort order, bool required, SignerType signerType,
                           IdentityModel identity = null, RoleModel role = null)
        {
            Order      = order;
            Required   = required;
            SignerType = signerType;
            Identity   = identity;
            Role       = role;

            switch (signerType)
            {
            case SignerType.Invalid:
                throw new ArgumentException("SignerType non è valido");

            case SignerType.AD:
            {
                if (identity == null || string.IsNullOrEmpty(identity.Account))
                {
                    throw new ArgumentException("La proprietà Account(IdentityModel) non può essere vuota se si imposta SignerType.AD");
                }
                break;
            }

            case SignerType.DSWRole:
            {
                if (role == null || !role.RoleUniqueId.HasValue)
                {
                    throw new ArgumentException("La proprietà RoleUniqueId(RoleModel) non può essere vuota se si imposta SignerType.DSWRole");
                }
                break;
            }

            case SignerType.Mapping:
            {
                if (role == null || string.IsNullOrEmpty(role.ExternalTagIdentifier))
                {
                    throw new ArgumentException("La proprietà ExternalTagIdentifier(RoleModel) non può essere vuota se si imposta SignerType.Mapping");
                }
                break;
            }

            default:
                break;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DocumentSignerDetails" /> class.
 /// </summary>
 /// <param name="signerName">Gets or sets the signer name..</param>
 /// <param name="signerRole">Gets or sets the signer role..</param>
 /// <param name="signerEmail">Gets or sets the signer email..</param>
 /// <param name="status">status.</param>
 /// <param name="isAuthenticationFailed">&lt;br&gt;Gets or sets a value indicating whether authentication is failed.  &lt;br&gt;When value is null, Authentication is not enabled for the signer.  &lt;br&gt;When value is true, Authentication is failed by the signer.  &lt;br&gt;When value is false, Authentication is enabled for the signer. (default to false).</param>
 /// <param name="enableEmailOTP">Gets or sets a value indicating whether email OTP authentication is enabled..</param>
 /// <param name="isDeliveryFailed">Gets or sets a value indicating whether delivery is failed. (default to false).</param>
 /// <param name="isViewed">Gets or sets a value indicating whether is viewed. (default to false).</param>
 /// <param name="order">Gets or sets the order of the signer. (default to 0).</param>
 /// <param name="signerType">signerType.</param>
 /// <param name="isReassigned">Gets or sets a value indicating whether is reassigned..</param>
 /// <param name="privateMessage">&lt;br&gt;Gets or sets private message for the current signer.  &lt;br&gt;Available only when the user is signer and have a privateMessage from sender..</param>
 /// <param name="formFields">Gets or sets the form fields..</param>
 public DocumentSignerDetails(string signerName = default(string), string signerRole = default(string), string signerEmail = default(string), SignerStatus status = default(SignerStatus), bool?isAuthenticationFailed = false, bool?enableEmailOTP = default(bool?), bool?isDeliveryFailed = false, bool?isViewed = false, int?order = 0, SignerType signerType = default(SignerType), bool?isReassigned = default(bool?), string privateMessage = default(string), List <DocumentFormFields> formFields = default(List <DocumentFormFields>))
 {
     this.SignerName  = signerName;
     this.SignerRole  = signerRole;
     this.SignerEmail = signerEmail;
     this.Status      = status;
     // use default value if no "isAuthenticationFailed" provided
     if (isAuthenticationFailed == null)
     {
         this.IsAuthenticationFailed = false;
     }
     else
     {
         this.IsAuthenticationFailed = isAuthenticationFailed;
     }
     this.EnableEmailOTP = enableEmailOTP;
     // use default value if no "isDeliveryFailed" provided
     if (isDeliveryFailed == null)
     {
         this.IsDeliveryFailed = false;
     }
     else
     {
         this.IsDeliveryFailed = isDeliveryFailed;
     }
     // use default value if no "isViewed" provided
     if (isViewed == null)
     {
         this.IsViewed = false;
     }
     else
     {
         this.IsViewed = isViewed;
     }
     // use default value if no "order" provided
     if (order == null)
     {
         this.Order = 0;
     }
     else
     {
         this.Order = order;
     }
     this.SignerType     = signerType;
     this.IsReassigned   = isReassigned;
     this.PrivateMessage = privateMessage;
     this.FormFields     = formFields;
 }
예제 #3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="DocumentSigner" /> class.
        /// </summary>
        /// <param name="name">Gets or sets the name. (required).</param>
        /// <param name="emailAddress">Gets or sets the email address. (required).</param>
        /// <param name="privateMessage">Gets or sets the private message..</param>
        /// <param name="authenticationCode">Gets or sets the authentication code..</param>
        /// <param name="signerOrder">Gets or sets the signer order..</param>
        /// <param name="enableEmailOTP">Gets or sets a value indicating whether to enable email OTP..</param>
        /// <param name="signerType">signerType.</param>
        /// <param name="signerRole">Gets or sets the signer role..</param>
        /// <param name="formFields">Gets or sets the formFields..</param>
        /// <param name="language">Gets or sets the Language.</param>
        public DocumentSigner(string name, string emailAddress, string privateMessage = default, string authenticationCode = default, int signerOrder = default, bool enableEmailOTP = default, SignerType signerType = BoldSign.Model.SignerType.Signer, List <FormField> formFields = default(List <FormField>), Languages language = Languages.English)
        {
            // to ensure "name" is required (not null)
            if (string.IsNullOrEmpty(name))
            {
                throw new InvalidDataException("name is a required property for DocumentSigner and cannot be null");
            }

            this.Name = name;

            // to ensure "emailAddress" is required (not null)
            if (string.IsNullOrEmpty(emailAddress))
            {
                throw new InvalidDataException("emailAddress is a required property for DocumentSigner and cannot be null");
            }

            this.EmailAddress = emailAddress;

            this.PrivateMessage     = privateMessage;
            this.AuthenticationCode = authenticationCode;
            this.SignerOrder        = signerOrder;
            this.EnableEmailOTP     = enableEmailOTP;
            this.SignerType         = signerType;
            this.FormFields         = formFields;
            this.Language           = language;
        }