예제 #1
0
        public void RemoveWordConnection(WordConnectionBase iwc)
        {
            var toRemove = db.WordConnections.FirstOrDefault(x => x.Equals(iwc));

            if (toRemove != null)
            {
                db.WordConnections.Remove((WordConnection)iwc);
                db.SaveChanges();
            }
        }
예제 #2
0
        private void DisconnectWords()
        {
            WordConnectionBase iwc = _dao.CreateWordConnection();

            iwc.Language1 = SelectedDictionaryLeft.Language;
            iwc.Language2 = SelectedDictionaryRight.Language;
            iwc.Word1     = SelectedWordLeft.Text;
            iwc.Word2     = SelectedWordRight.Text;
            _dao.RemoveWordConnection(iwc);
            _wordConnections = _dao.GetAllWordConnections();
        }
예제 #3
0
 public void AddWordConnection(WordConnectionBase iwc)
 {
     db.WordConnections.Add((WordConnection)iwc);
     db.SaveChanges();
 }