Beispiel #1
0
        public int UpdateFileDistance(CsvFilesInfo filesInfo)
        {
            var info = _dtFileInfoRepository.FirstOrDefault(x => x.CsvFileName == filesInfo.CsvFileName);

            if (info != null)
            {
                info.Distance      = filesInfo.Distance;
                info.Count         = filesInfo.Count;
                info.CoverageCount = filesInfo.CoverageCount;
                _dtFileInfoRepository.Update(info);
            }
            return(_dtFileInfoRepository.SaveChanges());
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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();
            }
        }