private void Supprimer(object sender, RoutedEventArgs e) { PlageViewModel p = (PlageViewModel)listePlages.SelectedItem; lp.Remove(p); PlageORM.supprimerPlage(p); listePlages.ItemsSource = lp; }
public static PlageViewModel getPlage(int id) { DAOPlage pDAO = DAOPlage.getPlage(id); int idCom = pDAO.idCommuneDAOPlage; CommuneViewModel c = CommuneORM.getCommune(idCom); PlageViewModel p = new PlageViewModel(pDAO.idDAOPlage, pDAO.nomDAOPlage, c, pDAO.superficieDAOPlage); return(p); }
public ComptageViewModel(int nbDeParticipants, EtudeViewModel etude, PlageViewModel plage, PersonneViewModel personne, NbEspecesViewModel nbEspeces, string coordonnees) { this.nbDeParticipants = nbDeParticipants; this.etude = etude; this.plage = plage; this.personne = personne; this.nbEspeces = nbEspeces; this.coordonnees = coordonnees; }
private void Ajouter_une_plage(object sender, RoutedEventArgs e) { try { CommuneViewModel commune = (CommuneViewModel)listeCommunes.SelectedItem; PlageViewModel pl = new PlageViewModel(nomTextBox.Text, commune, Int32.Parse(supTextBox.Text)); PlageORM.ajouterPlage(pl); this.NavigationService.Navigate(new PageListPlages()); } catch { } }
public static ObservableCollection <PlageViewModel> listePlage() { ObservableCollection <DAOPlage> lDAO = DAOPlage.listePlages(); ObservableCollection <PlageViewModel> l = new ObservableCollection <PlageViewModel>(); foreach (DAOPlage element in lDAO) { int idCom = element.idCommuneDAOPlage; CommuneViewModel c = CommuneORM.getCommune(idCom); // Plus propre que d'aller chercher le métier dans la DAO. PlageViewModel p = new PlageViewModel(element.idDAOPlage, element.nomDAOPlage, c, element.superficieDAOPlage); l.Add(p); } return(l); }
public static void insertPlage(PlageViewModel p) { DALPlage.insertPlage(new DAOPlage(p.nomPlageProperty, p.Commune.idCommuneProperty, p.superficieProperty)); }
public static void deletePlage(EnsemblesViewModel ensembles, PlageViewModel plage) { DAOPlageEnsemble.supprimerPlageEnsemble(ensembles, plage); }
public static void ajouterPlage(EnsemblesViewModel ensembles, PlageViewModel plage) { DAOPlageEnsemble.insertPlageEnsemble(ensembles, plage); }
public void deletedPlageEtude(PlageViewModel plage, EtudeViewModel etude) { DALPlageEtude.deletedPlageEtude(new DAOPlageEtude(plage.idPlageProperty, etude.idEtudeProperty)); }
public static void supprimerPlage(PlageViewModel plage) { DAOPlage.supprimerPlage(plage.idPlageProperty); }
public static void ajouterPlage(PlageViewModel plage) { DAOPlage.insertPlage(plage); }