Beispiel #1
0
        public async Task <ExcelDataResult> GetPhenomeDataAsync(HttpRequestMessage request, PhenomeImportRequestArgs args)
        {
            PhenoneImportDataResult result = null;

            if (args.ImportLevel.EqualsIgnoreCase("LIST"))
            {
                result = await GetListDataFromPhenomeAsync(request, args);
            }
            else
            {
                result = await GetDataFromPhenomeAsync(request, args);
            }
            if (result.Errors.Any() || result.Warnings.Any())
            {
                return(new ExcelDataResult
                {
                    Success = false,
                    Warnings = result.Warnings,
                    Errors = result.Errors
                });
            }
            //TestName and FilePath is same for Phenome
            args.FilePath = args.TestName;
            //import data into database
            await excelDataRepo.ImportDataAsync(result.CropCode, result.BrStationCode, result.SyncCode, result.CountryCode,
                                                args, result.TVPColumns, result.TVPRows, result.TVPCells, result.TVPList);

            return(await excelDataRepo.GetDataAsync(args));
        }
Beispiel #2
0
        public async Task <ExcelDataResult> ImportDataAsync(HttpRequestMessage request, ThreeGBImportRequestArgs requestArgs)
        {
            var result = await GetDataFromPhenomeAsync(request, requestArgs);

            if (result.Errors.Any() || result.Warnings.Any())
            {
                return(new ExcelDataResult
                {
                    Success = false,
                    Warnings = result.Warnings,
                    Errors = result.Errors
                });
            }

            requestArgs.SyncCode      = result.SyncCode;
            requestArgs.CropCode      = result.CropCode;
            requestArgs.BrStationCode = result.BrStationCode;
            requestArgs.CountryCode   = result.CountryCode;
            //import data into database
            await _threeGBRepository.ImportDataAsync(requestArgs, result.TVPColumns, result.TVPRows, result.TVPCells);

            return(await _excelDataRepository.GetDataAsync(requestArgs));
        }
Beispiel #3
0
 public async Task <ExcelDataResult> GetDataAsync(ExcelDataRequestArgs requestArgs)
 {
     return(await excelDataRepository.GetDataAsync(requestArgs));
 }