Пример #1
0
        private Dictionary <string, string> CreateFormParametersJpa(JpaFile jpaEntry)
        {
            var parameters = new Dictionary <string, string>();

            parameters.Add("jpa_name", jpaEntry.JpaName);
            parameters.Add("year", jpaEntry.Year.ToString());
            parameters.Add("user", jpaEntry.UserName);
            return(parameters);
        }
Пример #2
0
        public Task <JpaFile> CreateJpaHistoryAsync(JpaFile jpaEntry)
        {
            var parameters = CreateFormParametersJpa(jpaEntry);
            var file       = CreateFileJpa(jpaEntry);
            var fileList   = new List <FileToUpload>();

            fileList.Add(file);
            return(RequestWrapper.PostFormAsync <JpaFile>(Endpoints.JpaHistoryAdminEndpoint, parameters, fileList));
        }
Пример #3
0
        private FileToUpload CreateFileJpa(JpaFile jpaEntry)
        {
            var data = File.ReadAllBytes(jpaEntry.File.ToString());

            return(new FileToUpload
            {
                Data = data,
                DataName = "file",
                FileName = Path.GetFileName(jpaEntry.File.ToString())
            });
        }
Пример #4
0
        public Task <JpaFile> UpdateJpaHistoryAsync(JpaFile jpaEntry)
        {
            var parameters = CreateFormParametersJpa(jpaEntry);
            var file       = CreateFileJpa(jpaEntry);
            var fileList   = new List <FileToUpload>();

            fileList.Add(file);
            var url = string.Format(Endpoints.JpaHistoryUpdateAdminEndpoint, jpaEntry.Id.ToString());

            return(RequestWrapper.PutFormAsync <JpaFile>(url, parameters, fileList));
        }
Пример #5
0
        public Task <bool> DeleteJpaHistoryAsync(JpaFile jpaEntry)
        {
            var url = string.Format(Endpoints.JpaHistoryUpdateAdminEndpoint, jpaEntry.Id.ToString());

            return(RequestWrapper.DeleteAsyncWrapper(url));
        }