예제 #1
0
        /// <summary>
        /// 测试服务器是否能联通
        /// </summary>
        static private void Ping()
        {
            BaseSample baseSample           = new BaseSample();
            SdkResponse <PingResult> pingRS = baseSample.Ping(GetOrCreateClient());

            Console.WriteLine("Service time: {0} , Local time: {1}", pingRS.Result.ServiceTime, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            Console.WriteLine("Call Ping api finished");
        }
예제 #2
0
        /// <summary>
        /// 取回已签约/存证的合同
        /// </summary>
        /// <param name="contractId">
        ///签约合同编号
        /// </param>
        static private void QueryContract(long contractId)
        {
            BaseSample baseSample = new BaseSample();
            SdkResponse <QueryContractResult> rs = baseSample.QueryContract(GetOrCreateClient(), contractId.ToString());

            Console.WriteLine("Query contract result is: {0}", rs.ToString());
            Console.WriteLine("Call QueryContract api finished");
        }
예제 #3
0
        /// <summary>
        /// 企业实名认证修改
        /// </summary>
        /// <param name="authCaseType">
        /// see above CASE definition
        /// </param>
        static private void EnterpriseReAuth()
        {
            RealNameAuth realNameAuth = realNameAuth = RealNameAuth.EnterpriseRealNameAuth("慢慢", "500235199412169110", "18711112222", "91500000MA5UCYU7ZY", "慢慢科技", SxqConst.ID_BUSINESS_LICENCE);
            BaseSample   baseSample   = new BaseSample();
            String       result       = baseSample.EnterpriseReCertification(GetOrCreateClient(), realNameAuth);

            Console.WriteLine("Call enterpriseReCertification api finished: " + result.ToString());
        }
예제 #4
0
        /// <summary>
        /// 下载已签约/存证的合同
        /// </summary>
        /// <param name="contractId">
        /// 创建的签约合同编号
        /// </param>
        static private void Download(long contractId)
        {
            // 存储到本地的文件路径
            string     localFilePath = "../../Contract/Signed/ContractFetched.pdf";
            BaseSample baseSample    = new BaseSample();

            baseSample.Download(GetOrCreateClient(), contractId.ToString(), localFilePath);
            Console.WriteLine("Download file success, you can find the file at {0}", localFilePath);
            Console.WriteLine("Call Download api finished");
        }
예제 #5
0
        /// <summary>
        /// 获取继续签约的链接(用于某些特殊场景下,丢失了后续签约的链接)
        /// </summary>
        /// <param name="contractId">
        /// 签约合同编号
        /// </param>
        static private void FetchSignUrl(long contractId)
        {
            BaseSample baseSample = new BaseSample();
            string     signUrl    = baseSample.FetchSignUrl(GetOrCreateClient(), contractId.ToString());

            if (String.IsNullOrEmpty(signUrl))
            {
                Console.WriteLine("Return URL is NULL, can't continue the signing processing");
            }
            else
            {
                // use the explorer to open the sign url
                System.Diagnostics.Process.Start(signUrl);
            }

            Console.WriteLine("Call FetchSignUrl api finished");
        }
예제 #6
0
        /// <summary>
        /// 个人|企业 实名认证
        /// </summary>
        /// <param name="authCaseType">
        /// see above CASE definition
        /// </param>
        static private void RealName(int authCaseType)
        {
            RealNameAuth realNameAuth = null;

            switch (authCaseType)
            {
            case CASE_AUTH_PERSON:
                realNameAuth = RealNameAuth.PersonRealNameAuth("试试", "500235199412169110", "18700001111");
                break;

            case CASE_AUTH_ENTERPRISE:
                realNameAuth = RealNameAuth.EnterpriseRealNameAuth("慢慢", "500235199412169110", "18711112222", "91500000MA5UCYU7ZY", "慢慢科技", SxqConst.ID_BUSINESS_LICENCE);
                break;

            default:
                break;
            }
            BaseSample baseSample = new BaseSample();
            String     result     = baseSample.RealName(GetOrCreateClient(), realNameAuth);

            Console.WriteLine("Call RealNameAuth api finished: " + result.ToString());
        }