// todo WORK WORK WORK public ActionResult Weekly() { var currentUser = GetCurrentMvcUser(); var weeklyResults = _bloodSamplesRepository .GetWeeklyBloodSamples() .Where(u => u.User == currentUser) .AsQueryable() .Select(DateDto) .ToList(); int pageNumber = 1; int pageSize = 8; var weeklyResultsPagedList = weeklyResults.ToPagedList(pageNumber, pageSize); var dtoList = new AnalyzeViewModels(); dtoList.Measurements.AddRange(weeklyResults); return View(Tuple.Create(dtoList, weeklyResultsPagedList)); }
public ActionResult Today() { var currentUser = GetCurrentMvcUser(); var todaysResults = _bloodSamplesRepository .GetDailyBloodSamples(DateTime.Today) .Where(u => u.User == currentUser) .AsQueryable() .Select(TimeDto) .ToList(); var dtoList = new AnalyzeViewModels(); dtoList.Measurements.AddRange(todaysResults); //var x = todaysResults.Select(y => y.Data); //var z = x.Select(Convert.ToDouble).ToArray(); //var w = todaysResults.Select(o => o.PinchDateTime); //var a = w.Select(Convert.ToDouble).ToArray(); //var foo = SimpleRegression.Fit(z, a); //dtoList.Intercept = foo.Item1; //dtoList.Slope = foo.Item2; //var foo = Regression.Linear(dtoList); //dtoList.Intercept = foo.Item1; //dtoList.Slope = foo.Item2; return View(dtoList); }