Ejemplo n.º 1
0
 public void TestReadKrokenMilaResult()
 {
     var assembly = Assembly.GetExecutingAssembly();
     var excelStream = assembly.GetManifestResourceStream("NRWebTests.Resources.Krokenmila_14052012.xlsx");
     var excelReader = new ExcelReader();
     var results = excelReader.LoadFromExcel(excelStream);
     if (excelStream != null) excelStream.Close();
     Assert.IsNotNull(results);
 }
Ejemplo n.º 2
0
        public ICollection<RaceTime> GetRaceTimesFromExcelFile(Stream excelStream)
        {
            var excelReader = new ExcelReader();
            var results = excelReader.LoadFromExcel(excelStream);

            var enumerable = results as IList<Dictionary<string, object>> ?? results.ToList();

            var raceTimes = GetInternalRaceTimes(enumerable);

            var modelRaceTimes = (from racetime in raceTimes let username = racetime.Name let user = _userService.GetUserByName(username) where user != null select new RaceTime {Time = racetime.Time, User = user}).ToList();
            return modelRaceTimes;
        }