private void retour_Click(object sender, RoutedEventArgs e) { if (ct.getQuestionnaireById(qu).Id_enquete.HasValue) { detailEnquete page = new detailEnquete(ct.getQuestionnaireById(qu).enquete1); NavigationService.Navigate(page); } else { modifSondage page = new modifSondage(); NavigationService.Navigate(page); } }
private void questions_Click(object sender, RoutedEventArgs e) { try { if (nvTheme) { if (themesParents.SelectedIndex == -1) { theme newTheme = ct.AddThemeAlone(themes.Text); if (enqueteExistante) { newEnquete = ct.UpdateEnquete(enquete.Id, titreChoisi.Text, inputDescription.Text, newTheme.nom, int.Parse(inputNbQ.Text), disponibilite.IsChecked.Value); } else { newEnquete = ct.AddEnquete(titreChoisi.Text, inputDescription.Text, newTheme.nom, int.Parse(inputNbQ.Text), disponibilite.IsChecked.Value); } } else { if (enqueteExistante) { newEnquete = ct.UpdateEnqueteWithThemeWithThemeParent(enquete.Id, titreChoisi.Text, inputDescription.Text, themes.Text, themesParents.Text, int.Parse(inputNbQ.Text), disponibilite.IsChecked.Value); } else { newEnquete = ct.AddEnqueteWithThemeWithThemeParent(titreChoisi.Text, inputDescription.Text, themes.Text, themesParents.Text, int.Parse(inputNbQ.Text), disponibilite.IsChecked.Value); } } } else { newEnquete = ct.AddEnquete(titreChoisi.Text, inputDescription.Text, themes.SelectedItem.ToString(), int.Parse(inputNbQ.Text), disponibilite.IsChecked.Value); } if (enqueteExistante) { detailEnquete page = new detailEnquete(newEnquete); NavigationService.Navigate(page); } else { ajouterSE page = new ajouterSE(newEnquete, int.Parse(inputNbQ.Text), 1); NavigationService.Navigate(page); } } catch (System.FormatException) { erreur.Visibility = Visibility.Visible; } }
private void Button_Click(object sender, RoutedEventArgs e) { detailEnquete page = new detailEnquete(((FrameworkElement)sender).DataContext as enquete); NavigationService.Navigate(page); }