Exemple #1
0
        public async Task <string> UploadFiles(List <IFormFile> Files,
                                               string Search,
                                               string SortOrder,
                                               string BINFilter,
                                               string NameKKFilter,
                                               string NameRUFilter,
                                               DateTime?DateRegisterFilter,
                                               string OKEDFilter,
                                               string ActivityKindKKFilter,
                                               string ActivityKindRUFilter,
                                               string OKEDSecondaryFilter,
                                               string KRPFilter,
                                               string KRPNameKKFilter,
                                               string KRPNameRUFilter,
                                               string CATOFilter,
                                               string LocalityKKFilter,
                                               string LocalityRUFilter,
                                               string LegalAddressFilter,
                                               string HeadNameFilter,
                                               int?PageSize,
                                               int?Page)
        {
            ViewBag.Search               = Search;
            ViewBag.SortOrder            = SortOrder;
            ViewBag.PageSize             = PageSize;
            ViewBag.Page                 = Page;
            ViewBag.BINFilter            = BINFilter;
            ViewBag.NameKKFilter         = NameKKFilter;
            ViewBag.NameRUFilter         = NameRUFilter;
            ViewBag.DateRegisterFilter   = DateRegisterFilter;
            ViewBag.OKEDFilter           = OKEDFilter;
            ViewBag.ActivityKindKKFilter = ActivityKindKKFilter;
            ViewBag.ActivityKindRUFilter = ActivityKindRUFilter;
            ViewBag.OKEDSecondaryFilter  = OKEDSecondaryFilter;
            ViewBag.KRPFilter            = KRPFilter;
            ViewBag.KRPNameKKFilter      = KRPNameKKFilter;
            ViewBag.KRPNameRUFilter      = KRPNameRUFilter;
            ViewBag.CATOFilter           = CATOFilter;
            ViewBag.LocalityKKFilter     = LocalityKKFilter;
            ViewBag.LocalityRUFilter     = LocalityRUFilter;
            ViewBag.LegalAddressFilter   = LegalAddressFilter;
            ViewBag.HeadNameFilter       = HeadNameFilter;
            string report = "";

            foreach (IFormFile file in Files)
            {
                byte[] data;
                using (var br = new BinaryReader(file.OpenReadStream()))
                    data = br.ReadBytes((int)file.OpenReadStream().Length);
                ByteArrayContent         bytes        = new ByteArrayContent(data);
                MultipartFormDataContent multiContent = new MultipartFormDataContent();
                multiContent.Add(bytes, "file", file.FileName);
                var result = await _HttpApiClient.PostAsync("api/CompaniesKK/upload", multiContent).Result.Content.ReadAsStringAsync();

                report += $"\r\n{file.FileName}: {result}";
            }
            return(report);
        }
        public async Task <string> UploadFiles(List <IFormFile> Files)
        {
            string report = "";

            foreach (IFormFile file in Files)
            {
                byte[] data;
                using (var br = new BinaryReader(file.OpenReadStream()))
                    data = br.ReadBytes((int)file.OpenReadStream().Length);
                ByteArrayContent         bytes        = new ByteArrayContent(data);
                MultipartFormDataContent multiContent = new MultipartFormDataContent();
                multiContent.Add(bytes, "file", file.FileName);
                var result = await _HttpApiClient.PostAsync("api/AirContaminants/upload", multiContent).Result.Content.ReadAsStringAsync();

                report += $"\r\n{file.FileName}: {result}";
            }
            return(report);
        }
Exemple #3
0
        public async Task <string> UploadFiles(List <IFormFile> Files,
                                               string SortOrder,
                                               string NameFilter,
                                               string NumberCASFilter,
                                               string FormulaFilter,
                                               decimal?MaximumPermissibleConcentrationOneTimeMaximumFilter,
                                               decimal?MaximumPermissibleConcentrationDailyAverageFilter,
                                               int?HazardClassFilter,
                                               int?CodeFilter,
                                               decimal?ApproximateSafeExposureLevelFilter,
                                               int?PageSize,
                                               int?Page)
        {
            ViewBag.SortOrder       = SortOrder;
            ViewBag.PageSize        = PageSize;
            ViewBag.Page            = Page;
            ViewBag.NameFilter      = NameFilter;
            ViewBag.NumberCASFilter = NumberCASFilter;
            ViewBag.FormulaFilter   = FormulaFilter;
            ViewBag.MaximumPermissibleConcentrationOneTimeMaximumFilter = MaximumPermissibleConcentrationOneTimeMaximumFilter;
            ViewBag.MaximumPermissibleConcentrationDailyAverageFilter   = MaximumPermissibleConcentrationDailyAverageFilter;
            ViewBag.HazardClassFilter = HazardClassFilter;
            ViewBag.CodeFilter        = CodeFilter;
            ViewBag.ApproximateSafeExposureLevelFilter = ApproximateSafeExposureLevelFilter;
            string report = "";

            foreach (IFormFile file in Files)
            {
                byte[] data;
                using (var br = new BinaryReader(file.OpenReadStream()))
                    data = br.ReadBytes((int)file.OpenReadStream().Length);
                ByteArrayContent         bytes        = new ByteArrayContent(data);
                MultipartFormDataContent multiContent = new MultipartFormDataContent();
                multiContent.Add(bytes, "file", file.FileName);
                var result = await _HttpApiClient.PostAsync("api/AirContaminantsKK/upload", multiContent).Result.Content.ReadAsStringAsync();

                report += $"\r\n{file.FileName}: {result}";
            }
            return(report);
        }