// get by date //rajouter by id public static List <MStatement> GetByDate(projet4Entities ctx, int id, DateTime debut, DateTime fin) { List <MStatement> ls = new List <MStatement>(); List <statement> l = ctx.statement.Where(s => s.captorId == id && s.dateTime >= debut && s.dateTime <= fin).ToList(); foreach (statement s in l) { MStatement ms = new MStatement(); ms.LoadFromDao(s); ls.Add(ms); } return(ls); }
public static List <MStatement> GetAll(projet4Entities ctx) { List <MStatement> ls = new List <MStatement>(); List <statement> l = ctx.statement.ToList(); foreach (statement s in l) { MStatement ms = new MStatement(); ms.LoadFromDao(s); ls.Add(ms); } return(ls); }
public static List <MStatement> GetAllByCaptorId(projet4Entities ctx, int captorId) { List <MStatement> ls = new List <MStatement>(); List <statement> l = ctx.statement.Where(st => st.captorId == captorId).ToList(); foreach (statement s in l) { MStatement ms = new MStatement(); ms.LoadFromDao(s); ls.Add(ms); } return(ls); }
public static List <MStatement> ConvertFile(string[] file) { string[] data; List <MStatement> mStatementslist = new List <MStatement>(); for (int i = 0; i < file.Length; i++) { MStatement entry = new MStatement(); data = file[i].Split(' '); entry.DateTime = GetDateTime(data[1], data[2]); entry.Temperature = GetTemp(data[3]); entry.Humidity = GetHumidity(data[4]); mStatementslist.Add(entry); } return(mStatementslist); }