예제 #1
0
 public void Add_DataBase(Note_ newNote)
 {
     using (CuckooEntities ce = new CuckooEntities())
     {
         ce.Note_.Add(newNote);
         ce.SaveChanges();
     }
 }
예제 #2
0
        public void Remove_Note(string ID)
        {
            using (CuckooEntities ce = new CuckooEntities())
            {
                Note_ found = ce.Note_.Find(ID);
                ce.Note_.Remove(found);

                ce.SaveChanges();
            }
        }
예제 #3
0
 public void Replace_DB(string ID, Note_ newNote)
 {
     using (CuckooEntities ce = new CuckooEntities())
     {
         Note_ note = Search_DataBase(ID);
         if (note != null)
         {
             ce.Note_.Attach(note);
             note.Time      = newNote.Time;
             note.ToDo      = newNote.ToDo;
             note.Cathegory = newNote.Cathegory;
             note.Comment   = newNote.Comment;
             ce.SaveChanges();
         }
     }
 }