public void Add_DataBase(Note_ newNote) { using (CuckooEntities ce = new CuckooEntities()) { ce.Note_.Add(newNote); ce.SaveChanges(); } }
public void Remove_Note(string ID) { using (CuckooEntities ce = new CuckooEntities()) { Note_ found = ce.Note_.Find(ID); ce.Note_.Remove(found); ce.SaveChanges(); } }
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(); } } }