public void AddWordFromImport(string[] ArrayDataWords) { var word = new Word(); word.English_Word = ArrayDataWords[0]; word.Word_Type = ArrayDataWords[1]; word.Phonetic = ArrayDataWords[2]; word.Meaning = ArrayDataWords[3]; db = new mydbWordEntities(); db.Words.Add(word); db.SaveChanges(); }
public void EditWord(int id, string EngW, string WordType, string phonetic, string Meaning) { db = new mydbWordEntities(); var Word = db.Words.Find(id); Word.English_Word = EngW.ToLower(); Word.Word_Type = WordType; Word.Phonetic = phonetic; Word.Meaning = Meaning.ToLower(); db.Entry(Word).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }
public void AddWord(string EngW, string WordType, string phonetic, string Meaning) { var NewWord = new Word(); NewWord.English_Word = EngW.ToLower(); NewWord.Word_Type = WordType; NewWord.Phonetic = phonetic; NewWord.Meaning = Meaning.ToLower(); db = new mydbWordEntities(); db.Words.Add(NewWord); db.SaveChanges(); }
public void DeleteWord(int id) { db = new mydbWordEntities(); db.Words.Remove(db.Words.Find(id)); db.SaveChanges(); }