private void buttonSave_Click(object sender, EventArgs e) { ClientSelection client = (ClientSelection)comboBoxClients.SelectedItem; FeelingType feelingtype = (FeelingType)comboBoxFeeling.SelectedItem; if ((client != null) && (feelingtype != null)) { try { using (ProjetSGBDEntities context = new ProjetSGBDEntities()) { context.NewFeeling(CurrentClient.Id, client.Id, feelingtype.Id, CurrentClient.Acronym); } } catch (Exception ex) { ModelError modelError = new ModelError(ex); MessageBox.Show(modelError.Message, "Erreur fatale!", MessageBoxButtons.OK, MessageBoxIcon.Error); DialogResult = DialogResult.None; } } }