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

            db.BestSleeps.Remove(bestsleep);
            db.SaveChanges();
        }
Esempio n. 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();
        }