Beispiel #1
0
        private void BtnDelete(object sender, RoutedEventArgs e)
        {
            using (var db = new DBEntity())
            {
                db.Dictionary.Remove(wordTranslate);
                db.SaveChanges();
            }

            WindowUpdate();
        }
Beispiel #2
0
        private void BtnUpdate(object sender, RoutedEventArgs e)
        {
            wordTranslate.Word      = tbxWord.Text;
            wordTranslate.Translate = tbxTranslate.Text;

            using (var db = new DBEntity())
            {
                db.Dictionary.Update(wordTranslate);
                db.SaveChanges();
            }

            WindowUpdate();
        }
Beispiel #3
0
        private void BtnAdd(object sender, RoutedEventArgs e)
        {
            var wordTranslate = new WordTranslate()
            {
                Word      = tbxWord.Text,
                Translate = tbxTranslate.Text
            };

            using (var db = new DBEntity())
            {
                db.Dictionary.Add(wordTranslate);
                db.SaveChanges();
            }

            WindowUpdate();
        }