private void AddTroupe_Click(object sender, RoutedEventArgs e) { if(TroupeNameTxtBox.Text!=String.Empty && ShowTypeTxtBox.Text != String.Empty && MembersListView.Items.Count > 0) { newTroupe.NameTroupe = TroupeNameTxtBox.Text; newTroupe.ShowType = ShowTypeTxtBox.Text; using (var context = new CircusContext()) { context.Add(newTroupe); context.AddRange(memberTroupes); context.SaveChanges(); } ClearComboBox(); MessageBox.Show("You have save your Troupe !"); } else { MessageBox.Show("Have you complete all cases ?"); } }