private void _listView_ItemSelected(object sender, SelectedItemChangedEventArgs e) { _nouvelIndex = (NouvelIndex)e.SelectedItem; _idclientEntry.Text = _nouvelIndex.IdClient.ToString(); _nomEntry.Text = _nouvelIndex.Nom; _genreEntry.Text = _nouvelIndex.Genre; _souscriptionEntry.Text = _nouvelIndex.Souscription; }
private async void _button_Clicked(object sender, EventArgs e) { var db = new SQLiteConnection(_dbPath); NouvelIndex nouvelIndex = new NouvelIndex() { IdClient = Convert.ToInt32(_idclientEntry.Text), Nom = _nomEntry.Text, Genre = _genreEntry.Text, Souscription = _souscriptionEntry.Text }; db.Update(nouvelIndex); await Navigation.PopAsync(); }
private async void _saveButton_Clicked(object sender, EventArgs e) { var db = new SQLiteConnection(_dbPath); db.CreateTable <NouvelIndex>(); var maxPk = db.Table <NouvelIndex>().OrderByDescending(c => c.IdClient).FirstOrDefault(); NouvelIndex nouvelIndex = new NouvelIndex() { IdClient = (maxPk == null ? 1 : maxPk.IdClient + 1), Nom = _nomEntry.Text, Genre = _genreEntry.Text, Souscription = _souscriptionEntry.Text }; db.Insert(nouvelIndex); await DisplayAlert(null, nouvelIndex.Nom + " Sauver", "Ok"); await Navigation.PopAsync(); }
private void _listView_ItemSelected(object sender, SelectedItemChangedEventArgs e) { _nouvelIndex = (NouvelIndex)e.SelectedItem; }