public Signing.DocuSignWeb.TemplateReference makeTemplate(List<Signing.DocuSignWeb.Recipient> recipients, Dictionary<string,string> formfields )
        {
            // get our Template Ref - this indicates that we will use a server side template for the signing
            Signing.DocuSignWeb.TemplateReference templateRef = new Signing.DocuSignWeb.TemplateReference();
            templateRef.Template = (string)Session["TemplateID"];
            templateRef.TemplateLocation = Signing.DocuSignWeb.TemplateLocationCode.Server;
            templateRef.Sequence = "1";

            // setup role assignments - this indicates what Role a recipient will play in a template
            List<Signing.DocuSignWeb.TemplateReferenceRoleAssignment> roleRefs = new List<Signing.DocuSignWeb.TemplateReferenceRoleAssignment>();

            // we know the first recipient is the signer
            Signing.DocuSignWeb.TemplateReferenceRoleAssignment signerRoleRef = new Signing.DocuSignWeb.TemplateReferenceRoleAssignment();
            signerRoleRef.RecipientID = recipients[0].ID;
            signerRoleRef.RoleName = "Insured";
            roleRefs.Add(signerRoleRef);

            // if there is an optional second recipient then add them as the CC role
            if (recipients.Count > 1)
            {
                Signing.DocuSignWeb.TemplateReferenceRoleAssignment ccRoleRef = new Signing.DocuSignWeb.TemplateReferenceRoleAssignment();
                ccRoleRef.RecipientID = recipients[1].ID;
                ccRoleRef.RoleName = "CC";
                roleRefs.Add(ccRoleRef);

            }
            // add our roleRefs to the template
            templateRef.RoleAssignments = roleRefs.ToArray();

            // Now we are going to take some of the submitted form values and pass them into the formfields on the template
            templateRef.FieldData = ApiHelper.MakeTemplateFormFields(formfields);

            return templateRef;
        }
        public Signing.DocuSignWeb.TemplateReference makeTemplate(List <Signing.DocuSignWeb.Recipient> recipients, Dictionary <string, string> formfields)
        {
            // get our Template Ref - this indicates that we will use a server side template for the signing
            Signing.DocuSignWeb.TemplateReference templateRef = new Signing.DocuSignWeb.TemplateReference();
            templateRef.Template         = (string)Session["TemplateID"];
            templateRef.TemplateLocation = Signing.DocuSignWeb.TemplateLocationCode.Server;
            templateRef.Sequence         = "1";

            // setup role assignments - this indicates what Role a recipient will play in a template
            List <Signing.DocuSignWeb.TemplateReferenceRoleAssignment> roleRefs = new List <Signing.DocuSignWeb.TemplateReferenceRoleAssignment>();

            // we know the first recipient is the signer
            Signing.DocuSignWeb.TemplateReferenceRoleAssignment signerRoleRef = new Signing.DocuSignWeb.TemplateReferenceRoleAssignment();
            signerRoleRef.RecipientID = recipients[0].ID;
            signerRoleRef.RoleName    = "Insured";
            roleRefs.Add(signerRoleRef);

            // if there is an optional second recipient then add them as the CC role
            if (recipients.Count > 1)
            {
                Signing.DocuSignWeb.TemplateReferenceRoleAssignment ccRoleRef = new Signing.DocuSignWeb.TemplateReferenceRoleAssignment();
                ccRoleRef.RecipientID = recipients[1].ID;
                ccRoleRef.RoleName    = "CC";
                roleRefs.Add(ccRoleRef);
            }
            // add our roleRefs to the template
            templateRef.RoleAssignments = roleRefs.ToArray();

            // Now we are going to take some of the submitted form values and pass them into the formfields on the template
            templateRef.FieldData = ApiHelper.MakeTemplateFormFields(formfields);

            return(templateRef);
        }