示例#1
0
        public static async Task UploadFile(this IEconomicClient client, Stream stream, string fileName, long journalNumber, string accountingYear, long voucherNumner)
        {
            var content = new MultipartFormDataContent();

            if (stream.CanSeek)
            {
                stream.Seek(0, SeekOrigin.Begin);
            }

            var fileContent = new StreamContent(stream);

            fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data")
            {
                Name     = fileName,
                FileName = fileName,
            };

            fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");

            content.Add(fileContent);

            await client.UploadFileToJorunal(journalNumber, accountingYear, voucherNumner, content);
        }
示例#2
0
        public static async Task SetAuthenticationHeadersAndTestLogin(this IEconomicClient client, string agreementGrantToken)
        {
            client.AgreementGrantToken = agreementGrantToken;

            await client.Self();
        }