示例#1
0
        public override void Execute()
        {
            FieldCondition condition = new FieldCondition();

            condition.Id        = "ConditionId";
            condition.Condition = "document['DocumentId'].field['fieldId2'].value == 'X'";
            condition.Action    = "document['DocumentId'].field['fieldId1'].disabled = false";

            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed(packageName)
                                                .DescribedAs("Description")
                                                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                            .WithFirstName("Patty")
                                                            .WithLastName("Galant"))
                                                .WithDocument(DocumentBuilder.NewDocumentNamed("Document")
                                                              .WithId(documentId)
                                                              .FromStream(fileStream1, DocumentType.PDF)
                                                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                                                             .WithId(signatureId)
                                                                             .OnPage(0)
                                                                             .AtPosition(400, 100)
                                                                             .WithField(FieldBuilder.TextField()
                                                                                        .WithId(fieldId1)
                                                                                        .OnPage(0)
                                                                                        .AtPosition(0, 0))
                                                                             .WithField(FieldBuilder.CheckBox()
                                                                                        .WithId(fieldId2)
                                                                                        .OnPage(0)
                                                                                        .AtPosition(0, 0))))
                                                .WithCondition(condition)
                                                .Build();

            packageId        = eslClient.CreatePackageOneStep(superDuperPackage);
            retrievedPackage = eslClient.GetPackage(packageId);

            FieldCondition newCondition = new FieldCondition();

            newCondition.Id        = "ConditionId";
            newCondition.Condition = "document['DocumentId'].field['fieldId2'].value == 'X'";
            newCondition.Action    = "document['DocumentId'].field['fieldId1'].disabled = true";
            List <FieldCondition> conditions = new List <FieldCondition> ();

            conditions.Add(newCondition);

            ConditionalField conditionalField = new ConditionalField();

            conditionalField.Id         = fieldId2;
            conditionalField.Conditions = conditions;
            conditionalField.Style      = FieldStyle.UNBOUND_CHECK_BOX;

            eslClient.ApprovalService.ModifyConditionalField(packageId, documentId, signatureId, conditionalField);
            RetrievedPackageWithUpdatedConditions = eslClient.GetPackage(packageId);

            conditions.Clear();
            conditionalField.Conditions = conditions;
            eslClient.ApprovalService.ModifyConditionalField(packageId, documentId, signatureId, conditionalField);
            RetrievedPackageWithoutConditions = eslClient.GetPackage(packageId);
        }
示例#2
0
        public void Section2()
        {
            var section2 = new DocumentSection("Special Factors")
            {
                Title = "Student Needs Relating to Special Factors"
            };

            _doc.Sections.Add(section2);

            section2.Fields.Add(new FieldSet("", new[]
            {
                new SelectOptionField(
                    "Does the student need strategies, including positive behavioral interventions, support and other strategies to address behaviors that impedes the student's learning or that of others",
                    new[] { "Yes", "No" }),
                new SelectOptionField(
                    "Does the student need a behavioral intervention plan?",
                    new[] { "No", "Yes" })
            }));

            section2.Fields.Add(
                new SelectOptionField(
                    "For a student with limited English proficiency, doe he/she need a special education service to address his.her language needs as they relate to the IEP?",
                    new[] { "Yes", "No", "Not Applicable" }));

            section2.Fields.Add(
                new SelectOptionField(
                    "For a student who is blind or visually impaired, does he/she need instruction in Braille and the use of Braille?",
                    new[] { "Yes", "No", "Not Applicable" }));

            section2.Fields.Add(new FieldSet("", new[]
            {
                new SelectOptionField(
                    "Does the student need a perticular device or service to address his.her communication needs?",
                    new[] { "Yes", "No" }),
                new SelectOptionField(
                    "In the case of a student who is deaf or hard of hearing, does the student need a perticualr device or service consideration........?",
                    new[] { "Yes", "No", "Not Applicable" })
            }));

            var c = new ConditionalField(
                new SelectOptionField(
                    "Does the student need an assistive technology device and/or service?",
                    new[] { "Yes", "No" }))
            {
                True = new SelectOptionField(
                    "If yes, does the Committee recommend that the device(s) be used in the student's home?",
                    new[] { "Yes", "No" })
            };

            section2.Fields.Add(c);
        }