示例#1
0
        public void DeleteData(int id)
        {
            var db        = new BestSleepEntities();
            var bestsleep = db.BestSleeps.Find(id);

            db.BestSleeps.Remove(bestsleep);
            db.SaveChanges();
        }
示例#2
0
        public void CreateData(string diary, string quality)
        {
            var bestsleep = new BestSleep();

            bestsleep.DIARY = diary;

            bestsleep.Quality = quality;


            var db = new BestSleepEntities();

            db.BestSleeps.Add(bestsleep);
            db.SaveChanges();
        }
示例#3
0
        public BestSleep GetData(int id)
        {
            var db = new BestSleepEntities();

            return(db.BestSleeps.Find(id));
        }
示例#4
0
        public BestSleep[] GetData()
        {
            var db = new BestSleepEntities();

            return(db.BestSleeps.ToArray());
        }