Exemplo n.º 1
0
        public bool checkAccountForTemplate()
        {
            bool retval = false;

            Signing.AccountCredentials                   creds = base.GetAPICredentials();
            Signing.DocuSignWeb.APIServiceSoap           api   = Signing.Envelope.CreateApiProxy(creds);
            Signing.DocuSignWeb.RequestTemplatesResponse response;
            Signing.DocuSignWeb.RequestTemplatesRequest  request = new Signing.DocuSignWeb.RequestTemplatesRequest();
            request.AccountID = (string)Session["AccountID"];
            request.IncludeAdvancedTemplates = true;
            try
            {
                response = api.RequestTemplates(request);
                foreach (Signing.DocuSignWeb.EnvelopeTemplateDefinition def in response.RequestTemplatesResult)
                {
                    if (def.Name == "InsuranceCo Auto Insurance Application")
                    {
                        Session["TemplateID"] = def.TemplateID;
                        retval = true;
                    }
                }
            }
            catch (Exception excp)
            {
                base.GoToErrorPage(excp.Message);
            }
            return(retval);
        }
Exemplo n.º 2
0
        public CredentialService.Account[] checkAccountsForTemplatePermissions(CredentialService.LoginResult loginResult)
        {
            List <CredentialService.Account> accountsWithTemplatesPermissions = new List <InsuranceCo.CredentialService.Account>();

            Signing.AccountCredentials         creds = base.GetAPICredentials();
            Signing.DocuSignWeb.APIServiceSoap api   = Signing.Envelope.CreateApiProxy(creds);

            Signing.DocuSignWeb.RequestTemplatesResponse response;
            Signing.DocuSignWeb.RequestTemplatesRequest  request = new Signing.DocuSignWeb.RequestTemplatesRequest();

            foreach (CredentialService.Account account in loginResult.Accounts)
            {
                request.AccountID = account.AccountID;
                request.IncludeAdvancedTemplates = true;
                try{
                    response = api.RequestTemplates(request);
                    accountsWithTemplatesPermissions.Add(account);
                }
                catch (Exception excp) {
                    // nada
                }
            }
            return(accountsWithTemplatesPermissions.ToArray());
        }