コード例 #1
0
        public ActionResult FinalizationComplete(int finalizationID)
        {
            // get envelope ID from finalization
            var envelopeID = homeRepository.GetEnvelopeIDForFinalization(finalizationID);
            var dsClient   = new Dymeng.DocuSign.DocuSignClient();
            var savePath   = AppService.Current.Settings.ProviderSignedHoursPath + "\\" + finalizationID;
            var dsSettings = AppService.Current.Settings.DocuSignProviderFinalize;

            dsClient.AuthConfig = new Dymeng.DocuSign.AuthConfig()
            {
                Host           = dsSettings.AuthHost,
                IntegratorKey  = dsSettings.AuthIntegratorKey,
                OAuthBasePath  = dsSettings.AuthOAuthBasePath,
                PrivateKeyPath = dsSettings.AuthPrivateKeyPath,
                UserID         = dsSettings.AuthUserID
            };

            var signingSuccess = dsClient.GetDocumentAndStatus(envelopeID, savePath);

            if (signingSuccess)
            {
                homeRepository.CompleteFinalize(finalizationID);
            }

            var providerID = Global.Default.User().ProviderID;
            var cases      = homeRepository.GetCaseListByProvider(providerID.Value);
            var model      = new MyCasesVM
            {
                IsBCBA         = Global.Default.GetUserProvider().Type.Code == "BCBA" ? "true" : "false",
                SigningSuccess = signingSuccess
            };

            model.FillCases(cases);
            ViewBag.ServiceList = homeRepository.GetServiceList(Global.Default.GetUserProvider().Type.ID.Value);
            return(View("Cases", model));
        }