Exemplo n.º 1
0
        /**
         *
         * 利用业务分类配置进行公章签署
         * 签署位置需要在业务分类中指定,若没指定则需要传递签署位置
         *
         * */
        private SdkResponse <Object> CompanySealSignByCategoryConfig(SDKClient client, string contractId)
        {
            SdkResponse <Contract>     detail  = this.Detail(client, contractId);
            ContractSignCompanyRequest request = new ContractSignCompanyRequest();

            request.ContractId = contractId;

            string response = null;

            try
            {
                response = client.Service(request);
            }
            catch (Exception e)
            {
                throw new Exception("公章签署请求服务器失败,失败原因:" + e.Message);
            }
            SdkResponse <Object> sdkResponse = HttpJsonConvert.DeserializeResponse <Object>(response);

            if (!sdkResponse.Code.Equals(0))
            {
                throw new Exception("公章签署失败,失败原因:" + sdkResponse.Message);
            }
            return(sdkResponse);
        }
Exemplo n.º 2
0
        private SdkResponse <Object> CompanySealSign(SDKClient client, string contractId, string documentId1, string documentId2)
        {
            ContractSignCompanyRequest request = new ContractSignCompanyRequest();

            request.ContractId = contractId;

            //若公章未指定签署位置,需要在签署时指定签署位置
            //若制定了签署位置,优先使用签署位置中的位置进行签署

            /*
             * Stamper companyStamper = new Stamper();
             * companyStamper.Type = "COMPANY";
             * companyStamper.OffsetX = 0.2;
             * companyStamper.OffsetY = 0.3;
             * companyStamper.Page = 1;
             * companyStamper.DocumentId = documentId1;
             * companyStamper.SealId = "2490828768980361630";
             *
             * Stamper companyTimeStamp = new Stamper();
             * companyTimeStamp.Type = "TIMESTAMP";
             * companyTimeStamp.OffsetX = 0.4;
             * companyTimeStamp.OffsetY = 0.2;
             * companyTimeStamp.Page = 1;
             * companyTimeStamp.DocumentId = documentId1;
             * companyTimeStamp.SealId = "2490828768980361630";
             *
             * //骑缝章签署需要文档页数在一页以上
             * Stamper acrossPageStamper = new Stamper();
             * acrossPageStamper.Type = "ACROSS_PAGE";
             * acrossPageStamper.OffsetY = 0.2;
             * acrossPageStamper.DocumentId = documentId1;
             * acrossPageStamper.SealId = "2490828768980361630";
             *
             * request.AddStampers(companyStamper);
             * request.AddStampers(companyTimeStamp);
             * request.AddStampers(acrossPageStamper);
             */


            string response = null;

            try
            {
                response = client.Service(request);
            }
            catch (Exception e)
            {
                throw new Exception("公章签署请求服务器失败,失败原因:" + e.Message);
            }
            SdkResponse <Object> sdkResponse = HttpJsonConvert.DeserializeResponse <Object>(response);

            if (!sdkResponse.Code.Equals(0))
            {
                throw new Exception("公章签署失败,失败原因:" + sdkResponse.Message);
            }
            return(sdkResponse);
        }