private async void btnSave_Click(object sender, RoutedEventArgs e) { int index = combLanguages.SelectedIndex - 1; string trm, definition; trm = txtTerm.Text; definition = txtDefinition.Text; if(trm.Contains("123456789") ) { messageBox("NUMERIC VALUES"); } if (index == -1) { messageBox("please select the language you want to add word and definition to"); }else if (trm == "" || definition == "") { messageBox("Please fill all the field"); } else { tblDictionary objNewWord = new tblDictionary() { term = trm, defination = definition, langID = index }; //await App.conn.InsertAsync(objNewWord); } }
private async void setDataInDatabaseAsync(string term, string dif, int LangId) { //insert into a database tblDictionary newRes = new tblDictionary() { term = term, defination = dif, langID = LangId }; // SQLiteAsyncConnection conn = new SQLiteAsyncConnection("Lang_Dict.db"); await conn.InsertAsync(newRes); }