public bool removeTAG(TAG removedTAG) { DbSet <TAG> listTags = myModel.TAGs; var myRemovedTag = (from tag1 in listTags where tag1.IDTag == removedTAG.IDTag select tag1).First(); // Delete it from memory. myModel.TAGs.Remove(myRemovedTag); myModel.SaveChanges(); changeUI(); return(true); }
public bool modifyTAG(TAG modifiedTAG, string content) { DbSet <TAG> listTags = myModel.TAGs; var myChangedTag = (from tag in listTags where tag.IDTag == modifiedTAG.IDTag select tag).FirstOrDefault <TAG>(); if (myChangedTag != null) { myChangedTag.mContent = content; myChangedTag.mAccessTime = DateTime.Now; } // Change UI myModel.SaveChanges(); changeUI(); return(true); }
public void assignTag(TAG newTag) { this.mContent = newTag.mContent; this.mAccessTime = newTag.mAccessTime; }