Example #1
0
 public static List <preset> Presets()
 {
     using (var db = new SDHackathonSQLEntities())
     {
         return(db.presets.ToList());
     }
 }
Example #2
0
 public static List <well> Wells()
 {
     using (var db = new SDHackathonSQLEntities())
     {
         return(db.wells.ToList());
     }
 }
Example #3
0
        /*
         * 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);
            }
        }
Example #4
0
 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;
     }
 }
Example #5
0
 public static void DeleteArduino()
 {
     try
     {
         using (var db = new SDHackathonSQLEntities())
         {
             db.Database.ExecuteSqlCommand("TRUNCATE TABLE [arduino]");
         }
         // return "SUCCESS";
     }
     catch
     {
         throw;
     }
 }
Example #6
0
        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);
            }
        }
Example #7
0
        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);
            }
        }