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)); }
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)); }
public async Task <ExcelDataResult> GetDataAsync(ExcelDataRequestArgs requestArgs) { return(await excelDataRepository.GetDataAsync(requestArgs)); }