public static string Delete(reponse__sondage ReponseS) { db.reponse__sondage.Attach(ReponseS); db.reponse__sondage.Remove(ReponseS); db.SaveChanges(); return("La réponse a bien été supprimé"); }
public static string Modify(reponse__sondage ReponseS) { db.reponse__sondage.Attach(ReponseS); db.Entry(ReponseS).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return("La reponse d'une question de sondage a été modifié correctement"); }
private void button_ValiderReponse_Click(object sender, RoutedEventArgs e) { reponse__sondage rs = new reponse__sondage() { Intitule = textBox_ModifReponse.Text }; listView_Reponse.Items.Add(rs); listView_Reponse.Items.Refresh(); }
private void button_AjoutReponse_Click(object sender, RoutedEventArgs e) { var reponse = new reponse__sondage { Intitule = textBox_AjoutReponse.Text }; R.Add(reponse); listView_Reponse.ItemsSource = R; listView_Reponse.Items.Refresh(); }
public static string Add(reponse__sondage ReponseS) { db.reponse__sondage.Add(ReponseS); db.SaveChanges(); return("La réponse a bien été ajouté"); }
public static reponse__sondage Select(int id) { reponse__sondage ReponseS = db.reponse__sondage.Find(id); return(ReponseS); }