private string RenderContractHTML(string contractName, Dictionary <string, string> parameters, string fileName)
        {
            string   fileContent = "";
            Contract contract    = new Contract();

            contract.ContractName = contractName;

            contract.ParametersList = new List <ContractServiceRef.StringKeyValue>();

            if (parameters != null)
            {
                foreach (KeyValuePair <string, string> param in parameters)
                {
                    ContractServiceRef.StringKeyValue oneParam = new ContractServiceRef.StringKeyValue();
                    oneParam.Key   = param.Key;
                    oneParam.Value = param.Value;
                    contract.ParametersList.Add(oneParam);
                }
            }

            this.Use(client => fileContent = client.DownloadContractHTMLAsync(contract, "HB", "0").Result);
            return(fileContent);
        }
        public string RenderContract(string contractName, Dictionary <string, string> parameters, string fileName, Contract contract = null)
        {
            string fileContent = null;

            if (contract == null)
            {
                contract = new Contract();
                contract.ParametersList = new List <ContractServiceRef.StringKeyValue>();
                contract.ContractName   = contractName;
            }
            if (parameters != null)
            {
                foreach (KeyValuePair <string, string> param in parameters)
                {
                    ContractServiceRef.StringKeyValue oneParam = new ContractServiceRef.StringKeyValue();
                    oneParam.Key   = param.Key;
                    oneParam.Value = param.Value;
                    contract.ParametersList.Add(oneParam);
                }
            }

            this.Use(client => fileContent = Convert.ToBase64String(client.DownloadContractAsync(contract, "HB", "0").Result));
            return(fileContent);
        }