public static List <preset> Presets() { using (var db = new SDHackathonSQLEntities()) { return(db.presets.ToList()); } }
public static List <well> Wells() { using (var db = new SDHackathonSQLEntities()) { return(db.wells.ToList()); } }
/* * App specific code goes here! */ public static pipeselection CreatePipeSelection(pipeselection pipeSelection) { using (var db = new SDHackathonSQLEntities()) { var ps = new pipeselection(); ps = db.pipeselections.Add(pipeSelection); db.SaveChanges(); return(ps); } }
public static double GetMeasurement() { try { using (var db = new SDHackathonSQLEntities()) { return(db.arduinoes.Take(1).OrderByDescending(x => x.ID).Select(x => x.LENGTH).FirstOrDefault()); } } catch { throw; } }
public static void DeleteArduino() { try { using (var db = new SDHackathonSQLEntities()) { db.Database.ExecuteSqlCommand("TRUNCATE TABLE [arduino]"); } // return "SUCCESS"; } catch { throw; } }
public static List <pipelength> CreatePipeLengths(List <pipelength> pipeLengths) { using (var db = new SDHackathonSQLEntities()) { var returnData = new List <pipelength>(); foreach (var pls in pipeLengths) { var pl = new pipelength(); pl = db.pipelengths.Add(pls); db.SaveChanges(); returnData.Add(pl); } return(returnData); } }
public static List <All> All() { using (var db = new SDHackathonSQLEntities()) { var all = new List <All>(); var pipeSelections = db.pipeselections.ToList(); foreach (var ps in pipeSelections) { var a = new All(); a.PipeSelection = ps; a.PipeLengths = db.pipelengths.Where(x => x.PIPEID == ps.ID).ToList(); all.Add(a); } return(all); } }