public void Insert(Profile Entity) { using (db = new LearnWordsEntities()) { db.Profiles.Add(Entity); db.SaveChanges(); } }
public void Insert(Word Entity) { using (db = new LearnWordsEntities()) { db.Words.Add(Entity); db.SaveChanges(); } }
public void Delete(Word Entity) { using (db = new LearnWordsEntities()) { Word word = db.Words.FirstOrDefault(w => w.wordID == Entity.wordID); db.Words.Remove(word); db.SaveChanges(); } }
public void Delete(WordType Entity) { using (db = new LearnWordsEntities()) { WordType wordType = db.WordTypes.FirstOrDefault(wt => wt.typeID == Entity.typeID); db.WordTypes.Remove(wordType); db.SaveChanges(); } }
public void Delete(Profile Entity) { using (db = new LearnWordsEntities()) { Profile profile = db.Profiles.FirstOrDefault(p => p.ProfileID == Entity.ProfileID); db.Profiles.Remove(profile); db.SaveChanges(); } }
public void Update(WordType Entity) { using (db = new LearnWordsEntities()) { WordType wordType = db.WordTypes.FirstOrDefault(wt => wt.typeID == Entity.typeID); wordType.typeName = Entity.typeName; wordType.profileID = Entity.profileID; db.SaveChanges(); } }
public void Update(Word Entity) { using (db = new LearnWordsEntities()) { Word wordToUpdate = db.Words.FirstOrDefault(w => w.wordID == Entity.wordID); wordToUpdate.wordFirstLang = Entity.wordFirstLang; wordToUpdate.wordSecondLang = Entity.wordSecondLang; wordToUpdate.typeID = Entity.typeID; wordToUpdate.profileID = Entity.profileID; db.SaveChanges(); } }
public void Update(Profile Entity) { using (db = new LearnWordsEntities()) { Profile profileToUpdate = db.Profiles.FirstOrDefault(p => p.ProfileID == Entity.ProfileID); profileToUpdate.ProfileName = Entity.ProfileName; profileToUpdate.ProfileUserName = Entity.ProfileUserName; profileToUpdate.ProfileUserLastName = Entity.ProfileUserLastName; profileToUpdate.ProfileTimeInterval = Entity.ProfileTimeInterval; profileToUpdate.ProfileFirstLang = Entity.ProfileFirstLang; profileToUpdate.ProfileSecondLang = Entity.ProfileSecondLang; db.SaveChanges(); } }