示例#1
0
        public List <Measurement> GetAll(Experiment e)
        {
            var columns = new List <string> {
                "ID", "result", "beginning", "end"
            };
            var data = Db.GetAll("Measurements", "experiment", e.Id.ToString(), columns);

            var res = new List <Measurement>();

            foreach (var row in data)
            {
                var m = new Measurement(Convert.ToInt32(row["ID"]));

                var samples = _samplesDAO.GetAll(m, e);

                var bs        = samples.Where(s => s.Id == Convert.ToInt32(row["beginning"])).ToList();
                var es        = samples.Where(s => s.Id == Convert.ToInt32(row["end"])).ToList();
                var beginning = bs.Any() ? bs[0] : null;
                var end       = es.Any() ? es[0] : null;
                var result    = Convert.ToDouble(row["result"]);

                m.Beginning = beginning;
                m.End       = end;
                m.Result    = result;
                m.Add(samples);

                res.Add(m);
            }

            return(res);
        }
示例#2
0
 public List <Sample> GetAllSamples(Measurement m, Experiment e)
 {
     return(_samples.GetAll(m, e));
 }