Ejemplo n.º 1
0
 public Document(CaseFile cf, string title, string pdfFilePath)
     : this(cf)
 {
     CaseFile = cf;
     Title    = title;
     PdfFile  = pdfFilePath;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Get the case file (load if not loaded)
 /// </summary>
 public CaseFile GetCaseFile(PenneoConnector con)
 {
     if (CaseFile == null)
     {
         CaseFile = GetLinkedEntities <CaseFile>(con).Objects.FirstOrDefault();
     }
     return(CaseFile);
 }
Ejemplo n.º 3
0
        public static void run()
        {
            var caseFile = new CaseFile();

            var availableTemplates = caseFile.GetTemplates().Objects;

            var template = availableTemplates.First();

            foreach (DocumentType documentType in template.DocumentTypes)
            {
                Console.WriteLine(documentType.Id + " : " + documentType.Name);
                foreach (SignerType signerType in documentType.SignerTypes)
                {
                    Console.WriteLine("  |_ " + signerType.Id + " : " + signerType.Role);
                }
                Console.WriteLine("");
            }
        }
Ejemplo n.º 4
0
 public Signer(CaseFile cf, string name, string socialSecurityNumber)
     : this(cf, name)
 {
     SocialSecurityNumber = socialSecurityNumber;
 }
Ejemplo n.º 5
0
 public Signer(CaseFile cf, string name)
     : this(cf)
 {
     Name = name;
 }
Ejemplo n.º 6
0
 public Signer(CaseFile cf)
 {
     CaseFile = cf;
 }
Ejemplo n.º 7
0
        public static void run(String file)
        {
            // Case file
            //
            var cf = new CaseFile("Sample Case File");

            // cf.ExpireAt  = new DateTime(2020, 1, 1, 1, 1, 1);
            // cf.SensitiveData = false;
            // cf.DisableNotificationsOwner = false;
            // cf.SignOnMeeting = false;
            cf.Persist();

            Console.WriteLine("Case file : " + cf.Id);

            // Add to a folder
            //
            // var folders = Query.FindAll<Folder>();
            // var folder = folders.First();
            // folder.AddCaseFile(cf);

            // Document
            //
            var doc = new Document(cf, "Sample Document", file);

            doc.MakeSignable();
            doc.Persist();

            if (doc.Id == null)
            {
                Console.WriteLine("Unable to create a document");
                return;
            }

            // Signer
            //
            var signer = new Signer(cf, "John Doe");

            signer.OnBehalfOf = "Acme Corporation";
            // signer.SocialSecurityNumber = "0101501111";
            // signer.VATIdentificationNumber = 12345678;
            signer.Persist();


            // Signature Line
            //
            var sigLine = new SignatureLine(doc, "dummy-signer-role")
            {
                SignOrder = 0
            };

            sigLine.Persist();

            if (sigLine.Id == null)
            {
                Console.WriteLine("Unable to create a signature line");
                return;
            }

            // Map the signer to the document using the signature line
            //
            sigLine.SetSigner(signer);

            // Update the signing request
            //
            var signingRequest = signer.GetSigningRequest();

            if (signingRequest.Id == null)
            {
                Console.WriteLine("Unable to create the signing request");
                return;
            }

            // [Optional] Send emails through Penneo
            //
            // signingRequest.Email = "*****@*****.**";
            //
            // signingRequest.EmailSubject = "Contract for signing";
            // signingRequest.EmailText = "Dear <b>{{recipient.name}}</b>. Please sign the contract using the link: {{link}}. From <b>{{sender.name}}</b>";
            //
            // signingRequest.CompletedEmailSubect = "Completed the case file: {{casefile.title}}";
            // signingRequest.CompletedEmailText = "Dear john. Case file is completed: {{casefile.title}}.";

            // [Optional] Email Message format
            // Set it to "html" if you want to control how the email looks by
            // using html in the email body instead of plain text. This applies
            // to EmailText, ReminderEmailText, and CompletedEmailText. A
            // prerequisite for this is that your company's account should be
            // configured so that you can override the default email texts.
            // Please get in touch with Penneo support if you have questions.
            //
            // signingRequest.EmailFormat = "html";

            // [Optional] Access Control
            // Enable access control if you have specified a Social security
            // number / VAT Identification Number for the Signer
            //
            // signingRequest.AccessControl = true;

            // [Optional] Use touch signatures
            //
            // signingRequest.EnableInsecureSigning = true;

            // [Optional] Redirect after signing
            //
            // signingRequest.SuccessUrl = "https://app.penneo.com/login";
            // signingRequest.FailUrl    = "enter url to go to after failure here";

            signingRequest.Persist();

            // Create the signing request link
            //
            var link = signingRequest.GetLink();

            // Active the Case file (and send signing requests if email details
            // are provided)
            //
            cf.Send();

            // Print the link
            //
            Console.WriteLine(link);
        }
Ejemplo n.º 8
0
 public Document(CaseFile cf)
     : this()
 {
     CaseFile = cf;
 }
Ejemplo n.º 9
0
        public static void run(String file)
        {
            // Case file
            //
            var cf = new CaseFile("Sample Case File");

            cf.Persist();

            Console.WriteLine("Case file : " + cf.Id);

            // Add to a folder
            //
            // var folders = Query.FindAll<Folder>();
            // var folder = folders.First();
            // folder.AddCaseFile(cf);

            // Document
            //
            var doc = new Document(cf, "Sample Document", file);

            doc.MakeSignable();
            doc.Persist();

            if (doc.Id == null)
            {
                Console.WriteLine("Unable to create a document");
                return;
            }

            // Signers
            //
            var signer1 = new Signer(cf, "John Doe");

            signer1.Persist();
            //
            var signer2 = new Signer(cf, "Jane Doe");

            signer2.Persist();

            // Signature Lines
            //
            // We need one signature line per document-signer relationship
            //
            // Signer 1
            var sigLine1 = new SignatureLine(doc, "signer-1")
            {
                SignOrder = 0
            };

            sigLine1.Persist();
            sigLine1.SetSigner(signer1);
            //
            // Signer 2
            var sigLine2 = new SignatureLine(doc, "signer-2")
            {
                // If you want to activate all the signing requests the same
                // time (or send emails at the same time), use the same signing
                // order:
                // SignOrder = 0
                //
                SignOrder = 1
            };

            sigLine2.Persist();
            sigLine2.SetSigner(signer2);

            // Extract the links
            //
            var signingRequest1 = signer1.GetSigningRequest();
            var link1           = signingRequest1.GetLink();

            var signingRequest2 = signer2.GetSigningRequest();
            var link2           = signingRequest2.GetLink();

            // Active the Case file (and send signing requests if email details
            // are provided)
            //
            cf.Send();

            // Print the links
            //
            Console.WriteLine(link1);
            Console.WriteLine(link2);
        }
Ejemplo n.º 10
0
 public bool RemoveCaseFile(PenneoConnector con, CaseFile caseFile)
 {
     return(UnlinkEntity(con, caseFile));
 }
Ejemplo n.º 11
0
 public bool AddCaseFile(PenneoConnector con, CaseFile caseFile)
 {
     return(LinkEntity(con, caseFile));
 }
Ejemplo n.º 12
0
 public CopyRecipient(CaseFile caseFile, string name, string email)
     : this(caseFile)
 {
     Name  = name;
     Email = email;
 }
Ejemplo n.º 13
0
 public CopyRecipient(CaseFile caseFile)
 {
     CaseFile = caseFile;
 }
Ejemplo n.º 14
0
 public bool RemoveCaseFile(CaseFile caseFile)
 {
     return(UnlinkEntity(caseFile));
 }
Ejemplo n.º 15
0
 public bool AddCaseFile(CaseFile caseFile)
 {
     return(LinkEntity(caseFile));
 }