public IEnumerable <AreaTestInfo> CalculateAreaTestInfos(string csvFileName, string type) { var file = _fileInfoRepository.FirstOrDefault(x => x.CsvFileName == csvFileName + ".csv"); if (file == null) { return(new List <AreaTestInfo>()); } var townIds = _boundaryRepository.GetAllList(x => x.AreaName == null).Select(x => x.TownId).Distinct().ToList(); AreaTestInfoQuery query; switch (type) { case "2G": query = new AreaTestInfo2GQuery(_service, _boundaryRepository); break; case "3G": query = new AreaTestInfo3GQuery(_service, _boundaryRepository); break; case "Volte": query = new AreaTestInfoVolteQuery(_service, _boundaryRepository); break; default: query = new AreaTestInfo4GQuery(_service, _boundaryRepository); break; } return(query.QueryAreaTestInfos(townIds, csvFileName, file.Id)); }
public string QueryNetworkType(string csvFileName) { var csvFileInfo = _dtFileInfoRepository.FirstOrDefault(x => x.CsvFileName == csvFileName + ".csv"); var info = _testInfoRepository.FirstOrDefault(x => x.CsvFilesName.Contains(csvFileName)); if (csvFileInfo == null || info == null) { return(info?.NetworkType); } csvFileInfo.FileType = info.NetworkType; _dtFileInfoRepository.SaveChanges(); return(info.NetworkType); }
public static void UpdateCsvFileInfo(this IDtFileInfoRepository dtFileInfoRepository, string tableName, DateTime testDate) { var csvFileInfo = dtFileInfoRepository.FirstOrDefault(x => x.CsvFileName == tableName + ".csv"); if (csvFileInfo == null) { dtFileInfoRepository.Insert(new CsvFilesInfo { CsvFileName = tableName + ".csv", TestDate = testDate }); dtFileInfoRepository.SaveChanges(); } }
public CsvFilesInfo QueryCsvFilesInfo(string fileName) { return(_dtFileInfoRepository.FirstOrDefault(x => x.CsvFileName == fileName + ".csv")); }
public IEnumerable <FileRecord4G> GetFileRecord4Gs(string fileName) { var file = _dtFileInfoRepository.FirstOrDefault(x => x.CsvFileName == fileName + ".csv"); return(file == null ? new List <FileRecord4G>() : _fileRecord4GRepository.GetAllList(x => x.FileId == file.Id)); }